We’re seeing a reproducible difference between Interactions and GenerateContent using gemini-3.8-flash.
| Request | Result |
|---|---|
| Interactions with one or two real, indexed stores | Succeeds |
| Interactions with three distinct stores | HTTP 400 |
| GenerateContent with the same three stores and metadata filter | Succeeds |
| Streaming GenerateContent with those three stores | Succeeds, with expected document citations |
The Interactions error is:
FileSearch.file_search_store_names: [FIELD_INVALID] Max 5 corpora can be specified
We also verified:
- The outgoing request contains exactly three distinct store names.
- Direct REST requests reproduce the failure, ruling out SDK serialization.
- Both
/v1and/v1betaInteractions fail. - Splitting the stores across three File Search tool declarations produces the same error.
- A separate test using three inaccessible store names produces the same count error, without accessing application documents.
Is this a known Interactions issue? What is the supported maximum number of File Search stores per interaction, and could the team investigate why three triggers a five-corpus limit?
We have a standalone reproduction available and can provide sanitized diagnostic details.
Reproduction .mjs script:
// Standalone reproduction. Uses no existing stores, documents or SHAI database.
import { randomUUID } from 'node:crypto';
if (process.argv.length !== 3 || process.argv[2] !== '--confirm-provider-requests') {
throw new Error('Use --confirm-provider-requests. Sends three index-access checks and two synthetic Interactions requests.');
}
const key = process.env.GEMINI_API_KEY;
if (!key) throw new Error('GEMINI_API_KEY is required.');
const base = 'https://generativelanguage.googleapis.com/v1beta';
const headers = { 'x-goog-api-key': key, 'content-type': 'application/json' };
const names = Array.from({ length: 3 }, () => `fileSearchStores/shaimissing${randomUUID().replaceAll('-', '').slice(0, 20)}`);
for (const name of names) {
const check = await fetch(`${base}/${name}`, { headers, redirect: 'error', signal: AbortSignal.timeout(10000) });
const data = await check.json();
if (!(check.status === 404 || (check.status === 403 && data.error?.status === 'PERMISSION_DENIED'))) {
throw new Error('Index was not proven inaccessible; aborted without querying.');
}
}
console.log(JSON.stringify({ verifiedInaccessible: 3, existingIndexesUsed: 0 }));
for (const count of [2, 3]) {
const response = await fetch(`${base}/interactions`, {
method: 'POST', headers, redirect: 'error', signal: AbortSignal.timeout(65000),
body: JSON.stringify({
model: 'gemini-3.8-flash',
input: 'Use File Search to find the public visitor welcome phrase in the supplied KP visitor guide.',
tools: [{
type: 'file_search', file_search_store_names: names.slice(0, count),
metadata_filter: 'shai_document_id = "00000000-0000-0000-0000-000000000000"',
}],
generation_config: { thinking_level: 'low' }, store: false, stream: false,
}),
});
const data = await response.json();
const result = { storeCount: count, httpStatus: response.status };
if (!response.ok) {
let message = String(data.error?.message ?? data.message ?? 'UNCLASSIFIED_ERROR').replaceAll(key, '[key]');
for (const name of names) message = message.replaceAll(name, '[inaccessible-store]').replaceAll(name.slice('fileSearchStores/'.length), '[inaccessible-store]');
result.error = message.slice(0, 500);
} else {
result.status = data.status;
result.stepTypes = (data.steps ?? []).map(step => step.type);
}
console.log(JSON.stringify(result));
}