Skip to content

fix(tasks): retain admitted work across list retries - #154338

Merged
steipete merged 6 commits into
mainfrom
codex/perf-task-list-fixed-fence
Sep 21, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/perf-task-list-fixed-fence

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A busy Tasks page can repeatedly wait for new events or observe a committed run before its creation owner publishes it, exhausting the page's stabilization retries.

User Impact

Tasks page requests retain their initial accepted event prefix and wait once for identity-changing mutations already admitted for the same database and store. Later arrivals do not extend those waits. Internal reads keep per-task authority checks, allowing unaffected progress updates to continue while another task is being replaced.

Why This Change Was Made

Keep read preparation and mutation settlement with their existing owners. Page retries reuse the captured preparation while refreshing canonical rows; mutation settlement includes persistence, publication and failure cleanup. Pagination, session access and database ownership are still checked before responding. No schema, configuration, migration or retention change is introduced.

Evidence

  • The registered retry-prefix regression fails before the repair. The admitted-creation regression also fails for the intended unavailable-page outcome before its repair. Historical initial and integrated sibling proofs passed.

  • Fresh CI on c754ba5 caught two progress regressions, a type-import cycle and an unbound test method. The repair limits mutation-cohort waiting to page requests, uses the existing leaf store contract for identity, and preserves the method receiver. Existing progress assertions and deadlines remain unchanged.

  • The repaired cumulative source passed 128 tests, including all 46 progress tests, five registered projection tests and 77 read/metadata/publication siblings. The static import-cycle check, production types, formatting and type-aware lint passed. Independent review found no actionable P0–P2 findings.

  • Linux proof used Node 26.8.2 in the existing 71fba998 integration checkout with the cumulative Tasks candidate and this repair; it is not a clean installation of the published head. Type-aware lint also passed on the exact four-file Windows repair. Current-head GitHub CI passed for 637243b267174cae65e332ad8c991972b5272e3f. Native merge gates landed it as 4feebfc3da5077467a571bdfa9f62da60f378ae6; merge cleanup is complete.

  • Current-main integration preserves the new flow-maintenance context/store API and adds the page mutation cohort as its third argument. Two fresh independent review passes found no actionable P0–P2 findings; focused type-aware lint for the changed read owner and current maintenance caller exited successfully. This source review and lint do not replace current-head runtime CI.

Measured test cost

Retained standalone commands used pnpm test <file> --maxWorkers=1; these are source-qualified historical wall times, not measurements of the entire current head:

File Command wall Result and source
src/tasks/task-registry-projection-read.test.ts 17.62 s 5 passed; 71fba998 integrated candidate 663fd686, compiler-cache hit
src/tasks/task-registry-read.test.ts 29.54 s 31 passed; 71fba998 integration, patch 3fba51a7
src/gateway/server.tasks-list-performance.test.ts 30.03 s 1 passed; Linux 347133a9 integration, patch f628d9f8; test body 9.207 s

The Windows cleanup diagnostic separately took 199.913 s including its controller/compiler startup, with a 58.742 s test body; it used the maintained direct Node wrapper and phase logging. It is not a pnpm or cross-platform performance comparison. Current-head CI started at 11:23:57 UTC; lint passed in 10m44s (11:25:59–11:36:43 UTC), and all required CI gates subsequently passed before merge.

Remaining validation limits

No Gateway throughput or latency improvement is claimed. Earlier load screening completed all 32 tool turns but failed five of 64 Tasks probes; a later combined experiment still failed two of 64. Fresh representative load proof remains outstanding.

Windows cleanup disposition: an earlier run passed the test body but timed out removing its fixture home; the exact OS locking process was not established. Missing scoped idle-coordinator disposal was repaired in #154617. The retained Windows diagnostic with that repair passed both the unchanged 60-second test and final 300-second hook, with final removal completing in 10.545 ms. Current test/helper source matches its uninstrumented inputs, and the current coordinator cleanup implementation matches the executed repair byte for byte. The extracted fixture helper preserves the same awaited close/dispose/remove order. Phase logging did not change assertions or deadlines but may affect scheduling, so this is reused cleanup-contract evidence, not a fresh Windows run of this entire head. Current Windows CI skips this test; the prepared local rerun is blocked by 2.28 GiB free disk versus its retained 10 GiB guard. This bounded Windows validation gap is recorded rather than treating the earlier failure as a current Tasks defect; landing still requires the normal current-head CI and review gates.

@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 03:00
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@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 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 21, 2026, 7:32 AM ET / 11:32 UTC (Revision 11).

ClawSweeper review

What this changes

Tasks page requests reuse their initial accepted-work boundary across retries and wait for already-admitted identity-changing mutations to finish publication.

Merge readiness

⛔ Needs changes before merge - 1 item remains

The repair remains useful and has no actionable correctness findings. The updated failure disposition resolves the prior Windows validation concern under the repository’s best-effort policy.

Priority: P2
Reviewed head: 637243b267174cae65e332ad8c991972b5272e3f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage and no actionable code findings; required test-cost reporting remains.
Proof confidence 🌊 off-meta tidepool Not applicable: The host identifies this as maintainer-authored internal reliability work, so the external-contributor proof gate does not apply. Registered-handler tests exercise the changed read and publication owners; cumulative Linux results are supplemental, while representative load and final-layout Windows success remain explicitly unproven.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The host identifies this as maintainer-authored internal reliability work, so the external-contributor proof gate does not apply. Registered-handler tests exercise the changed read and publication owners; cumulative Linux results are supplemental, while representative load and final-layout Windows success remain explicitly unproven.
Evidence reviewed 8 items Introduced change verified: Reviewed the pinned merge-base-to-head delta and original production blobs. The head adds request-scoped preparation and mutation settlement; the stale test-merge candidate was not used to infer changes to current main.
Current main still needs the repair: At the captured main revision, page retries call prepareTaskRegistryRead again, and read preparation has no captured mutation cohort. GitHub source reads supplied the main blobs unavailable locally. No merged replacement implementing this remaining behavior was established.
Settlement stays with the mutation owner: Settlement resolves in the final cleanup after canonical readback, publication, and failure handling. Only page preparation captures these promises; internal readers retain their existing per-task checks.
Findings None None.
Security None None.

How this fits together

The task registry combines persisted task records with live worker publications. Gateway Tasks requests read that registry, filter records by current session access, and return paginated summaries.

flowchart TD
  A[Tasks page request] --> B[Capture accepted work]
  C[Task events and mutations] --> B
  B --> D[Await captured settlement]
  D --> E[Refresh canonical task rows]
  E --> F[Check current identity and access]
  F -->|Valid| G[Return task page]
  F -->|Retry| E
Loading

Before merge

  • Complete next step (P2) - Add measured single-worker wall times for task-registry-projection-read.test.ts, task-registry-read.test.ts, and server.tasks-list-performance.test.ts, plus available CI timing, to the PR Evidence section; reuse existing measurement logs where available.
Agent review details

Security

None.

PR surface

Source +70, Tests +174, Docs +7. Total +251 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 7 86 16 +70
Tests 3 198 24 +174
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 291 40 +251

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +70 lines; tests net +174 lines Production growth implements request-scoped settlement in existing owners; test growth covers two distinct read races.

Technical review

Best possible solution:

Keep request-scoped waiting in the existing read owner while preserving canonical refresh, independent internal reads, and final access checks.

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

Yes: current-main source exposes both repeated event-fence capture and the commit-before-publication window, with focused registered-handler regressions for each. This read-only review did not execute them.

Is this the best way to solve the issue?

Yes: retaining preparation across retries repairs the existing owner boundary without replacing pagination, weakening identity checks, or adding a parallel persistence path.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded reliability repair for Tasks page failures during concurrent task activity.
  • 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 host identifies this as maintainer-authored internal reliability work, so the external-contributor proof gate does not apply. Registered-handler tests exercise the changed read and publication owners; cumulative Linux results are supplemental, while representative load and final-layout Windows success remain explicitly unproven.

Evidence

What I checked:

  • Introduced change verified: Reviewed the pinned merge-base-to-head delta and original production blobs. The head adds request-scoped preparation and mutation settlement; the stale test-merge candidate was not used to infer changes to current main. (src/tasks/task-registry-read.ts:129, 637243b26717)
  • Current main still needs the repair: At the captured main revision, page retries call prepareTaskRegistryRead again, and read preparation has no captured mutation cohort. GitHub source reads supplied the main blobs unavailable locally. No merged replacement implementing this remaining behavior was established. (src/tasks/task-registry-query.ts:198, 10c229159ceb)
  • Settlement stays with the mutation owner: Settlement resolves in the final cleanup after canonical readback, publication, and failure handling. Only page preparation captures these promises; internal readers retain their existing per-task checks. (src/tasks/task-registry-state.ts:738, 637243b26717)
  • Final response safeguards remain: The handler shares preparation across retries but still checks page currentness, access revision, and current session visibility immediately before responding. The patch changes neither authorization policy nor persistent formats. (src/gateway/server-methods/tasks.ts:242, 637243b26717)
  • Focused regression coverage: Two added registered-handler regressions cover a later event held across a page retry and committed run creations awaiting publication. They exercise real mutation owners with controlled barriers; existing pagination, visibility, retired-owner, and progress checks remain. The captured body reports 128 passing tests on cumulative integration source, not an exact-head runtime pass. (src/tasks/task-registry-projection-read.test.ts:181, 637243b26717)
  • Prior validation concern addressed: The captured body identifies the earlier Windows cleanup deadline failure, preserves the unproven final-layout result, and links the merged idle-handle repair at fix: release idle database handles before temporary runtime cleanup #154617. GitHub confirms that repair merged. Root policy permits documented best-effort investigation to proceed through normal gates without requiring a success-only rerun. Representative load success also remains explicitly unclaimed. (AGENTS.md, 637243b26717)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • jason-allen-oneal: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record measured single-worker wall times for the three changed test files and available CI timing in the PR Evidence section.

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-21T05:20:28.328Z sha e5a674e :: blocked before merge. :: none
  • reviewed 2026-09-21T05:31:06.333Z sha e5a674e :: blocked before merge. :: none
  • reviewed 2026-09-21T06:00:51.526Z sha c9a2b11 :: needs changes before merge. :: none
  • reviewed 2026-09-21T06:30:09.952Z sha 909658b :: needs changes before merge. :: none
  • reviewed 2026-09-21T06:43:04.825Z sha 909658b :: needs changes before merge. :: none
  • reviewed 2026-09-21T07:13:53.342Z sha 909658b :: blocked before merge. :: none
  • reviewed 2026-09-21T10:49:00.523Z sha c754ba5 :: blocked before merge. :: none
  • reviewed 2026-09-21T11:16:26.590Z sha 460371e :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 21, 2026
@steipete steipete changed the title fix: keep Tasks list retries from waiting on newer activity fix(tasks): keep list retries on their initial accepted event prefix Sep 21, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M and removed size: S labels Sep 21, 2026
@steipete steipete changed the title fix(tasks): keep list retries on their initial accepted event prefix fix(tasks): retain admitted work across list retries Sep 21, 2026
@steipete
steipete enabled auto-merge (squash) September 21, 2026 11:40
@steipete
steipete merged commit 4feebfc into main Sep 21, 2026
230 checks passed
@steipete
steipete deleted the codex/perf-task-list-fixed-fence branch September 21, 2026 11:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Sep 21, 2026
* commit '0883394977d1fb3af657635967f6e447bd7fff9a': (72 commits)
  fix(ui): await scheduled rail layout in focus test
  fix(cron): keep healthy active runs from delaying job lists (#154421)
  fix(plugins): prevent config conflicts during legacy plugin installation (#154539)
  perf(gateway): reduce repeated session-list work (#154551)
  fix(tasks): retain admitted work across list retries (#154338)
  perf(gateway): speed up transcript artifact downloads (#154726)
  chore(ui): refresh control ui locales (#154580)
  fix(release): keep two extended-stable months eligible (#154777)
  fix(tests): avoid avatar descriptor reuse race (#154747)
  perf(plugins): reduce callback scope overhead (#154625)
  fix(ui): include final request time in completed work summaries (#149240)
  fix(ai): avoid retrying conflicting Responses terminal statuses (#149242)
  fix: identify malformed Code Mode JavaScript as input errors (#149222)
  fix(doctor): settle imported JSONL transcript leftovers (#154413)
  fix(cloud): restore node bootstrap with bundled browser runtime (#154654)
  test(ui): await publication state notifications (#154768)
  fix(plugins): keep unchanged plugins running across metadata refreshes (#151281)
  fix: keep chat panel accessibility targets within each pane (#153478)
  fix: forced Gateway restarts cancel healthy subagent work (#154300)
  improve: reduce session delivery reader imports (#154740)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
* fix: keep task list retries from waiting on newer activity

* fix(tasks): separate read-fence test registration from metadata additions

* test(tasks): consolidate read fence regression into projection coverage

* fix(tasks): settle admitted mutations before external reads

* fix(tasks): keep unrelated progress reads independent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime 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