You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode run exits 1 after auto-compaction recovers from a provider 413 #39573
opencode run exits 1 (and the TUI shows an error toast) when a provider rejects a request for size (HTTP 413 / ContextOverflowError), even though auto-compaction recovers: the session compacts, retries, and produces a complete correct answer. Anything scripting opencode run or tailing --format json sees the run as failed.
Cause: the auto-compact branch in processor.tshalt() publishes Session.Event.Error before attempting recovery:
Consumers (cli/cmd/run.ts, tui/app.tsx, app/context/notification.tsx) all treat session.error as the run's outcome. This publish is inconsistent with the rest of the codebase: it doesn't set message.error (the durable message says no error), it isn't followed by idle or a throw, and nothing consumes it — compaction is triggered by the "compact" return value. Retried 429s and the proactive overflow check are both silent.
Steps to reproduce
Run a non-interactive prompt against a session large enough that the provider returns 413, with auto-compaction enabled
Compaction recovers and the final answer is produced
opencode run exits 1; --format json stdout contains an error event
Reproducible with the test-LLM harness: push a 413 (request_too_large), then two text replies; opencode run --format json exits 1 despite emitting the recovered output.
Activity
github-actions commentedon Sep 29, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.