Repository navigation
fix(gateway): retain continuation authority for every child run - #178693
Conversation
Choose continuation authority from persisted spawnedBy lineage at the shared run-retention boundary. Remove the native-subagent admission exception and carry child lineage through agent, chat, and Talk admission. Cover an interrupted child's sessions_send continuation after its recovered parent finishes. Preserve source validation, scope and model ceilings, revocation, and parent Stop cancellation. Focused recovery, resume, cancellation, and Talk suites pass. The full spawn file passed all 64 cases. A later repeat hit the existing model-entry wait and a subsequent fixture timeout; the five-case recovery/native subset passes, but the repeat-only failure remains unresolved.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ 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: needs real behavior proof before merge. What this changesThis PR uses persisted child-session lineage to retain continuation authority across agent, chat, and Talk admission. Example: A recovered parent resumes eight interrupted children and finishes before them.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer-authored PR addresses a current recovery bug, but the Talk lineage handoff is overwritten before retention. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherGateway admission turns authenticated requests and session lineage into retained run authority, which governs execution, cancellation, and privileged effects. flowchart TD
A[Authenticated request] --> B[Session admission]
B --> C[Persisted child lineage]
C --> D[Shared authority retention]
D --> E[Child execution]
F[Live operator revocation] --> D
D --> G[Cancellation and effect checks]
Technical reviewBest possible solution: Keep continuation selection in the shared retention owner and ensure Talk passes persisted lineage after every overlay. Do we have a high-confidence way to reproduce the issue? Current-main admission shows the native-only exception, and the PR reports a red-on-base resumed-child regression plus live crash recovery failures; no target code was executed during this read-only review. Is this the best way to solve the issue? Centralizing the decision in the existing retention owner is the smallest coherent repair, but Talk's later overlays currently defeat its persisted-lineage assignment. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ce97c81929f1. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete authorization bypass was found, but extended child authority needs final-effect revocation verification. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +11, Tests +56, Docs +1. Total +68 across 8 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 3:20 PM ET / 19:20 UTC. |
…claw#178693) Choose continuation authority from persisted spawnedBy lineage at the shared run-retention boundary. Remove the native-subagent admission exception and carry child lineage through agent, chat, and Talk admission. Cover an interrupted child's sessions_send continuation after its recovered parent finishes. Preserve source validation, scope and model ceilings, revocation, and parent Stop cancellation. Focused recovery, resume, cancellation, and Talk suites pass. The full spawn file passed all 64 cases. A later repeat hit the existing model-entry wait and a subsequent fixture timeout; the five-case recovery/native subset passes, but the repeat-only failure remains unresolved.
…194798) * fix(gateway): accepted turns keep their authority after the sender's run ends A turn admitted by sessions_send (or chat/Talk) from a scheduled or recovered run inherited that run's occurrence-bound operator authority. When the occurrence ended, the receiving session's in-flight turn failed with 'Cron occurrence source authority is no longer active'. #178693 moved only child targets to the retained continuation; every accepted turn now uses it. The continuation still revalidates device, profile, role and access grant. * fix(gateway): sender session cleanup no longer revokes handed-off turns Restored scheduled authority revoked its shared policy signal when the claimed sender session was replaced or removed, so an isolated run's normal exact-run session cleanup still aborted turns it had handed to other sessions. Claim lifecycle now ends only the run-bound authority; the retained continuation keeps device, profile, role and grant revocation. * test: allocate test lines for receiver continuation authority regressions
…penclaw#194798) * fix(gateway): accepted turns keep their authority after the sender's run ends A turn admitted by sessions_send (or chat/Talk) from a scheduled or recovered run inherited that run's occurrence-bound operator authority. When the occurrence ended, the receiving session's in-flight turn failed with 'Cron occurrence source authority is no longer active'. openclaw#178693 moved only child targets to the retained continuation; every accepted turn now uses it. The continuation still revalidates device, profile, role and access grant. * fix(gateway): sender session cleanup no longer revokes handed-off turns Restored scheduled authority revoked its shared policy signal when the claimed sender session was replaced or removed, so an isolated run's normal exact-run session cleanup still aborted turns it had handed to other sessions. Claim lifecycle now ends only the run-bound authority; the retained continuation keeps device, profile, role and grant revocation. * test: allocate test lines for receiver continuation authority regressions
What Problem This Solves
#178186 fixed children newly spawned by a restart-recovered parent turn, but only through a caller-passed special case (
agentRunTracking === "native_subagent"→independentContinuation). Children that were already running when the Gateway died take a different path. Restart recovery resumes them throughsessions_send/nested:<child>, which still retained the parent's run-scoped recovery claim. When the recovered parent turn ended, every resumed child failed:Live, on latest main with #178186 (Codex app-server parent, Gateway
kill -9while the parent was still in its first turn): 2 of 2 runs lost all 8 children, with 16 authority-lost failures and nothing merged.User Impact
Children resumed after a Gateway restart retain continuation authority when the recovered parent turn finishes. Explicit parent Stop and operator revocation still cancel child work. No migration or user action is required.
Why This Change Was Made
The decision is now structural, made at the shared run-retention boundary.
retainGatewayOperatorRunchooses the independent continuation authority from the admitted session's persistedspawnedBylineage, so callers can no longer passindependentContinuation.native_subagentspecial case is removed. One rule covers native spawns, restart-resumed children, nested-lane continuations, follow-ups and steers to a child, and collector children.Evidence
subagent-spawn.production-boundary.test.ts"resumed child": red on base (admitted run operator authority is no longer activeatadmitted-run-context.ts:384) and green with the fix. 18 focused recovery, resume, cancellation and Talk files pass, includingoperator-run-recovery*,server.startup-recovery-*,subagent-registry-restart-recovery,server.sessions-send-resume,session-subagent-resume,in-process-subagent-resume,subagent-parent-recovery.restart-integration,chat-send-subagent-custodyand the Talk authority suites. The full spawn file passed 64/64. One later repeat hit an existing sandbox-fixture model-entry wait under heavy local load; it is unrelated to authority (no authority error or abort in its diagnostics).