[agent] 🤖 fix: preserve queue-cut continuations - #4045
Conversation
|
@codex review Please review the atomic queue-cut handoff and its cancellation behavior. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (8)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review The latest commit covers the same handoff for provider-executed tools. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8d2813b80
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93c4805c4f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86172e8046
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15efef1d9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 15efef1d9b
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed20fe3001
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: ed20fe3001
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f73051305
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a3adcb63c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef8ca9293e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Skip canceled queue heads when selecting the continuation. Restore cancellation when a provider stream cut fails. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Use the next live FIFO entry for dispatch, continuation, and cut attribution. This keeps canceled heads from misclassifying the committed cutter. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Treat canceled-only queues as empty for continuation checks. Restore provider claims when user interruption abandons the queue cut. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Retain SDK and provider claim ownership until dispatch. Pin committed entries and discard canceled entries without entering preparation. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Keep queue claims through preparing admission. Reject late claims during hard interrupts. Clear canceled queue latches. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Restore claims when hard interruption fails. Release claims before irreversible acceptance. Clear canceled dispatch state and emit restored queue state. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Keep queue admission serialized through stream start. Preserve claimed user entries when Send now follows a hard interrupt. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Preserve only queued user claims during Send now. Cancel synthetic dispatches before acceptance. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Keep admitted user input during Send now. Notify failure-only callbacks when cancellation wins before acceptance. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Delay claimed user admission until descendant cleanup finishes. Requeue reversible input when a later Stop cancels it. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Finalize durable queue callbacks before a hard Stop blocks provider startup. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Release irreversible claims after descendant cleanup. Let their exact provider turn consume the durable row. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Release irreversible synthetic admissions after descendant cleanup. Keep stale probes disabled after the rollback boundary. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Mark canceled synthetic turns as provider-excluded after their rollback boundary. Keep queue settlement blocked until hard-stop cleanup finishes. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
Filter stopped synthetic rows from each history-based model transcript. Keep claimed wakes cancelable until StreamManager owns startup. 🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
09755ec to
5fa3537
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fa3537269
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 5fa3537269
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: a559620eac
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
🤖 Generated with [xum](https://xum.sh) Co-authored-by: Mux <noreply@coder.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: 29da334d8f
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| cancelSignal: dispatchClaim.queueClaim.admissionSignal, | ||
| admissionStale: () => | ||
| !dispatchClaim.admissionIrreversible && | ||
| (dispatchClaim.queueClaim.admissionSignal.aborted || | ||
| internal?.admissionStale?.() === true), |
There was a problem hiding this comment.
Security: Cancel claimed wakes when task_stop wins admission
With a bash-monitor wake claimed after task_await returns the same output, if an ancestor runs task_stop while the wake is dequeued in PREPARING, this replacement discards the already-aborted reconciler signal. task_stop only clears queue-resident entries and only stops AIService when a stream is registered, while this path calls AgentSession.sendMessage directly and supplies no admissionStale probe. The interrupted task can therefore start a provider/tool-capable turn from attacker-influenceable process output after task_stop succeeds. Carry the task stop epoch/status into the claimed admission, or let task_stop cancel the active claim before returning.
Useful? React with 👍 / 👎.
Summary
Preserve agent execution when a monitored background task settles during
task_await.Background
A monitor wake can queue while
task_awaitreads the same terminal output. The queued wake then stops the model step.The output read makes the wake redundant. The reconciler cancels it before dispatch, so the workspace becomes idle without a continuation.
Implementation
Risks
Risk is low. The queue change only affects cancellation after an entry commits a tool-end stream cut.
An obsolete wake can run when newer process state supersedes it. This preserves progress, and the newer wake still follows.
Generated with
xum• Model:openai:gpt-5.6-sol• Thinking:xhigh• Cost:$0.00