Repository navigation
refactor: remove Tasks and TaskFlow runtime - #159179
Conversation
Complete the removal begun in #156532 after the Cron, follow-up custody, Webhooks, and workspace prerequisite batches. Preserve native execution and result recovery, retained Cron history, and media completion under their existing owners. Keep the released database layout and source rows; Doctor imports provable native assignments into existing binding metadata.
|
🦞👀 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 real behavior proof before merge. Reviewed September 27, 2026, 1:37 PM ET / 17:37 UTC (Revision 6). ClawSweeper reviewWhat this changesThe branch removes the Tasks and TaskFlow runtime, CLI and SDK surfaces, and chat panels while moving retained history, completion, and legacy Codex recovery to Cron, session, and native owners. Merge readiness⛔ Blocked before merge - 9 items remain Current main and the latest release still contain the Tasks runtime, so this final retirement remains useful. A maintainer has accepted the intentional SDK break, while native upgrade and requester-authority proof remain incomplete on a head that currently conflicts with main. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway uses Tasks to track asynchronous work and expose it to plugins, the CLI, and chat clients. This branch moves retained history and completion to Cron and session/native owners, with Doctor importing eligible old Codex assignments. flowchart LR
Legacy[Existing Tasks data] --> Doctor[Doctor assignment import]
Doctor --> Native[Native Codex recovery]
Native --> Guard[Current requester check]
Guard --> Delivery[Gateway completion delivery]
Delivery --> Reply[Chat or channel reply]
Cron[Cron jobs] --> History[Cron run history]
Before merge
Findings
Agent review detailsSecurityNeeds attention: Recovered native completion carries requester authority into channel delivery, and rejection after reassignment remains unobserved through a real transport client. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Finish the single-owner cutover with a conflict-resolved candidate, a published-state native recovery and rollback witness, and allowed and reassigned requester outcomes observed at final transport I/O. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a planned retirement rather than a current-main bug report. Focused tests and package replays cover portions of the cutover. Is this the best way to solve the issue? Unclear pending final proof: consolidating ownership under Cron, sessions, and native execution fits the repository's design, but the old-state completion and authority outcomes are not yet established end to end. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 42e53a49df3a. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Inspected synthetic before/after screenshots The browser after captures use the final runtime source, including newer main’s header and sidebar alignment. Browser before captures retain their original source identities. The native captures are reused after a source audit confirmed their rendering inputs remain identical. The Swift captures cover short completed messages and the Actions menu; they do not certify overflow, streaming, search, or scroll-follow behavior.
Capture source trees:Chat/Workboard after |




















Related: #156532
Final removal after the prerequisite batches #158221, #158217, #158225, #158222, #158702, and #158776. This completes the original removal.
What Problem This Solves
Removes the remaining Tasks and TaskFlow runtime after Cron, follow-up results, native execution and generated-media completion have their own existing owners.
User Impact
The Tasks/TaskFlow APIs, CLI and SDK surfaces, and Chat/native Tasks panels retire immediately. Plugins using the removed Task-specific SDK APIs must migrate to the retained session/native/Cron contracts; this intentionally provides no compatibility facade. Cron history and transcripts, native subagents and background commands, Workboard control, and retained media completion continue through their Cron/session/native owners.
Existing stored rows are preserved. Doctor imports provable legacy native assignments into existing binding metadata; ambiguous ownership stays untouched with a visible warning. This removal introduces no database schema version, replacement ledger, new configuration option, or new dependency.
Why This Change Was Made
The Tasks ledger duplicated execution and completion state already owned elsewhere. The cut moves each retained decision to that owner, then removes the old tools, registrations, events, wrappers, UI, tests and documentation together. Follow-up caller/result custody stays with the session/subagent completion owner; the temporary Task projection adapter is removed.
Native completion keeps exact delivery obligations through cleanup and restart. Media completion is fenced to the original requester/store/generation, and Cron retention shares atomic admission with pending delivery. The touched correlated-completion lifecycle uses the existing database worker and broker, retaining admission, FIFO ordering, transaction-time identity checks and write settlement.
Evidence
The removal passed full CI on
274595e2, includingopenclaw/ci-gate. Attempt 1 had 143 successful jobs and two interrupted jobs (pnpm download reset and SDK runner shutdown); only those failed jobs were rerun, unchanged, and passed. The SDK shutdown cause remains unresolved; no source defect or corrective source patch is claimed for it.Merged as
6652f7eac8d96ccc50b0da648cbbd8b556fcfb7bfrom reviewed headddbe2b2d7e65ed24e5c03c9cbfbc156fca1fae11. The actual main parent is44f67c2a7d3b1752de4d8998fcc85cab1afbc756; landed treebe0f28179cea8e556596a5be33b34bafa0f8d0aeexactly matches the pre-dispatch merge-tree calculation. Final conflicts preserved deletion of the retired TaskFlow type and Task SDK modules; no live implementation was reintroduced. The cut preserves main's native lifecycle, write settlement, SQLite transaction/maintenance owners, ACP preflight, and retained UI behavior. The five type graphs, protocol registry, canonical database-worker inventory and source-locale verification passed on the preceding conflict candidate. The last nine conflicts preserve main’s Swift decoding/test cleanup and the Task retirement; Swift parsing and source-isolation guards pass. Review retained the distinct pre-existing ownerless-custody case: owned + ownerless cases pass (2/2, 41 filtered, 36.85s wrapper; 519ms and 307ms case time). Earlier focused native coverage remains 64 distinct passing cases. Independent P2 reviews cover substantive resolutions and subsequent fixture repairs; accepted findings are resolved. The earlier full CI is evidence for its exact head, and is not presented as a new full CI pass on this conflict candidate.Generated UI translation-memory/meta/fallback and native translated/platform resource updates are left to their existing post-merge locale workflows, as required by the source-PR ownership policy. Both source/generated isolation checks pass. English/source retirement remains complete. Runtime materialization ignores obsolete memory keys absent from English. This reduced the hosted review input to 67.7 MiB at
5c730848, below the unchanged 256 MiB limit; no scanner or review guard is relaxed.The later native overlap retains main’s generic cancellation and child-custody fixes while discarding preparation of retired Task-mirror reads. Core/extension types and the two focused native authority cases pass (66.84s wrapper, 17 filtered); independent P2 review is clean. The final mechanical conflicts preserve main’s recovery helpers, the existing asynchronous settlement callback contract and the canonical Workboard asset build; core types pass.
PR CI at
69333bffailed before test/build planning becausechanged_paths_jsonbecomesnullwhen the file list exceeds the scope producer’s 64 KiB cap. Its 78,745-byte filename list deterministically triggers that limit. The second failed gate is Security Review mirroring that CI preflight failure; security-fast passed. The maintainer explicitly authorized administrative landing after the earlier successful full CI and logical conflict resolution. This does not claim a new full CI pass on the final head.Package proof uses immutable candidate
cdeaedbda459b1b5b7df6e836cf92438be4e68ff(2026.9.6, tarball SHA-25658faa6fd9d3e20006fb738d38d4d37c5a9a9728a2c5bfdc30416abd5bbf9d1a9). The producer run passed the published 9.6 cell: both Cron jobs preserve transcript identities, cursors, provenance and order after update and candidate execution, and rollback passes (1061s, one attempt). This is evidence for those package bytes, not later branch changes.The genuine published 9.4 cell passes the installed updater and first-hop import of both native assignments while preserving original Task rows. The synthetic provider then exposed fixture contract defects rather than an established product migration failure: missing companion selection, seed ordering/agent policy, model response fields, and configuration reload lifecycle. The corrected peer was proven against the actual immutable packaged client: cold/warm resumes preserve both parent history turns and the running child, emit unload before the resume response, and refuse active or competing-subscriber reconfiguration. All 254 wire checks and independent P2 review pass (2.90s lifecycle, 2.91s wire).
The focused 9.4 upgrade replay passed the real installed update and first-hop assignment import. Its trace also confirms the corrected configuration unload/resume and policy-injection acknowledgment. It then failed because
agent.waitrequested a 60-second server wait through a CLI transport that still defaulted to 10 seconds. The four-line fixture repair gives only that RPC a 70-second transport budget, retaining the 60-second operation and 120-second process budgets and the existing success assertion. An actual isolated Gateway using the original package reproduced the 10-second error, then returned the server's typed timeout with the corrected transport (13.080s versus 61.165s wall). Independent P2 review, lint and syntax checks pass.The remaining five hosted native witnesses and the final 9.4 rollback were not reached and remain unproven; no additional whole upgrade replay is claimed. The earlier published 9.6 Cron/rollback cell remains valid for its immutable package. This uses a synthetic provider with real published Gateway/companion packages and the installed updater; it does not claim live external-provider execution. Existing rollback verifies per-agent session/transcript databases, not a separate logical restoration hash for shared native-assignment rows.
Full CI on
b538fdbfinished with 107 successful jobs and 31 underlying failing jobs. Reviewed repairs address retired Tasks expectations, proper test fixture settlement, database worker routing, canonical schema admission, Cron failure-history ordering, committed child ownership, and native/statuspresentation. The catalog failure did not reproduce in the original 30-file Linux shard (444/444 passed); no speculative repair was added. The new exact-head CI run completed with 133 successful jobs and five underlying failures: a missing script entry, Android Maven connection resets, session-group teardown, persistence fixture cleanup, and repeated continuation settlement. All identified source/fixture repairs are included in the current candidate; macOS packages/tests and iOS passed. The Android failure was dependency-download infrastructure. The stale Swift Task event/menu assertions are also removed; the Swift package compiles in 133.62s and its isolated review is clean. The earlier macOS presence-clear timing failure did not recur; its unproven proposed patch was excluded, and no assertion or timeout was weakened.The retained flow proofs include real database-worker races; native recovery, cancellation and completion delivery; Chat send/completion and Workboard stop/update without Tasks RPCs; and the private completion QA scenario, including restart with zero replay. Local startup/type/lint prerequisites that stalled remain explicitly unproven until integrated CI; passing focused replays are not represented as one monolithic green check.
Earlier focused validation and measured costs
7850820bpnpm test src/cron/service.cross-tick-admission.test.ts --maxWorkers=1)Production types, affected test types, scoped lint/format, generated worker/UI/Workboard outputs, and actual-base ratchets passed across their recorded stages. Older proof retains its source attribution.
The maturity taxonomy uses authentic historical evidence; mismatched coverage is Unscored. Existing quality/completeness/LTS values remain unchanged.
Inspected synthetic before/after screenshots: browser and Android chat/menu and Android context, Wear, iOS, and macOS. All 20 images were verified rendering. Captions preserve source identities and proof limits; subsequent UI repairs change tests and generated locale pruning only.
Measured costs and limitations for the reviewed CI repairs
Recorded validation for the 21 applied repairs.
run-vitestbelow meansnode scripts/run-vitest.mjs; grouped file lists and filters are abbreviated. Times are separate observed invocations, not additive totals. Cold worker preparation, transforms, and shared-host contention dominate several runs; these are validation costs, not performance comparisons.run-vitest: shared-state worker imports, delivery state, requester-wake admission and retryrun-vitest: backup-create, doctor-state-integrity, session-startup-orphanssubagent-completion-direct-fallback; actual inspector owner proofrun-vitest … --maxWorkers=1: receipt binding/store/schema facts; stream validation; original quiet-finalization → run-history → timer order/statusobservationsrun-vitest: status-subagents, subagent-execution-observation, agent-eventspnpm test … --maxWorkers=1: managed-image-attachments; context-engine-maintenance; live-model-switch + pending-final-delivery-markerpnpm test src/proxy-capture/proxy-server.test.ts src/proxy-capture/proxy-server.managed-proxy.test.ts --maxWorkers=1run-vitest: doctor-maintenance.worker, staged focused runsrun-vitest: steering/requester continuation; collector suites; chat incarnation/resume; selected registry timing/restart/publication/replacementrun-vitest: post-commit parent closure, pre-commit authority, cancellation/replacement/write controls; full Gateway transport filerun-vitest: upgrade-survivor schema expectation + backup rollback; genuine published 9.4 pre-update validationEarlier catalog condition: original CI's shared-path actor identity conflict has no established corrective patch. The original 30-file Linux group passed unchanged through
node --import tsx scripts/ci-run-node-test-shard.mtswithOPENCLAW_NODE_TEST_PLAN_CONCURRENCY=1andOPENCLAW_VITEST_MAX_WORKERS=2: 211.89 s shard-wrapper time. That is bounded non-reproduction, not proof of a fix. The macOS original-order attempt stopped before completing a test; its focused diagnostic timed out early and later passed the original failing case, so it is not clean proof either. The escaping actor remains unidentified; The later full CI on274595e2passed; this does not establish the original cause or a source fix.Costs are attributed to the frozen per-owner inputs recorded with the patches (mostly
b538fdb, native-schema fixture894af9fb). They do not establish a monolithic pass on the integrated repair head, and unchanged-package evidence retains its original source identity.Conflict resolution and final repair proof
Actual conflicts against pinned main
ad3103420e403adb3e8a2f1aa046cb9397dffcbbpreserve its retained native delivery helpers, grouped chat rendering, current translations, lifecycle types, and CI routing. Canonical native/UI locale generation and strict checks pass with cached translations only; Workboard assets and prompt snapshots were regenerated through their owners.Core, extension, script and root-test type graphs pass. Seven affected Codex files pass 80 tests in 324.92s; five selected session-binding cases pass in 116.10s (43 filtered). The affected media/Cron/planner tests pass in 406.43s across three routed shards. The updated combined-project routing case initially exposed Cron admitting unrelated include-file entries; using the existing intersection option fixed the original case (35.61s wrapper).
The repeated continuation callback failure was reproduced before fixing its payload-owned settlement promise. The complete waiting-status and dispatch-finalization groups now pass 36 cases in 61.07s, including concurrent/repeated callbacks and rejected-handoff recovery; isolated P2 review is clean. The persistence fixture now joins existing owner work before its unchanged zero-root assertion: its original four-case failure order reproduced, then all 22 cases passed (45.71s wrapper), with clean P2 review. Session-group teardown independently has the same async-drain repair on main; that repair is retained. The missing native-peer script entry is registered at Knip's existing shell-process entry owner; both unused-file scans pass.
The previous whole-PR hosted ClawSweeper refresh exceeded its fixed staging capacity because of generated translation-memory churn. That churn is now removed under the canonical source-PR policy; the final immutable tree fits the cap without exemptions. A fresh hosted review completed for
5c730848at 2026-09-27 15:35:16 UTC. Its recovered-requester authority question is addressed with the existing real SDK and final-dispatch boundary coverage in this evidence response. The latest nine conflicts and the one accepted test correction have completed independent review. Earlier incremental local review remains supplemental evidence only.