Skip to content

refactor(tasks): remove test runtime overrides - #155157

Merged
steipete merged 1 commit into
mainfrom
codex/task-runtime-overrides
Sep 22, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/task-runtime-overrides

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The task registry carries mutable runtime overrides used only by tests, creating an extra path for task control and delivery.

User Impact

No intended user-visible change. Task cancellation, progress, and delivery retain their existing owners and lazy loading; application and tooling shrink by 80 lines, and tests/support shrink by 119 lines.

Why This Change Was Made

Remove test override setters and duplicate reset plumbing. Tests use their existing module mocks or scoped spies, wait for observable completion, and exercise cancellation through real admission and the Gateway listener. The real runtime contract and lazy-loader cache reset remain intact. The current composition preserves the notification acknowledgment owner introduced in #151815, including both delivery-settlement joins and all 19 state-notification cases. Related: #150153.

Evidence

  • Fresh independent Codex review found no actionable P0–P2 findings in the full current candidate.
  • Retained source-bound qualification passed 409 distinct candidate cases across 15 files, plus 120 baseline Gateway cases. This includes all 21 SQLite task-runtime cases, 19 state-notification cases, and seven delivery-lifetime cases.
  • That qualification’s complete registered 36-path changed-file gate passed in 2,181.02 seconds, including all 25 core-test type graphs, production/scripts/root types, lint and architecture guards.
  • Its runtime/declaration and AI builds passed in 380.08 and 4.15 seconds. Both real emitted runtime modules imported successfully, with their callable exports and emitted reference closure verified.
  • A real isolated Gateway listener with a synthetic ACP subprocess accepted owner cancellation (HTTP 200), rejected foreign/stale replacements (409), interrupted the target once, and let its successor finish without interruption.
  • All eight complete before/after Gateway pairs passed: baseline 266.99 seconds; candidate 306.49 seconds. These are single observations with independent installs/caches on the same host and toolchain, not a statistical speedup or causal regression claim.
  • Exact source hashes, patch, tree and completed remote lease cleanup were verified. This is isolated runtime proof, not live-model/provider or public-package proof. Exact-head CI remains required before landing.

Original source-bound qualification: https://github.com/openclaw/openclaw/actions/runs/35655127100

The original qualification above is bound to tree f6792422ef38c30c829ded776c98c8443a763b30 and base 6615891cc3650b2136fa25c136ac37c8dc111676.

The current composition preserves both notification-settlement joins from the upstream maintenance fixture repair. Focused hosted proof passed all 48 cases in the complete maintenance, delivery-lifetime and notification suites in 40.63 seconds. Formatting, lint and the agents-other typecheck passed. The initial type selector was rejected before compilation; the corrected type-only continuation passed in 56.41 seconds, without repeating tests. That continuation verified all 47,918 source paths before and after. The original test invocation ended before its final raw-source witness; the later resync does not reconstruct that missing post-test observation. The single lease was stopped and independently confirmed complete.

CI 35662022549 failed only the package-manager selection assertion and its derived gate. The branch now includes the canonical test correction, which distinguishes a standalone version pin from measured-version telemetry. All 36 changed-file postimages and normalized deltas are unchanged by this final rebase; new-head CI remains required.

Current head: 4588359d1245c8b75845ee7376b2df2d4a8020eb; tree: 97c2d209b3da88e258399d46737eabdd6f2a0fd9; base: 73f058a4e653471383c473a93571f043ddc05587.

The original 700-case qualification and earlier provider interruption remain historical evidence for their original source. They are not added to the current-source case count. The first current wrapper attempt rejected the gate-base argument before source synchronization or test execution; the corrected canonical source binding passed without changing product code.

CI 35666501929 subsequently exposed three upstream upgrade-survivor fixture failures. The canonical fixture correction is now included: mocked baseline installation/startup invokes the existing normalization owner before the real companion-preparation flow. Production validation and ordering assertions remain unchanged. Its owner reproduced the failures and passed all 62 relevant cases. All 35 executable postimages and 36 normalized deltas remain unchanged in this refresh; fresh head CI is still required.

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 20:07
@steipete steipete self-assigned this Sep 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Sep 21, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 8:09 PM ET / September 22, 2026, 00:09 UTC (Revision 4).

ClawSweeper review

What this changes

Removes test-only task cancellation and delivery overrides and updates fixtures to use module mocks, scoped spies, and normal run admission.

Merge readiness

✅ Ready for maintainer review

Keep open. This remains useful cleanup absent from the pinned main branch, and no actionable correctness or security defect was found. The related recovery campaign does not supersede this focused PR.

Priority: P3
Reviewed head: 4588359d1245c8b75845ee7376b2df2d4a8020eb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coherent cleanup with retained boundary proof and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): Retained source-bound evidence reports the real Gateway cancellation path reaching a synthetic ACP subprocess, rejecting foreign/stale targets and interrupting only the intended turn. Source inspection supports that coverage; raw linked logs could not be independently opened because their storage host is blocked, and the documented composition witness limitation remains as recorded.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): Retained source-bound evidence reports the real Gateway cancellation path reaching a synthetic ACP subprocess, rejecting foreign/stale targets and interrupting only the intended turn. Source inspection supports that coverage; raw linked logs could not be independently opened because their storage host is blocked, and the documented composition witness limitation remains as recorded.
Evidence reviewed 8 items Pinned introduction and current-main necessity: The original head records the supplied main SHA as its sole parent. The introduced diff removes override symbols and setters still present in that main snapshot; the cleanup is not already implemented there.
Production contracts preserved: The lazy loaders still import the same control and delivery modules. Their real exports provide both functions whose optional calls become unconditional. Registry reset still clears both loader caches; cancellation authority checks and notification acknowledgment settlement remain in place.
Complete override cutover: A tracked-tree search found no remaining removed setter/resetter names or override symbol strings. The internal test hooks are not a plugin API; no configuration, durable schema, dependency, or published SDK change is introduced.
Findings None None.
Security None None.

How this fits together

The task registry tracks background work and routes cancellation and notifications to their existing runtime owners. This change removes alternate test wiring while preserving those production routes and their lazy loading.

flowchart TD
  A[Task commands and Gateway requests] --> B[Task registry]
  B --> C[Lazy runtime loading]
  C --> D[Cancellation owners]
  C --> E[Notification delivery]
  D --> F[Task outcome]
  E --> G[Requester session or channel]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -78, Tests -119, Other -3. Total -200 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 5 4 82 -78
Tests 29 172 291 -119
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 3 -3
Total 36 176 376 -200

Review metrics

None.

Technical review

Best possible solution:

Keep one lazy-loaded production path for task control and delivery, with test substitutions confined to fixtures.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this refactor removes source-visible test-only wiring rather than repairing a reported user-facing defect.

Is this the best way to solve the issue?

Yes. Existing module mocks and scoped spies replace the alternate production wiring while preserving the real runtime owners and lazy-loading contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 73f058a4e653.

Labels

Label justifications:

  • P3: This is internal test-seam cleanup with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Retained source-bound evidence reports the real Gateway cancellation path reaching a synthetic ACP subprocess, rejecting foreign/stale targets and interrupting only the intended turn. Source inspection supports that coverage; raw linked logs could not be independently opened because their storage host is blocked, and the documented composition witness limitation remains as recorded.
  • proof: sufficient: Contributor real behavior proof is sufficient. Retained source-bound evidence reports the real Gateway cancellation path reaching a synthetic ACP subprocess, rejecting foreign/stale targets and interrupting only the intended turn. Source inspection supports that coverage; raw linked logs could not be independently opened because their storage host is blocked, and the documented composition witness limitation remains as recorded.

Evidence

What I checked:

  • Pinned introduction and current-main necessity: The original head records the supplied main SHA as its sole parent. The introduced diff removes override symbols and setters still present in that main snapshot; the cleanup is not already implemented there. (src/tasks/task-registry-runtime-loaders.ts:1, 73f058a4e653)
  • Production contracts preserved: The lazy loaders still import the same control and delivery modules. Their real exports provide both functions whose optional calls become unconditional. Registry reset still clears both loader caches; cancellation authority checks and notification acknowledgment settlement remain in place. (src/tasks/task-registry-runtime-loaders.ts:2, 4588359d1245)
  • Complete override cutover: A tracked-tree search found no remaining removed setter/resetter names or override symbol strings. The internal test hooks are not a plugin API; no configuration, durable schema, dependency, or published SDK change is introduced. (src/tasks/task-registry.ts:39, 4588359d1245)
  • Production-boundary cancellation coverage: The changed fixture obtains normal system run admission and closes it in finally. Its real Gateway HTTP path retains foreign/replaced-run rejection, exact target interruption, and uninterrupted successor completion assertions. CODEX_PATH selects a repository-owned synthetic subprocess fixture; this evidence claims OpenClaw routing behavior, not compatibility with a real Codex runtime. (test/e2e/qa-lab/runtime/webhooks-taskflow-cancellation-authz.e2e.test.ts:460, 4588359d1245)
  • Retained runtime proof and source limits: The captured PR body reports owner cancellation returning HTTP 200, foreign/stale cancellation returning 409, one target interruption, and successful successor completion through an isolated Gateway and synthetic ACP subprocess. Original qualification is explicitly bound to tree f6792422ef38c30c829ded776c98c8443a763b30 and base 6615891; it reports unchanged executable postimages after rebasing and a separate 48-case composition check. The linked Actions runs have cancelled orchestration status, which does not independently establish their remote payload results. Fetching job logs redirected to a blocked storage host, so their raw output was not independently inspected.
  • Related work remains distinct: fix: keep task recovery working across shared Gateway updates #150153 explicitly preserves an unmergeable combined draft while focused replacements land. The merged refactor(tasks): move state notification acknowledgements off the Gateway thread #151815 owns notification acknowledgment changes, not removal of these test overrides. Its acknowledgment behavior remains preserved by this diff.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-21T20:16:01.525Z sha 8e34446 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T22:41:22.747Z sha cdffb8b840c0ce47e55f561c897cd8a5894d935f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T23:49:11.788Z sha 0bc0c10 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/task-runtime-overrides branch from 8e34446 to cdffb8b Compare September 21, 2026 22:18
@steipete
steipete force-pushed the codex/task-runtime-overrides branch from cdffb8b to 0bc0c10 Compare September 21, 2026 23:12
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 21, 2026
@steipete
steipete force-pushed the codex/task-runtime-overrides branch from 0bc0c10 to 4588359 Compare September 22, 2026 00:02
@steipete
steipete merged commit ebff854 into main Sep 22, 2026
202 checks passed
@steipete
steipete deleted the codex/task-runtime-overrides branch September 22, 2026 00:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant