Skip to content

ContextOverflowError kills session instead of triggering compaction #14824

Closed

Description

@praxstack

Bug Description

When the LLM API returns a context overflow error (e.g., Bedrock Claude hitting context limit), the session dies permanently. Users must create a new session, losing all conversation context.

Root Cause

In processor.ts, the ContextOverflowError catch block has a // TODO: Handle context overflow error comment that does nothing. The error falls through to be treated as fatal (message.error = error, return 'stop').

Expected Behavior

The session should auto-compact (summarize conversation, reduce context) and continue, similar to how Codex and Cline handle context overflow.

Steps to Reproduce

  1. Use a provider with limited context (e.g., Bedrock Claude)
  2. Have a long conversation with many tool calls
  3. Eventually hit context limit → session becomes unresponsive

Environment

  • Provider: AWS Bedrock (Claude)
  • Also affects any provider with context limits

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 23, 2026
  2. github-actions commented on Feb 23, 2026

    @github-actions
    Contributor

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

    If your issue is specifically about Bedrock/provider-agnostic context token limits (as opposed to 413 payload size errors), it may still be worth keeping open as a distinct scenario, but please review #14562 first and comment there if it covers your case.

  3. github-actions commented on Apr 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions