Repository navigation
fix(core): park execution while a revert is staged - #55394
CasualDeveloper wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
I found nothing that blocks a merge. I ran the PR's new tests against the base and they reproduce the race: a wake or resume while a revert is staged, including one racing an in-progress staging, starts a run there, and the prepared-replacement and restage cases fail too. With this PR the run waits until the revert is cleared or committed, and the Core session/runner/execution tests (293) and Core typecheck pass. I also checked that taking the inbox lock again when finalizing a prompt can't deadlock, because admit/reconcile don't take that lock themselves, and that committing a parked revert leaves no input stuck in the queue.
Public API: unchanged (Core internals only; no API, plugin, config or event changes).
Related: #54150
beb1109 to
d1af38f
Compare
Serialize staging with drain state reads and prompt finalization. Select Location services before locking, retain fresh revert snapshots when restaging, and reconcile winning admissions before committing a replacement boundary. Cover real wake/resume and public staging races, replacement admission, restaging, and delayed pending, delivered, and conflicting retries.
d1af38f to
e29dc6a
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Please reopen this PR. It was closed by the November 14 age/reaction cleanup, and I’m still maintaining the fix. This is the focused Core-only split requested in #55315; the earlier automated review reproduced the races and reported no merge blocker. On November 16 I refreshed the maintained copy onto Those fresh results are from the maintained combined source. This PR still points at |
|
I’ve now refreshed this PR’s own branch onto The fork branch is verified at the linked commit. GitHub's closed PR record still reports the older head SHA, so the link above identifies the refreshed revision. |
Issue for this PR
Fixes #37751
Split out of #55315.
Type of change
What does this PR do?
I narrowed #55315 to the reported Core race. Wake/resume parks a session while a revert is staged. Staging and the drain's state read share the Inbox lock, so a wake cannot start through an in-flight snapshot restore.
Prompt preparation stays outside that lock. Finalization reloads the boundary and reconciles retries before committing, so accepted replacements don't get stranded and delayed retries don't erase the winning admission. Location/plugin initialization stays outside the lock. Same-session input waits for snapshot work; other sessions remain independent.
This is Core-only: no new API fields, plugin capability changes, or App/TUI changes. The refresh preserves upstream cooperative stopping and subagent recovery.
How did you verify your code works?
devat0354362b857beae78166d4305f06c0b2f47c251e.bun run checkpasses. These checks ran on this focused branch, without the other feature branches.Screenshots / recordings
Logic change; no visual changes.
Checklist
Process: human-directed, with agentic assistance from openai/gpt-6-astra.
Added by the opencode bot (AI-generated).
Related: #54150