Repository navigation
fix(server): preserve task and session ownership during cancellation - #161
Merged
Merged
Conversation
|
Stop delayed remote follow-ups whose local task is rejected after Parent Stop. Include remote-only tasks in the normal thread Stop walk. Scope native-load cache completion to its owning raw runtime. Integrate reviewed main #160. Validated with 309 focused tests, changed-file static gates, and direct server/evals/scripts typechecks.
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.
Cancellation and stale provider callbacks can leave running work untracked or close the session that currently owns it. A deeper audit after #159 reproduced five defects on the merged source:
compactThreadandresumeTurnbypassed the manager's turn lifecycle, so quiet work could reach the idle close/unload threshold while still active.This change checks raw-runtime ownership before clearing activity and applies the existing turn lifecycle to supported native entrypoints. Remote launches and follow-ups finish local recording and follower admission after an acknowledgement; metadata preflight and remote calls remain interruptible. Same-key retries retain their recorded task identity. Settings publication completes within the existing protected commit section.
Verification
Each defect has a failing regression before its production fix. The final remote follow-up table also proves that cancellation during preflight sends no remote message, checks local ownership before retry, and verifies subsequent Parent Stop behavior.
On the final combined tree,
vp run check:changed 68193a2d1c69d3e237bae0f279228135af1afebe --concurrency 1passed the native build, formatting, lint, both Knip passes, generated GraphQL checks, and 221 tests across the three owning files plus Agent Context Budget. Its cached typecheck launcher cannot initializeseccomp_unotifyin this environment, so the gate invocation exits nonzero. The same configuredeffect-tsgo tsrs --noEmitchecks passed directly for all three affected packages: server, evals, and scripts. No check or budget configuration was weakened.GitHub Fork CI, including final Fork Check, Agent Context Budget, and every other applicable check must pass on the exact published head before merge.
No live private provider, paid model, native desktop/mobile session, or process-crash guarantee is claimed. The remote fix covers caller cancellation after acknowledgement; transport loss before acknowledgement still relies on the existing idempotent retry contract.
Implemented and verified with GPT-6 Astra Pro / ChatGPT.
Further audit: three additional lifecycle defects
The second pass found and fixed three additional paths on this PR's reviewed head:
All three production changes and their regression boundaries received independent review. Current main, including the already audited #160, is integrated without unrelated source changes. These fixes do not promise remote cleanup when the destination becomes unreachable, and no live private provider or browser execution is claimed.
Latest head verification
Reviewed head:
c3aa4694e978561cbc0027c45e07e67c4a80a1ae; its Git tree exactly matches locally validated tree2d788d54800ced86629d2beb2574eeb6b3210b9e.vp run check:changed 09efb428b74ef6a1d22be25bdba9c62f8a180669 --concurrency 1passed all 309 tests across eight files, the native build, formatting, lint, both Knip scans, and generated GraphQL checks. The only failed step was the cached typecheck process launcher (seccomp_unotifyis unavailable here). The same configuredeffect-tsgo tsrs --noEmitchecks then passed directly for server, evals, and scripts. No CI or budget gate was changed.The new head must pass GitHub Fork CI including final Fork Check, Agent Context Budget, and every other applicable check before merge.
Implemented and verified with GPT-6 Astra Pro / ChatGPT.