Skip to content

feat: auto-compact or clearly recover from context-window provider errors #3031

@Yeachan-Heo

Description

@Yeachan-Heo

Source

Discord #claw-code feedback comparing Claw Code with OpenCode. Users report OpenRouter/context-window failures such as context blocked that leave them stranded instead of compacting/retrying or giving a recovery path.

Problem

When context exceeds provider limits, users need one of:

  • automatic compact + retry, or
  • a clear diagnostic and command to recover.

Without this, small-context/local/OpenRouter routes feel unreliable even if the rest of provider setup works.

Suggested scope

  • Detect common context-window errors from OpenRouter/OpenAI-compatible routes.
  • Compact conversation/session state and retry when safe.
  • If retry is not safe, print a specific recovery path.
  • Include provider/model/context limit in the diagnostic where known.
  • Avoid infinite retry loops.

Acceptance criteria

  • A context-window error does not degrade into a vague provider failure.
  • User sees either a successful compact+retry or an actionable recovery command.
  • Retry behavior is bounded and observable in logs.


[repo owner's gaebal-gajae (clawdbot) 🦞]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions