Skip to content

[BUG] Regression: "Gemini generate context stream error: No output generated" on large contexts (>130k tokens) in v3.47.3 #11307

@ModelkinIY

Description

@ModelkinIY

Problem (one or two sentences)

Since updating to the latest versions (specifically noticeable in v3.47.3), the Gemini provider (Google AI) consistently fails when the context window exceeds ~130k tokens. The error message is: Provider ended the request: Gemini generate context stream error: No output generated. Check the stream for errors.

This appears to be a regression, as similar tasks with the same context size and complexity were handled flawlessly in earlier versions (v3.3.x).

Context (who is affected and when)

All users who work with large codebases or long log files using Gemini models. This happens during complex debugging or refactoring tasks when the conversation history grows beyond 100k-130k tokens. It prevents the AI from answering even simple questions once the "memory" (context) of the chat is full.

Reproduction steps

1)Environment:
Extension Version: 3.47.3
VS Code Version: 1.96+
Provider: Google AI (Native SDK)
Model: gemini-2.5-flash / gemini-3-flash-preview
Context Size: ~133,000 - 150,000 tokens

2.1) Initialize a task in a large workspace (e.g., ESP-IDF project with multiple submodules).
2.2)Provide a large log file or read several large source files so the tokensIn count exceeds 130k.
2.3)Issue a command that requires Tool Use (e.g., codebase_search or readFile).
2.4)The model starts "Thinking", but the stream immediately breaks with "No output generated" before any tool call is made.

Expected result

The AI should process the provided context (even if it's large) and start responding or calling a tool. Even if it takes 30-60 seconds to "think", the connection should remain open until the first token is generated, as it did in previous versions (v3.3.x).

Actual result

The stream terminates almost immediately or after a short delay with the error: "Gemini generate context stream error: No output generated". No response is shown to the user, and the task becomes stuck, forcing a manual "Reset Context" and loss of project history to make the model work again.

Variations tried (optional)

Tried increasing AbortSignal timeout to 120s in gemini.ts, but the error persists.

App Version

3.47.3

API Provider (optional)

Google Gemini

Model Used:

gemini-2.5-flash, gemini-3-flash-preview.

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

{
  "error": {
    "timestamp": "2026-02-08T09:30:54.630Z",
    "details": "Provider ended the request: Gemini generate context stream error: No output generated. Check the stream for errors."
  },
  "history": [
    { "role": "user", "tokensIn": 133010 }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions