Skip to content

refactor(tasks): remove unused flow observer callbacks - #154863

Merged
steipete merged 1 commit into
mainfrom
codex/task-flow-observer-retirement
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/task-flow-observer-retirement

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150153.

What Problem This Solves

The task-flow registry carries observer callbacks, snapshot copies, and publication bookkeeping that are configured only by tests and have no production subscriber.

User Impact

No intended user-visible change. Persistence, process-local flow projections, transaction rollback/commit settlement, worker reconciliation, and the separate live task-observer system retain their existing owners and behavior. Schemas and storage contracts are unchanged.

Why This Change Was Made

Remove the unused flow-observer path and update its test consumers to assert resident state and lifecycle settlement directly. The atomic subagent/task/flow replacement still installs committed state before delivering the remaining task and subagent observers.

This removes 180 application lines and 310 test/support lines, with no tooling growth.

Evidence

  • Full-candidate independent P2 review found no actionable issues; normal commit guards and formatting preserved the qualified tree.
  • Source-bound remote proof passed 224 distinct cases: 14 complete test files and 20 passing cases from the task-worker runtime file. The retained task-flow lifecycle E2E case took 375.87 seconds and exercises the real registry/worker boundary. Remote proof run.
  • The complete changed-file gate passed in 2328.05 seconds, including types, lint, dead exports, architecture/import guards, and native schema/storage checks. Passing earlier suites are reused only where their production inputs are unchanged.

One existing runtime case, preserves large managed state and wait payloads across worker creation and reopen, exhausts the worker’s unchanged 512 MiB heap limit with its 72 MiB payload. It reproduced independently on both the exact clean base and this candidate with separate frozen dependencies. That result is retained as an unresolved baseline failure; this PR does not fix it, change the payload/Unicode/heap cap, or claim the whole runtime file passed. Exact-head CI passed for 034889201710ad729a28a947c22158d17b250ee8; that CI result does not erase the separately reproduced isolated-heap failure.

@steipete steipete self-assigned this Sep 21, 2026
@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.

@steipete
steipete marked this pull request as ready for review September 21, 2026 13:14
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels 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, 9:29 AM ET / 13:29 UTC.

ClawSweeper review

What this changes

Removes unused task-flow observer callbacks and updates tests to check stored state, in-memory state, and transaction settlement directly.

Merge readiness

✅ Ready for maintainer review

Keep open: this cleanup remains applicable on current main, and the reviewed diff introduces no actionable correctness defect.

Priority: P3
Reviewed head: 034889201710ad729a28a947c22158d17b250ee8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused cleanup with preserved state and settlement contracts, useful revised assertions, and no actionable source finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer-author context exempts this internal cleanup from the external-contributor proof gate; no material authority change triggers additional proof. Reported registry/worker validation is supplemental and was not independently established from the Testbox lease metadata.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied maintainer-author context exempts this internal cleanup from the external-contributor proof gate; no material authority change triggers additional proof. Reported registry/worker validation is supplemental and was not independently established from the Testbox lease metadata.
Evidence reviewed 8 items Removed callbacks have no production registration: The original store initializes flow observers to null and exposes their configuration only through a test-gated global. Reference searches found test consumers, with no public SDK or production subscriber. The proposed tree contains no remaining references to the removed observer symbols.
Transaction and reconciliation behavior retained: Stage, rollback, commit, projection-write witnesses, serialized worker reads, and admission checks remain intact. The removed publication phase only delivered flow observer events; persisted row formats and mutation contracts are unchanged.
Remaining observers see installed state: Atomic subagent replacement still installs subagent, task, and flow state before invoking deferred observers. Existing replacement coverage asserts that an observer sees all three running states together.
Findings None None.
Security None None.

How this fits together

Task Flow tracks managed work and mirrors task status into SQLite and an in-memory registry. Worker reconciliation keeps that registry current; separate task and subagent observers notify active consumers.

flowchart TD
  A[Task updates and managed work] --> B[Task-flow registry]
  B --> C[SQLite transaction]
  C --> D[Commit or rollback]
  D --> E[In-memory flow state]
  C --> F[Worker reconciliation]
  F --> E
  E --> G[Flow readers and task observers]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -180, Tests -310. Total -490 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 7 14 194 -180
Tests 13 143 453 -310
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 20 157 647 -490

Review metrics

None.

Technical review

Best possible solution:

Keep persistence and projection settlement with their existing owners while retiring the unused flow notification path.

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

Not applicable: this is an internal cleanup, and source inspection confirms the removed registration path is test-only.

Is this the best way to solve the issue?

Yes: removing the unused callbacks while retaining transaction settlement and checking resident state is a focused simplification of the existing owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 904b41e9e99f.

Labels

Label changes:

  • add P3: This is internal cleanup of unused callbacks with no intended user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer-author context exempts this internal cleanup from the external-contributor proof gate; no material authority change triggers additional proof. Reported registry/worker validation is supplemental and was not independently established from the Testbox lease metadata.

Label justifications:

  • P3: This is internal cleanup of unused callbacks with no intended user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer-author context exempts this internal cleanup from the external-contributor proof gate; no material authority change triggers additional proof. Reported registry/worker validation is supplemental and was not independently established from the Testbox lease metadata.

Evidence

What I checked:

  • Removed callbacks have no production registration: The original store initializes flow observers to null and exposes their configuration only through a test-gated global. Reference searches found test consumers, with no public SDK or production subscriber. The proposed tree contains no remaining references to the removed observer symbols. (src/tasks/task-flow-registry.store.ts:93, 6e70aff09276)
  • Transaction and reconciliation behavior retained: Stage, rollback, commit, projection-write witnesses, serialized worker reads, and admission checks remain intact. The removed publication phase only delivered flow observer events; persisted row formats and mutation contracts are unchanged. (src/tasks/task-flow-registry.store.ts:93, 034889201710)
  • Remaining observers see installed state: Atomic subagent replacement still installs subagent, task, and flow state before invoking deferred observers. Existing replacement coverage asserts that an observer sees all three running states together. (src/agents/subagents/registry/subagent-registry-replacement-store.ts:110, 034889201710)
  • Useful regression coverage survives: The revised tests retain canonical revision conflicts, nested rollback, delayed-worker reconciliation, absent-state ABA protection, and lifecycle settlement. Direct resident-state assertions avoid refreshing the projection while checking whether reconciliation succeeded. (src/tasks/task-flow-registry.concurrency.test.ts:170, 034889201710)
  • Cleanup remains absent from fetched main: Fetched main still contains the flow-observer getter and its registry consumer. The central production files are unchanged between the pinned merge base and fetched main, so this remains distinct work rather than an implemented cleanup. (src/tasks/task-flow-registry.store.ts:110, 904b41e9e99f)
  • Feature-history routing: Recent main history repeatedly identifies Peter Steinberger in flow projection, worker settlement, and store maintenance. GitHub commit metadata maps the sampled projection change to steipete; its patch includes the worker-mutation entry point retained in this checkout. (src/tasks/task-flow-registry.ts:307, 0e089a896d35)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

@steipete
steipete merged commit 353adfc into main Sep 21, 2026
227 of 228 checks passed
@steipete
steipete deleted the codex/task-flow-observer-retirement branch September 21, 2026 13:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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