Skip to content

Improve handling of large tool outputs to prevent API errors #14775

@natthapolvanasrivilai

Description

@natthapolvanasrivilai

Currently, when a tool (such as run_shell_command) produces a very large output, it can cause the Gemini API to return a 429 Resource Exhausted error due to the context window being exceeded. This can lead to unexpected failures and reduced reliability of the agent. A mechanism is needed to gracefully handle such large outputs, guiding the model to process them in a more efficient manner, possibly by redirecting output to temporary files and reading them in chunks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitypriority/p2Important but can be addressed in a future release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions