Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 3, 2026, 7:44 AM ET / 11:44 UTC. ClawSweeper reviewWhat this changesThe PR makes catalog-worker generation mismatches typed, retires the affected worker pool before queued calls run, and allows later catalog or authentication requests to use a rebuilt worker. Merge readiness⛔ Blocked before merge - 4 items remain The branch correctly converts a cached worker-preparation failure into a typed owner-boundary rejection, fences queued requests before they dispatch, and permits a later worker rebuild. Current main still permanently closes this pool on the same failure; the remaining blocker is resolving or classifying the two failed exact-head checks. Priority: P1 Review scores
Verification
How this fits togetherPrepared model catalog workers rebuild provider, plugin, and authentication facts for one agent generation. Gateway catalog and authentication reads use this owner, which serializes requests through a worker thread before publishing facts to later agent dispatch. flowchart LR
A[Gateway catalog or auth read] --> B[Prepared generation owner]
B --> C[Single-worker task pool]
C --> D[Worker rebuilds catalog facts]
D --> E{Generation matches?}
E -->|yes| F[Return catalog or auth facts]
E -->|no| G[Fence and retire worker pool]
G --> H[Later request starts fresh worker]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +57, Tests +206. Total +263 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the typed mismatch plus owner-scoped lazy pool: the former permanently terminal pool has no mismatch-only reset point, so a net-neutral alternative would weaken the permanent-close behavior for crashes and supersession. Merge after exact-head checks are green or their failures are shown unrelated, and retain the broader drift investigation in #127710. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main throws on a worker fingerprint mismatch and permanently closes its pool, while the branch’s real-worker integration fixture injects that mismatch and verifies same-owner recovery. This read-only review did not execute contributor code. Is this the best way to solve the issue? Yes. Returning the mismatch without publishing rebuilt facts, fencing it at the pool validator, and resetting only that pool preserves the generation boundary while removing the cached permanent wedge; the existing WorkerTaskPool already provides the required queue fencing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3a5fc8f663d2. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (9 earlier review cycles; latest 8 shown)
|
4f28898 to
77548ca
Compare
|
@clawsweeper re-review Both findings from the last review are addressed on the branch (rebased on current
Acceptance criteria run locally: integration suite 23/23 passing; |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
…ad of wedging the owner A worker whose reconstructed fingerprint differs from its owner's generation used to throw, and the worker cached that rejection for its lifetime, so one drift killed every later request on the gateway until restart. The worker now returns a typed `generation-mismatch` outcome carrying both fingerprints and publishes no facts; `ok` replies exist only for the owner's generation. The owner retires that worker and throws PreparedModelCatalogGenerationMismatchError. Retirement is worker-scoped, so the next request rebuilds a worker from the same lifecycle plan rather than replaying a cached terminal error. Superseded, crashed and timed-out workers keep their permanent-close semantics. Adds an injected-mismatch regression on the real worker boundary. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01HspGQJnLGMcam6jCottM9v
…ch resolves A mismatch reply was handled only after pool.run() resolved, so with maxWorkers=1 a queued auth or catalog request could dispatch on the retiring worker and then be rejected through the generic catch, which latched terminalError and recreated the permanent wedge under concurrent use. Reject the typed generation-mismatch reply inside validateResult instead. The pool closes before any successor dispatches, every queued request rejects with the same typed error, and the owner drops the fenced pool without latching so the next request rebuilds a worker from the same lifecycle plan. The mismatch coverage moves to a focused suite (prepared-model-catalog-worker.mismatch.integration.test.ts) with its own slim fixture, keeping the main integration file at its max-lines budget. It adds a concurrent auth+catalog regression that drifts the owner capture for the first spawn only and asserts typed rejections, no successor dispatch, and full recovery on the rebuilt worker. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01HspGQJnLGMcam6jCottM9v
77548ca to
c19495d
Compare
|
@clawsweeper re-review The remaining P1 and the proof ask are addressed on
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Thanks @kiranvk-2011! Proof: Current main repeated one transient catalog fingerprint mismatch on every later request from the same owner. Exact head
CI: Attempt 2 passed every selected job except an inherited service-relay timing test. Current main commit run: 33749598977 attempt: 2 |
* commit '13b1f71c7010baaf2394555198e2fc04bef03586': (283 commits) fix(ui): retire stale MCP feedback across context changes (#128490) fix(agents): clarify set-identity workspace output (#126320) fix(auth): preserve OAuth metadata during session SDK refresh (#127988) fix(agents): recover catalog worker after generation mismatch (#127712) fix(memory-wiki): reject out-of-range claim confidence (#125656) ci: remove redundant contract runs and costly test work (#137220) fix(release): assert the Codex CLI pin the candidate declares (#137136) test(voice-call): reuse shared guards and deferred gates (#137262) fix(cron): isolate scheduler-disabled shared-store writes (#131733) fix(telegram): surface allowed custom reactions in react guidance (#129817) test(infra): reuse the shared npm call presence guard (#137254) fix: generated images disappear after failed tool calls (#131226) fix(docs): match source anchor checks to published sections (#137157) fix(backup): preserve audit capture across slow snapshots (#130962) fix(release): preserve legacy gh log reads (#137016) fix(memory-core): make forget rewrites atomic (#131383) fix(agents): write settings atomically (#131431) fix(plugins): keep the memory indexing runtime with the selected slot owner (#131779) fix(ci): pin iOS screenshot evidence to workflow revision (#136334) test(logging): remove redundant stderr spy casts (#137238) ... # Conflicts: # scripts/e2e/lib/codex-release-package-assertions.mjs
…aw#127712) ## What Problem This Solves A transient prepared model catalog fingerprint mismatch can permanently wedge one worker. Every later catalog or authentication request on that owner then repeats the cached preparation failure. The failure reaches Gateway catalog and authentication reads used before agent dispatch. ## Root cause The worker caches one `preparedGeneration` promise for its lifetime. A fingerprint mismatch rejects that promise. The parent receives the failure as a normal worker result, so it keeps the same worker and reuses the same rejected promise. ## Fix - Return a typed generation-mismatch result before any catalog or authentication facts leave the worker. - Reject that result in the pool validator so the pool closes before queued work can dispatch. - Drop only the mismatched pool and let the same lifecycle owner create a new worker on the next request. - Keep crashes, timeouts, and superseded generations permanently closed. - Isolate the real-worker regression from ambient Codex authentication. A persistent mismatch still rejects one request per cold worker. This bounded fail-closed behavior is intentional: it preserves the owner generation and avoids publishing foreign facts while the separate environmental drift remains under diagnosis. Production change: +90/-33 lines, net +57. The remaining growth defines the typed mismatch result and the mismatch-only pool replacement. The maintainer pass removed the second terminal-error cache and the test-only error export. The separate owner-publication race from openclaw#127710 has already landed through openclaw#130856. This pull request stays focused on the catalog-worker wedge. ## Evidence Current main baseline: `ef3a75f0d4a8eb2b75e4f1c20fdc4de7d8232b95` Red: ```text node scripts/run-vitest.mjs src/agents/prepared-model-catalog-worker.wedge.proof.test.ts 1 failed, 1 passed recovery on the same owner failed with: prepared model catalog worker reconstructed a different runtime generation ``` The control case created a fresh owner from the unchanged plan and passed. This proves the fixture was valid and the existing worker was wedged. Green on `90900cfcdc5e2affa5217ed06bf5d3558da09d57`: ```text node scripts/run-vitest.mjs src/agents/prepared-model-catalog-worker.integration.test.ts src/agents/prepared-model-catalog-worker.mismatch.integration.test.ts src/infra/worker-task-pool.test.ts 3 files passed, 34 tests passed ``` The transient case uses the real catalog owner, `WorkerTaskPool`, and worker thread. It proves queued work does not run on the retired worker, then proves worker 2 serves catalog and authentication facts on the same owner. Original diagnosis and repair by @kiranvk-2011. ## CI note Exact-head CI passed all selected jobs except `checks-node-compact-small-6`. Its unchanged `agent-exec` service-relay timing test failed twice while waiting for a fake CLI process ID. Current main commit `1324822b2242ad2a16ab29f7ade9cc9f527f8c97` removes that test, and this pull request does not touch its file or wait helper, so the squash merge cannot restore the failure. The latest PR context and evidence run passed after the required headings were restored. Co-authored-by: kiranvk2011 <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
A transient prepared model catalog fingerprint mismatch can permanently wedge one worker. Every later catalog or authentication request on that owner then repeats the cached preparation failure.
The failure reaches Gateway catalog and authentication reads used before agent dispatch.
Root cause
The worker caches one
preparedGenerationpromise for its lifetime. A fingerprint mismatch rejects that promise. The parent receives the failure as a normal worker result, so it keeps the same worker and reuses the same rejected promise.Fix
A persistent mismatch still rejects one request per cold worker. This bounded fail-closed behavior is intentional: it preserves the owner generation and avoids publishing foreign facts while the separate environmental drift remains under diagnosis.
Production change: +90/-33 lines, net +57. The remaining growth defines the typed mismatch result and the mismatch-only pool replacement. The maintainer pass removed the second terminal-error cache and the test-only error export.
The separate owner-publication race from #127710 has already landed through #130856. This pull request stays focused on the catalog-worker wedge.
Evidence
Current main baseline:
5778f39cc39737ce63a7cfd9e2c254e26fc52293Red:
The control case created a fresh owner from the unchanged plan and passed. This proves the fixture was valid and the existing worker was wedged.
Green on
90900cfcdc5e2affa5217ed06bf5d3558da09d57:The transient case uses the real catalog owner,
WorkerTaskPool, and worker thread. It proves queued work does not run on the retired worker, then proves worker 2 serves catalog and authentication facts on the same owner.Original diagnosis and repair by @kiranvk-2011.
CI note
Exact-head CI passed all selected jobs except
checks-node-compact-small-6. Its unchangedagent-execservice-relay timing test failed twice while waiting for a fake CLI process ID. Current main commitc3a495d198fe16e5a698132983ee1d7f7117d91aremoves that test, and this pull request does not touch its file or wait helper, so the squash merge cannot restore the failure. The latest PR context and evidence run passed after the required headings were restored.