Skip to content

Bug: Context window exceeds limit (2013) — blocks file reads and breaks sessions #1775

@OneStepAt4time

Description

@OneStepAt4time

Bug Description

Sessions hit a context window limit of approximately 2013 tokens, causing API errors that block Claude Code operations:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"invalid params, context window exceeds limit (2013)","request_id":"..."}}

When this happens:

  1. File read operations fail with invalid_request_error
  2. The session cannot proceed with tasks requiring file reads
  3. Sessions become effectively broken until killed and recreated

Impact

  • Sessions become unusable after ~3-5 tool calls or ~2-3 minutes
  • Every complex task (reading files, editing code) risks hitting the limit
  • Previously filed: comment on Sessions become unusable after ~2013 tokens of context (context window limit) #1773 confirming MemPalace MCP calls trigger it
  • Now confirmed: even basic file reads trigger it when the session context is accumulated
  • The limit appears to be a hard ceiling (~2013 tokens) that cannot be expanded

Steps to Reproduce

  1. Create a new Aegis session
  2. Send a coding task requiring file reads
  3. After ~3-4 file operations, context window fills up
  4. Subsequent file reads return the 2013 token limit error
  5. Session is effectively dead

Expected Behavior

Claude Code sessions should maintain context across all operations without hitting a ~2013 token ceiling. The limit should scale with the model context window.

Environment

  • Aegis version: 0.5.2-alpha (observed)
  • Platform: win32
  • Model: claude-3.5-sonnet
  • Session ID: 588d3c7e-2a8c-4714-a610-475aab6d3632 (killed after context hit)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions