Interactions File Search: 3 stores trigger “Max 5 corpora”; GenerateContent works

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 /v1 and /v1beta Interactions 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));
}

Hello @Leo_Kraushaar ,

Thank you for sharing the detailed comparison tests. We have reproduced this behavior. We are looking into it.

Thank you Mahesh. Do you have any updates or workarounds? This is a pretty serious blocker for us.

Hello @Leo_Kraushaar ,

We recently deployed an update to address this issue. Could you please try again and let us know if you continue to face any issues?

@Mahesh_Sutar yes it works now! Thank you for such a quick resolution and keeping me updated.