Repository navigation
refactor(sessions): decouple followup custody from task projections - #158702
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed September 26, 2026, 11:46 AM ET / 15:46 UTC (Revision 9). ClawSweeper reviewWhat this changesMoves ownership of Merge readiness✅ Ready for maintainer review Keep open. Current main still holds follow-up completion in Tasks, while this branch provides a distinct prerequisite to the open Tasks-retirement work. The prior receipt-commit findings appear addressed at the reviewed head. Priority: P2 Review scores
Verification
How this fits togetherAn agent's flowchart LR
A[Agent sends to session] --> B[Gateway admits run]
B --> C[Session follow-up owner]
C --> D[Child completion waves]
D --> C
C --> E[Reply to requester]
C --> F[Task receipt projection]
F --> G[SQLite task receipt]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +302, Tests +555. Total +857 across 24 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Session completion should remain the sole follow-up result owner, with Tasks retained as a replaceable receipt projection until its separate retirement is ready. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an ownership refactor rather than a reported current-main failure. The focused tests exercise the behavior it must preserve. Is this the best way to solve the issue? Yes: placing reply custody with session completion and keeping Tasks as a receipt adapter follows the repository's one-owner boundary without changing the stored contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e5bf1c06109b. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
The terminal-write audit is complete across all three production paths: ordinary completion, unstarted rejection, and paused cancellation. The shared projection now rechecks the logical owner's live requester/lifecycle custody before the write and after acknowledgment, and its additional path-specific guard is required by the type signature. Each caller carries the same physical-admission or caller/source/cohort check used by the previous owner. Real Gateway dispatch and SQLite worker races reproduced the gaps before correction. The final 128-case owner/cancellation selection passes, covering requester revocation without an abort signal, logical-owner replacement, lifecycle rotation, physical-instance replacement, paused pre-commit revocation, post-commit cancellation cleanup, and original unaccepted receipt cleanup. The nine-case durable regression file takes 25.82 seconds wrapper wall; test setup uses the existing database-worker lane and no sleeps, polling, or extra Gateway boots. Core and all 25 selected test type graphs, lint, formatting, and fresh independent P2 review pass. Accepted native-stop cleanup and cancellation after a committed receipt retain their existing semantics. The path-specific caller guard runs before the write; it does not retroactively revoke a completed cancellation. All three reported custody findings are addressed without introducing a new authorization policy or storage shape. The previous CI failures were separately attributed to unchanged main-side fixtures. Main |
|
Merged via squash.
|
…penclaw#158702) * refactor(sessions): decouple followup custody from task projections * test(sessions): align cancellation timeout with Gateway owner * fix(sessions): fence followup cleanup at receipt commit * fix(sessions): preserve paused cancellation authority through commit * fix(sessions): revalidate logical custody at terminal projection * ci: refresh followup checks after main lint fixture cleanup * ci: refresh followup checks after QA protocol reference repair * ci: refresh followup checks after fetch fixture repair * ci: refresh follow-up custody proof after fixture repair * ci: refresh follow-up checks after database admission repair
Remove Tasks and TaskFlow runtime, APIs, CLI, SDK surfaces and panels after the Cron, session, native execution and media completion ownership cutovers. Preserve stored rows and import provable legacy native assignments through Doctor; ambiguous ownership stays untouched with a warning. Follows #158221, #158217, #158225, #158222, #158702 and #158776. Related: #156532. Task-specific public APIs retire immediately; retained responsibilities use their existing owners. Maintainer-authorized administrative landing after full CI run 36312986498 attempt 2 passed on 274595e, with subsequent actual conflicts reviewed and focused checks passing. Current PR CI preflight hits the 64 KiB changed-path metadata limit before tests (run 36335042695); its duplicate security-review status mirrors that planning failure. Review and scoped proof are recorded in the PR. Published 9.4 native import is proven; remaining native completion and 9.4 rollback witnesses are explicitly unproven.
Remove Tasks and TaskFlow runtime, APIs, CLI, SDK surfaces and panels after the Cron, session, native execution and media completion ownership cutovers. Preserve stored rows and import provable legacy native assignments through Doctor; ambiguous ownership stays untouched with a warning. Follows openclaw#158221, openclaw#158217, openclaw#158225, openclaw#158222, openclaw#158702 and openclaw#158776. Related: openclaw#156532. Task-specific public APIs retire immediately; retained responsibilities use their existing owners. Maintainer-authorized administrative landing after full CI run 36312986498 attempt 2 passed on 274595e, with subsequent actual conflicts reviewed and focused checks passing. Current PR CI preflight hits the 64 KiB changed-path metadata limit before tests (run 36335042695); its duplicate security-review status mirrors that planning failure. Review and scoped proof are recorded in the PR. Published 9.4 native import is proven; remaining native completion and 9.4 rollback witnesses are explicitly unproven.
Related: #156532
What Problem This Solves
Moves
sessions_sendfollow-up result custody out of Tasks before the Tasks runtime retires.User Impact
Follow-up replies retain their existing behavior across yields and resumed child-completion waves. Caller/session authority, lost-acknowledgment reconciliation, single-consumer results, and cancellation remain enforced. Tasks controls remain available in this prerequisite. There are no schema, protocol, configuration, or dependency changes.
Why This Change Was Made
The session/subagent completion owner now makes execution, cohort-adoption and result-custody decisions. Tasks is a projection adapter that preserves existing receipt writes and confirmed cancellation results. Generation retirement closes pending results, and concurrent cancellation calls join through projection settlement. The later removal can delete the adapter without deleting generic follow-up behavior.
Evidence
All 136 focused cases pass, including real Gateway/SQLite receipts, caller authorization, yielded successors, cancellation commit/rejection and Incognito output. Negative controls reproduced lifecycle-retirement and cancellation-join failures before their corrections. Types, lint, formatting, size/assertion ratchets, import-cycle checks (zero runtime cycles), and fresh independent P2 review pass.
The extraction build passes in 7m27.2s; later authority-guard corrections pass all affected compiler graphs. It reports an advisory startup-JavaScript budget warning; this prerequisite includes no UI source changes. The seven-file focused test run took 115.70s wrapper wall. The generic 13-case file took 1.03s Vitest wall; the two added real cancellation cases took 1.061s and 1.056s. CI timing will be recorded once available.
The final terminal-write audit covers every production caller. Real Gateway/SQLite regressions reproduce stale unstarted, paused-cancellation and ordinary-completion writes, then pass with current ownership checked at the actual commit boundary. The final 128-case owner/cancellation selection, core and all 25 selected test type graphs, and fresh P2 review pass. The nine-case durable regression file takes 25.82s wrapper wall. Guard audit, preserved cleanup contracts, and separate main-side CI diagnosis.