Repository navigation
fix(runtime-api): project dynamic tool-result cancellation through the SSE compat stream - #6849
Merged
Hmbown merged 3 commits intoOct 6, 2026
Conversation
…e SSE compat stream When a turn is interrupted (or its engine goes away) while an external tool call is pending, the resolution is published as `approval.decided` with `decision: "deny"` plus a `cancelled: true` flag, so consumers can tell "nobody answered this" apart from a refusal. The SSE compat projection already forwarded the `timeout` resolution flag but dropped `cancelled`, so an SSE client watching the compatibility stream saw an ordinary deny: pending UI stayed tied to a call whose turn no longer exists, or a cancellation read as the operator refusing the call. Forward `cancelled` alongside `timeout` in the projection, pin both shapes in the compat-mapping test, and document the two flags in the compatibility stream section of docs/RUNTIME_API.md. Signed-off-by: asto <asto18089@126.com>
Hmbown
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a turn is interrupted while an external approval is pending, the resolution is published as
approval.decidedwithdecision: "deny"pluscancelled: true, so consumers can tell "nobody answered" apart from a refusal. The SSE compatibility projection forwardedtimeoutbut droppedcancelled, so SSE clients saw an ordinary deny and kept a pending prompt tied to a dead turn.Forward
cancelledalongsidetimeoutin theapproval.decidedcompat arm, pin both shapes in the compat-mapping test, and document the two flags in the compatibility-stream section ofdocs/RUNTIME_API.md.Testing
cargo test -p codewhale-tui --lib stream_compat— acancelled: truepayload now projects the flag through the SSE frame; the assertion fails without the projection change;approval.timeoutprojections unchangedcargo clippy -p codewhale-tui --all-targets --all-features --lockedDisclosures: the projection is payload-driven and forward-compatible; the test pins the mapping, not a real end-to-end interrupt.
Adapted from the Pinvou fork's timeout audit (Pinvou/CodeWhale
d349f2537), renamed to upstream'scancelledflag (the fork's original called itinterrupted).Checklist
docs/RUNTIME_API.md)CHANGELOG.mdchangesNo-Issue: bounded SSE compatibility correction submitted directly as this contributor PR.