opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: Allow continuation after context overflow

Open drwebb opened this issue 3 weeks ago • 1 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Sometimes I have a tool call by a subagent overflow context and get this message, e.g.

This model's maximum context length is 131072 tokens. However, you requested 137717 tokens (105717 in the messages, 32000 in the completion). Please reduce the length of the messages or completion.

In such a case the subagent stops execution, it would be great to allow the model to see that the tool call failed, and continue the subagent execution.

drwebb avatar Dec 06 '25 22:12 drwebb

This issue might be a duplicate of existing issues. Please check:

  • #3153: Subagents should support auto compaction (directly addresses subagent context overflow and continuation)
  • #2464: AT_APICallError with prompt token count exceeding limit (same context overflow error, requests recovery)
  • #4560: Context protection for tool calls when response is large (same problem, proposes saving to file)
  • #4845: Prompt is too long unrecoverable (same context overflow issue with no recovery)
  • #4826: Is automatic tool calling output truncation supported? (addresses same problem through truncation)

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Dec 06 '25 22:12 github-actions[bot]