Repository navigation
fix(subagents): settle legacy requester sources across restarts - #175033
Conversation
Retire missing-source requester wakes and yielded continuations through the completion writer while preserving execution results and delivery receipts. Keep failed writes retryable and queue/store handoffs with their existing owners.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
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. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. What this changesThis PR durably settles legacy subagent continuations that lack their original operator source while preserving execution results and delivery receipts. Example: The saved legacy-state-0 record has a requester wake, cleanupCompletedAt 300, and deliveredAt and announcedAt 260.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored PR addresses a distinct legacy restart-recovery defect still present on main; no introduced code defect was identified. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway startup loads saved subagent records, restores completion authority, and passes permanently unavailable continuations to the existing worker-backed completion writer. flowchart TD
A[Gateway startup] --> B[Saved subagent registry]
B --> C[Completion source restoration]
C --> D[Existing completion writer]
C --> E[Existing queue settlement]
D --> F[Persisted results and delivery state]
E --> F
F --> G[Later restart]
Technical reviewBest possible solution: Keep permanent missing-source settlement in the existing completion writer while preserving execution recovery, queued delivery ownership, and retained results. Do we have a high-confidence way to reproduce the issue? Current-main guards leave missing-source requester wakes and yielded records unsettled; the PR reports recurring startup IDs and a baseline SQLite inventory with repeated warnings, but no target code was executed during this review. Is this the best way to solve the issue? The change fixes the durable settlement boundary directly, retains transient retries, and preserves the existing execution, queue, and store-retirement owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9c61a5c4854a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +8, Tests +73, Docs +2. Total +83 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 16, 2026, 11:33 PM ET / October 17, 2026, 03:33 UTC. |
…claw#175033) * fix(subagents): settle legacy requester sources across restarts Retire missing-source requester wakes and yielded continuations through the completion writer while preserving execution results and delivery receipts. Keep failed writes retryable and queue/store handoffs with their existing owners. * fix(subagents): preserve execution recovery before settlement
PR #175033 intentionally makes missing-source requester and yielded continuations settle once without inventing operator authority. These restart-fence fixtures instead need an authorized original requester. Reuse prepareSubagentRecoveryFixture before persisting their rows. Keep existing parent identity in the yielded integration case and preserve all wake, stale-batch, delivery, and deadline assertions. Production code and missing-source settlement coverage remain unchanged. Attribution: current main a1ef282 reproduces three matching failures; pre-#175033 cc19e13 passes seven focused cases while already containing #175044. The ownership-release fix is therefore retained. Validation: both full affected files pass all 45 tests under Node with maxWorkers=1 (272.02s Vitest; native SQLite restart/fence coverage). Targeted types, type-aware lint, formatting, and isolated P2 review pass. No CI dispatch or rerun.
…aw#175186) PR openclaw#175033 intentionally makes missing-source requester and yielded continuations settle once without inventing operator authority. These restart-fence fixtures instead need an authorized original requester. Reuse prepareSubagentRecoveryFixture before persisting their rows. Keep existing parent identity in the yielded integration case and preserve all wake, stale-batch, delivery, and deadline assertions. Production code and missing-source settlement coverage remain unchanged. Attribution: current main a40e1b1 reproduces three matching failures; pre-openclaw#175033 c8f9ee3 passes seven focused cases while already containing openclaw#175044. The ownership-release fix is therefore retained. Validation: both full affected files pass all 45 tests under Node with maxWorkers=1 (272.02s Vitest; native SQLite restart/fence coverage). Targeted types, type-aware lint, formatting, and isolated P2 review pass. No CI dispatch or rerun.
What Problem This Solves
Fixes recurring “lacks its original operator source” warnings on Gateway restart for legacy requester-settle and yielded subagent records left unsettled by #174850.
User Impact
Missing-source continuations settle once, including legacy wakes with incomplete cohort metadata, yielded runs without a final outcome, and historical records still marked running after delivery and durable cleanup. Retained execution results and delivered receipts remain intact; recovery does not invent operator authority or send a new completion message.
Why This Change Was Made
The restoration owner previously excluded every requester wake and yielded run, while the completion writer required a terminal outcome. Those restrictions stranded records that could never restore their original operator source. Restoration now uses the same completion writer to persist suppression and clear the unavailable wake independently of execution settlement. Queue receipts and ordinary replaced-store notifications retain their existing settlement owners; failed writes remain retryable.
No schema, configuration, retention, or permission changes. Production LOC is +8 net (20 added / 12 removed): this widens the existing settlement transition and removes its individual-only/terminal-only restriction, without introducing another owner, cache, or recovery path. Test/support LOC is +73 net, largely the expanded two-restart inventory moved into the existing store-replacement file.
Evidence
git diff --check, pass. The restart cases moved into the existing store-recovery test file to stay within the original file’s lint size limit. Initial independent Codex autoreview was clean through P2. Follow-up review found only the already-fixed ordering guard missing from the index; staging the reviewed working tree resolved that finding, with no additional P0–P2 defects found.bfc4304ec569c9f84d6fe15713df7c65dfb49330, including the native cancellation E2E and all type-check jobs. Requiredopenclaw/ci-gatechecks passed; no inherited-failure exception or CI rerun was needed. No Testbox/Crabbox allocation or benchmark was used for this correctness repair. Verification on a deployed Gateway remains pending.