Skip to content

fix(tasks): task list fails when metadata overlaps completion - #153371

Merged
steipete merged 2 commits into
mainfrom
codex/task-publication-successful-receipts
Sep 20, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/task-publication-successful-receipts

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A task-list request can fail when a successful metadata write overlaps task completion.

User Impact

Return the current completed task after accepted metadata settles. Superseded notifications remain suppressed, including when a row changes and later returns to the same value. No schema, migration, or configuration changes.

Why This Change Was Made

Apply the strict expected-row guard only to recovered publications. Carry the existing write witness into publication invalidation before receipt claim and through later writes, preserving admission, rollback, and observer ownership.

Evidence

Before the callback declaration amendment, focused qualification passed 101 cases: 19 read, 36 publication, 39 event, and 7 lineage tests, with no skipped cases, unhandled errors, or suite errors. This includes the registered Gateway tasks.list regression, three existing stale-notification cases, and three SQLite recovery controls. The read regression failed on the original code; the queued-readback regression failed on the preceding candidate and passes with this fix. The queued-readback test uses the production publication owner with the existing in-memory store; event tests supply SQLite coverage.

The focused run used 137f4ba. All five patch preimages match observed main 1a51b55; its landed retry-budget change is included in the reviewed supporting context. The original five-file change passed formatting and patch checks, and independent automatic review completed both evidence batches without P0-P2 findings. These results predate the callback declaration amendment.

CI on 8e20640 flagged the extracted recovery callback under the unbound-method rule. The amendment changes its factory method declaration to an arrow property while preserving its closure behavior. Amendment formatting and patch checks passed. Local type-aware lint was not run because no suitable idle source and dependency checkout was available within the allocated memory limit. The narrow amendment review completed without P0-P2 findings. Fresh amended-head CI, including type-aware lint, must pass before landing.

The broader 32-agent/1,000-session live campaign remains outstanding. This change makes no throughput, latency, or startup-speed claim.

@clawsweeper

clawsweeper Bot commented Sep 20, 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 size: M maintainer Maintainer-authored PR labels Sep 20, 2026
@steipete
steipete marked this pull request as ready for review September 20, 2026 02:37
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 10:58 PM ET / September 20, 2026, 02:58 UTC (Revision 2).

ClawSweeper review

What this changes

The PR lets task lists return completed tasks when metadata publication overlaps completion, while suppressing superseded notifications and adding regression coverage.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main. No blocking correctness or security findings were identified, including in the callback amendment.

Priority: P2
Reviewed head: a448a0284245d0ca0594f6a922aaa687b7f4b5be

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This verified repository-admin PR is exempt from external-contributor proof. Its reported focused tests exercise publication and the registered task-list handler; they are supplemental validation, not a live campaign, and were not rerun here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This verified repository-admin PR is exempt from external-contributor proof. Its reported focused tests exercise publication and the registered task-list handler; they are supplemental validation, not a live campaign, and were not rerun here.
Evidence reviewed 9 items Current main still contains the failure mechanism: Current main binds the strict expected-row guard to ordinary successful publications. A completion that overtakes metadata publication can therefore reject the accepted-event fence used by task reads.
Recovery and successful publication remain distinct: The expected-row check is now established only when recovery returns a record. Database admission and store ownership checks remain before and after awaited effects; publication still checks readiness, invalidation, and current-row equivalence.
Registered request regression: The added test holds an actual metadata-write receipt, starts the registered tasks.list request, completes the task, then releases the receipt. It checks the completed response, retained metadata, SQLite state, and absence of stale running-task publication. Tests were inspected, not executed.
Findings None None.
Security None None.

How this fits together

The task registry records agent progress and completion in SQLite and maintains an in-memory view. Gateway task-list requests wait for accepted updates before returning that view, while publication guards prevent stale notifications.

flowchart LR
  A[Agent progress events] --> B[SQLite task writes]
  C[Task completion] --> B
  B --> D[Publication reconciliation]
  D --> E[Current task view]
  D --> F[Suppress superseded notifications]
  G[Gateway task-list request] --> E
  E --> H[Completed task response]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +8, Tests +204. Total +212 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 13 5 +8
Tests 2 240 36 +204
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 253 41 +212

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +8 net lines; tests +204 net lines The small production increase reuses existing write witnesses, while most growth covers overlapping completion and queued-readback regressions.

Technical review

Best possible solution:

Keep successful metadata settlement independent of stale notification eligibility, while preserving strict recovery checks and current-state reconciliation.

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

Yes, source establishes the path: hold a committed metadata receipt, start tasks.list, complete the task, then release the receipt. The added registered-request regression encodes this ordering; this review did not execute it.

Is this the best way to solve the issue?

Yes. The patch repairs the existing publication owner and carries forward write invalidation without adding another state owner, configuration option, or storage migration.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded task-list failure caused by overlapping metadata settlement and completion.
  • 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: This verified repository-admin PR is exempt from external-contributor proof. Its reported focused tests exercise publication and the registered task-list handler; they are supplemental validation, not a live campaign, and were not rerun here.

Evidence

What I checked:

  • Current main still contains the failure mechanism: Current main binds the strict expected-row guard to ordinary successful publications. A completion that overtakes metadata publication can therefore reject the accepted-event fence used by task reads. (src/tasks/task-registry-state.ts:719, d5eed044d23f)
  • Recovery and successful publication remain distinct: The expected-row check is now established only when recovery returns a record. Database admission and store ownership checks remain before and after awaited effects; publication still checks readiness, invalidation, and current-row equivalence. (src/tasks/task-registry-worker-publication.ts:77, a448a0284245)
  • Registered request regression: The added test holds an actual metadata-write receipt, starts the registered tasks.list request, completes the task, then releases the receipt. It checks the completed response, retained metadata, SQLite state, and absence of stale running-task publication. Tests were inspected, not executed. (src/tasks/task-registry-read.test.ts:514, a448a0284245)
  • Supersession and recovery coverage: The queued-readback regression checks that a successful receipt neither fails settlement nor delivers a notification after intervening writes return the row to the same value. Existing recovery tests retain rejection of stale recovered publications before reads, during reads, and during effects. (src/tasks/task-registry-worker-publication.test.ts:385, a448a0284245)
  • Re-review amendment: GitHub's commit patch confirms that the only amendment since the previous reviewed head changes the recovery callback from method syntax to an arrow property. The previous review retained no findings or rank-up moves. Local comparison encountered an unavailable historical blob; the GitHub commit patch supplied the amendment evidence. (src/tasks/task-registry-worker-publication.ts:77, a448a0284245)
  • Validation evidence and its limits: The captured PR body reports 101 focused passing cases before the callback amendment, including regressions that failed on preceding code. It explicitly distinguishes those results from amended-head CI and the outstanding broader live campaign. This review independently completed git diff --check, but ran no target code. (a448a0284245)

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 (1 earlier review cycle)
  • reviewed 2026-09-20T02:44:23.002Z sha 8e20640 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 4b4ece3 into main Sep 20, 2026
213 checks passed
@steipete
steipete deleted the codex/task-publication-successful-receipts branch September 20, 2026 03:33
@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

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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