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
core/session: input can stay unconsumed in inbox if the process exits between enqueue and claim #51746
Enqueueing is persisted before the execution claim is taken, but restart recovery only scans top-level sessions that already have a claim. If the process exits in the window between enqueue and claim, the input stays in the inbox unconsumed until some later wake-up happens to pick it up.
Environment
opencode version: source tree root package.json reports 2.0.17; audited at commit 041885d838c7eea81cffbe446e0cb0ac6f197728 (branch v2)
Not reproduced. This is a source-review finding from a read-only audit of the v2 tree at the commit above. The trigger window is described below; I did not manage to construct it reliably on my machine.
Queue an input for an execution (state is persisted).
Kill the process before the execution claim is written.
Restart and observe that recovery does not rescan that session's pending intent.
Expected Behavior
Startup recovery also scans persisted intents that are marked for automatic execution and not yet consumed, so an input enqueued just before the crash is resumed (subject to the existing resume:false admit-only semantics, which should be preserved).
Actual Behavior
Recovery only walks sessions that have a claim: packages/core/src/session/session.ts:167-175, execution.ts:79-84 and 114-119, store.ts:194-204, restart.ts:219-227.
Additional Context
Impact: an input can hang for a long time (until an unrelated wake-up), or effectively be lost if nothing wakes the session.
Suggested fix: include "needs auto-execution and not yet consumed" persisted intents in the startup scan.
Suggested tests: crash between enqueue and claim; assert the input is resumed on restart.
This issue appears not to use one of the issue templates. Please use the Bug Report template and include its required Description field with real content; the current Summary section does not supply that required field.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
#35646: V2 startup recovery after restart; this issue concerns pending input admitted before a claim exists.
#44807: prompts left undelivered in the inbox after a run dies, though that report describes a different stuck-session cause.
If you believe this was flagged incorrectly, please let a maintainer know.
Activity
github-actions commentedon Sep 28, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Sep 28, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.