Skip to content

core/session: input can stay unconsumed in inbox if the process exits between enqueue and claim #51746

Closed as not planned

Description

@ccw751517015-hue

Summary

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)
  • Reported CLI version: 2.0.18 (local desktop build)
  • OS: Windows_NT 10.0.26100 (win32 x64), Node 22.22.2
  • Install/channel: local desktop build
  • Active plugins: @cortexkit/[email protected]

Reproduction

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.

  1. Queue an input for an execution (state is persisted).
  2. Kill the process before the execution claim is written.
  3. 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.

Activity

  1. added
    needs:compliance
    on Sep 28, 2026
  2. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • 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.

  3. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    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.

  4. removed
    needs:compliance
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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