Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR lets healthy agents recover independently while another agent’s database integrity check remains pending. Example: Restart five agents while bench-slow has a 512 MiB database and a controlled 10-second integrity-check delay.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Both previous findings are fixed, and no remaining actionable defect was found in this PR’s introduced diff. Keep it open for the pending checks on the reviewed head. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway startup restores persisted subagent obligations through requester-session activation, session-store discovery, and the SQLite worker broker; admitted work proceeds through the existing recovery and execution owners. flowchart TD
A[Gateway restart] --> B[Independent recovery tails]
B --> C[Requester session cohorts]
B --> D[Available store discovery]
C --> E[Agent database preparation]
D --> F[SQLite broker FIFO]
E --> F
F --> G[Recovered sessions and maintenance]
Technical reviewBest possible solution: Retain the independent recovery cohorts and existing admission owners, with ordinary landing gated by successful checks on this head. Do we have a high-confidence way to reproduce the issue? Current-main source retains both blocking mechanisms, and the supplied isolated Gateway comparison demonstrates the resulting recovery delay; this read-only review ran no target code. Is this the best way to solve the issue? The patch removes unnecessary fleet barriers, partitions work by requester session, and reuses canonical admission, queues, and recovery owners without introducing a competing runtime service. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d958966b09ea. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +244, Tests +481, Docs +51, Other +315. Total +1091 across 39 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed October 19, 2026, 2:33 AM ET / 06:33 UTC (Revision 3). |
4f11fb6 to
1a8913e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a8913e51e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1a8913e to
2dbd394
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d9283db to
1891d68
Compare
|
All five review findings are fixed and their threads resolved. The final body now includes both successful concurrent, swapped-core measurement pairs, the RSS tradeoff, and the benchmark limitations. Independent reviews are clean; final CI is running on 1891d68ca095e13a4ce535763bc1ce195a94dc8f after correcting the Vitest parameterized timeout declaration. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
69490f7 to
819f01d
Compare
Remove the all-agent reader prewarm barrier and activate restored requester cohorts independently. Recovery discovery and cron skip typed pending stores; cron retries when the existing admission owner publishes availability. Wait for already-pending native preparation before admitting a read to shared workers, preserving integrity, read-only admission and request cancellation. Shutdown still joins accepted recovery tails and concurrent recovery cannot settle the same runtime owner twice. Regression coverage fails on the old recovery and read-admission boundaries. Focused tests, changed-file lint/format and core typecheck passed; broad and exact-head validation runs in PR CI. The bounded synthetic Gateway benchmark uses a real integrity scan with an explicit delayed gate.
Wait for an available carrier before assigning new database actors, so a healthy agent does not queue behind another agent's full integrity scan. Preserve worker limits, admission authority, and accepted command ordering. Cover native held-integrity isolation and waiting-opener cancellation, remove the superseded reader wait, and exercise four healthy agents in the startup benchmark. Consolidate existing native fixture setup without weakening proof.
Reserve the first completing healthy SQLite carrier instead of requiring an idle window after its reply dispatches queued work. Existing bounded queues retain FIFO and cancellation without starving newly admitted actors. Read the requester's current Swarm concurrency policy when delayed recovery enqueues a collector, preserving captured requester custody. Remove the unused config snapshot from the resume callback. Regression proof reproduces both starvation and stale-limit activation on the previous code, then exercises the fixes with existing broker and queued recovery coverage. No integrity or admission checks are bypassed.
819f01d to
2ab13fa
Compare
|
Merged under the explicitly authorized inherited-CI-failure exception for exact head CI run 39217398292, attempt 1, completed all 91 jobs: 65 passed, 24 skipped, and two failed—the Control UI test-type shard and its aggregate gate. All PostgreSQL conformance shards, selected Node/UI tests, production types, lint, architecture guards, and independent security checks passed. Independent review is clean and all review threads are resolved. The sole root failure is Healthy recovery improved from 16.840 s to 6.740 s in two concurrent paired measurements; readiness was neutral, and peak RSS increased by 140.9 MiB. Pending stores remain behind their real integrity gate. The proof used bounded synthetic state with a labeled 10-second hold, rather than a replay of the production-sized database. |
…penclaw#176916) * fix(subagents): recover healthy agents while another database opens Remove the all-agent reader prewarm barrier and activate restored requester cohorts independently. Recovery discovery and cron skip typed pending stores; cron retries when the existing admission owner publishes availability. Wait for already-pending native preparation before admitting a read to shared workers, preserving integrity, read-only admission and request cancellation. Shutdown still joins accepted recovery tails and concurrent recovery cannot settle the same runtime owner twice. Regression coverage fails on the old recovery and read-admission boundaries. Focused tests, changed-file lint/format and core typecheck passed; broad and exact-head validation runs in PR CI. The bounded synthetic Gateway benchmark uses a real integrity scan with an explicit delayed gate. * test(cron): adapt recovery regression to current fixtures * fix(sqlite): keep agent opens off busy integrity carriers Wait for an available carrier before assigning new database actors, so a healthy agent does not queue behind another agent's full integrity scan. Preserve worker limits, admission authority, and accepted command ordering. Cover native held-integrity isolation and waiting-opener cancellation, remove the superseded reader wait, and exercise four healthy agents in the startup benchmark. Consolidate existing native fixture setup without weakening proof. * test(sqlite): align worker fixtures and prune obsolete allowance * fix(recovery): isolate requester sessions and terminal refusals * fix(recovery): retain healthy shared-store siblings * test(subagents): use typed parameterized timeout options * test(subagents): allow independent requester resume order * fix(recovery): preserve open FIFO progress and current swarm limits Reserve the first completing healthy SQLite carrier instead of requiring an idle window after its reply dispatches queued work. Existing bounded queues retain FIFO and cancellation without starving newly admitted actors. Read the requester's current Swarm concurrency policy when delayed recovery enqueues a collector, preserving captured requester custody. Remove the unused config snapshot from the resume callback. Regression proof reproduces both starvation and stale-limit activation on the previous code, then exercises the fixes with existing broker and queued recovery coverage. No integrity or admission checks are bypassed. * test(subagents): document isolated recovery config mock * test(subagents): drain pending recovery before restart fixture reset * test(cron): preserve detached notification recovery coverage
What Problem This Solves
A full integrity check for one agent delays restart recovery for healthy agents.
User Impact
Healthy agents recover while another agent's database is checking. The pending agent retains the existing typed, retryable inspection response; its recovery and cron maintenance resume after admission publishes availability. No ordinary database access bypasses the integrity gate.
Current main already publishes Gateway readiness before these observers. This change preserves that behavior and makes recovery independent. Runs within one requester session retain mailbox order and wait together when that session depends on the pending agent. Independent sessions owned by the same parent agent recover separately. Main-session recovery and periodic subagent retention sweeping still join the startup recovery tail. Required/default-agent readiness policy is unchanged.
Why This Change Was Made
Remove the fleet-wide reader prewarm and cron preparation barriers. Delivery recovery, exec notifications, and subagent activation retain independent tails; requester sessions preserve their internal order. Discovery excludes unavailable physical stores before acquiring readers, retaining healthy siblings behind custom selectors. Partial recovery omits uncreated stores without changing normal or legacy discovery. Cron retries on the existing availability publication; terminal admission refusals do not schedule minute polling. Shutdown joins accepted tails, and the existing interrupted-run coordinator prevents duplicate settlement.
The real Gateway reproduction exposed a second cause: assigning a new database actor by actor count could strand it on the worker performing the full integrity scan, even though another worker finished 29 ms later. New actors now join the first completing healthy carrier's existing FIFO, even when its next queued command has already started. This avoids starvation under steady traffic without adding a queue or requiring an idle window. This preserves the worker limit, global open ordering, cancellation, and admission authority.
Runtime code grows by 234 lines to retain per-requester recovery cohorts and carry unavailable-store exclusions across discovery. The old fleet barriers and recovery-only sweep branch are removed. There is no new availability owner, worker pool, cache, configuration option, schema, or stored-format migration. The benchmark extends the existing startup driver. The requested non-test/non-doc diff is 841 additions and 257 deletions (+584), including the benchmark and its README; runtime alone is 485 additions and 251 deletions (+234).
Evidence
The healthy-agent recovery regression fails on the original recovery boundary. The native broker regression holds the actual integrity PRAGMA on one carrier and requires newly opened healthy agents to prepare before release: it times out with the old placement and passes with this repair. Broker cancellation tests verify that cancelling a waiting opener leaves accepted jobs running.
The broker repair passed 175 focused cases across 10 files, with one existing skip. Final review repairs passed 119 recovery/cron cases, 26 benchmark cases, and 15 inventory/discovery cases. Negative controls demonstrated requester-session blocking, terminal-refusal polling, healthy shared-store exclusion, missing-sibling discovery failure, and benchmark false success before their respective repairs. Changed-file formatting/lint passed. One core native typecheck passed earlier; exact-head PR CI owns final broad checks and type validation. Fresh independent reviews found no actionable P0–P2 issues.
Earlier CI identified affected worker fixtures and an obsolete mock allowance. These were repaired with focused proof, including all five Board settlement cases; no CI rerun was used to chase green. Final CI caught the parameterized regression’s trailing numeric timeout, unsupported by Vitest 5
it.for; the declaration now uses its typed options argument, retaining the same timeout and all assertions. Its 23 cases passed again (50.51 s wrapper wall time, including worker preparation); changed-file formatting/source-only lint and independent review passed. The corrected test-typecheck passed in run 39206009661. That run then exposed a cross-session ordering assumption in the failed-requester retry fixture: both children resumed correctly, in the opposite order. The assertion now requires exactly one call per child, with unchanged post-retry count and separate strict same-session ordering coverage. All 23 cases passed again in 32.72 s wrapper wall time; formatting, source-only lint and fresh independent review passed.Final review found two further defects, both repaired with red/green regressions. The worker-completion regression now uses real reply settlement followed by synchronous successor dispatch; it reproduced starvation, then all 12 lifecycle cases passed after reservation of the completed carrier. A held database-preparation test reloads the requester's concurrency limit from 2 to 1 while the child limit stays 3; it reproduced premature activation, then verified the child waits for an active sibling to release capacity and retains original requester custody. Recovery reads current concurrency at enqueue and removes the obsolete carried config parameter. All 17 broker cases and 24 queued-recovery cases passed together in 58.10 s wrapper wall time. Changed-file formatting/source-only lint and fresh independent P0–P2 review passed. CI then rejected the controlled config mock because its changed factory no longer matched the old allowance. Added the required isolation explanation and removed exactly that obsolete allowance; runtime and test behavior are unchanged. Changed-file format/lint and a fresh independent review passed. Run 39209917581 then exposed a held-inspection fixture deadlock: the fixture awaited recovery activation before releasing the database preparation it now correctly waits for. That unresolved activation contaminated 15 later cases. The single original case reproduced a 120-second timeout. The fixture now uses two sequential startup owners, stops and joins the first before reset, and retains no-wake/unchanged-custody/exactly-one-wake assertions. The corrected case passed in 10.51 s wrapper wall time; all 33 requester-wake cases then passed in 85.77 s, including the 15 former cascade failures. This existing product-flow file exercises mailbox, database admission, durable custody and restart together; its full-file cost is recorded rather than hidden by a timeout change. Changed-file format/lint and a fresh independent P0–P2 review passed. Runtime is unchanged by this fixture repair. While this head had 89 successful CI checks and one PostgreSQL shard still running, main advanced and conflicted in cron maintenance and the requester fixture. Main #177080 carries the old aggregate startup wait through detached notifications; this lane removes that superseded wait and its parameter plumbing, keeping its four notification/late-preparation scenarios under the independent-retention contract. Main #177033 refactored requester fixtures; the repair now uses those shared helpers while retaining two sequential startup owners and stop/drain-before-reset. The cron runtime is byte-identical to the previously tested lane head. All 15 real-store cron cases passed; the adapted 17 lifecycle cases and all 33 requester-wake cases passed in 76.30 s combined wrapper wall time. Changed-file format/lint and fresh independent P0–P2 review passed. Final integrated-head CI completed. All selected Node, UI E2E, PostgreSQL, production-type, lint, architecture, and security jobs passed. The unrelated Control UI test-type failure and its resulting aggregate failure are attributed below.
Measurement acceptance rule: two concurrent baseline/candidate pairs with CPU halves swapped; identical fresh synthetic state per side, one 512 MiB agent database without its clean-close seal, four small agent databases, five independent requester sessions belonging to one healthy parent agent, and a labeled 10-second preload hold before the real full integrity scan. Every healthy agent must recover before the candidate's slow gate passes; the slow agent must recover afterward; readiness must not regress beyond paired noise. Compare candidate minus baseline within each pair.
Measured on an isolated Linux sandbox (Node 26.8.2). Both pairs ran concurrently under the exclusive measurement lock, with baseline/candidate on CPUs 96–111/112–127 for pair 7 and the halves swapped for pair 8. Times below are seconds since Gateway launch; deltas are candidate minus baseline.
Median paired change: last healthy recovery −10.099 s (16.840 s → 6.740 s, 60.0% less time); readiness −0.023 s, neutral at this scale. Every candidate healthy agent recovered before the slow integrity gate passed; the slow agent recovered strictly afterward. Both sides reported zero admission errors. The strict harness rejected both baselines only for late healthy recovery (exit 1) and accepted both candidates (exit 0). Both pair drivers and all four Gateways completed with exit 0, including controlled shutdown. No shared-state WAL checkpoint warning appeared in these four output tails.
Measured cost: peak RSS was 1,790 → 1,927 MiB and 1,793 → 1,939 MiB, a paired median increase of 140.9 MiB (+7.9%). CPU was 16 → 16 and 16 → 15 CPU-seconds, from coarse whole-second process accounting. This establishes recovery independence, not a memory optimization. Only two paired samples were collected; no general throughput or steady-state memory claim is made.
Measured source pins: baseline
30937ee666735b1bfd1c453b6a723a8828a15f1a, candidate1c33e046d3b815c756b3b65922633d4d5595693f, identical harness SHA-25674b2428052aa6151469b026097793d2bca7719b9b6811f1b9ac8d273df3de820. BothsourcePerformancebuilds passed (56 s and 58 s). Existing sandbox dependencies were reused with matching build/runtime lock inputs, including the previously SHA-512-verified official@openclaw/proc-safe0.4.2 artifacts; omitted example/lint-only dependencies are outside this benchmark. Subsequent lane changes added the config-mock explanation, obsolete-allowance removal, requester-wake restart-fixture repair, and detached-notification fixture coverage, then rebased onto main (preserving its fixture refactor). They change tests and their allowance only; measured runtime patches are unchanged. These are the explicitly pinned runtime measurements; final-head CI validates the later integrated head.The synthetic slow DB was 538,923,008 bytes after close; each healthy DB was 659,456 bytes. The labeled preload hold was 10 seconds, followed by the actual full scan (observed extra gate time 101–129 ms, including observation/scheduling overhead). Build/fixture work ran sequentially on CPUs 64–95. Fresh independent state and ports were used for every side. Recorded CPU busy time (including measured work) was 8.64%/8.77% across the two halves in pair 7 and 8.38%/8.65% in pair 8; this is context, not a run-validity gate. Observed pre-stage Dirty peaked at 145,828 KiB. Baseline reader prewarm took 343/335 ms and delivery discovery 9,309/9,329 ms; candidate reader prewarm was zero and discovery 41/38 ms. Aggregate activation still includes the pending slow agent, so per-agent timestamps establish independence.
Reproduce with the existing driver, building each pinned source with
OPENCLAW_BUNDLED_PLUGIN_BUILD_IDS=browser GIT_COMMIT=<pin> node --import ./scripts/tsx.mjs scripts/build-all.mts sourcePerformance, then:The isolated Gateway benchmark observes readiness, per-agent recovery, and admission-error counts. Typed pending-session behavior is retained from the admission owner; focused discovery/cron tests cover pending stores and resumption. The benchmark does not schedule cron jobs or send live model/channel traffic. Fixtures are synthetic and bounded, not a replay of a 44 GiB production database. No local broad suite or validation lease was used. The focused E2E wrapper initially started automatic build preparation; that process was stopped, and both focused runs used its supported
OPENCLAW_E2E_SKIP_BUILD=1setting.Final-head CI attribution
Run 39217398292, attempt 1, tests PR head
2ab13faf5319a687461f506d35fb7e6a38a913e9through merge2b4499ddef77590dc4e2468cc47e78f1cb162c92, whose ordered parents are main908d45c487955317da4653b95881279c8c23d624and that PR head. The only substantive failure observed is check-test-types-core-2:The stale test property came from main #177038 (
de2700c9946ff95f05c6be9b1d6d47289077a211). The test and its direct type owner,src/gateway/control-ui-session-pr-subscriptions.ts, are byte-identical on the exact main parent, tested merge, and PR head (Git blobs5750baf6a3a3d86e3656ed18b6839a351bfec31fand6aaabc1b9fd4e713ec35f3d715c2ab68b2c8fd93). Neither file belongs to this lane's diff.The existing isolated Linux sandbox reproduced the same TS2353 on both exact sources with native tsrs and
node scripts/run-tsgo.mjs -p .lane-1445-control-ui.tsconfig.json --pretty false. That config extends the committed gateway-methods shard, includes only the failing test, and retains all 14 inherited ambient/generated inputs and 164 source path mappings. Baseline and tested merge both exited 2 in 4.801 s and 4.405 s. Both also emitted the same three missing-UI-dependency diagnostics (@noble/ed25519twice and@noble/hashes/sha2.jsonce); this is named-error attribution, not a clean full-shard reproduction. Initial runs with missing inherited configs were rejected as setup failures and are not used as proof. No CI rerun, extra install, or broad local validation was used.Final accounting: all 91 jobs in CI run 39217398292 completed (65 succeeded, 24 skipped, and two failed: the named test-type shard plus its aggregate gate). All three PostgreSQL conformance shards passed. The full PR rollup had 94 successful checks at final inspection. The informational failure table calls the type shard “new” against an earlier scheduled main run without comparing selected scope; the exact-main-parent reproduction above supplies the independent attribution. Landing uses the explicitly authorized inherited-failure exception; CI is not reported as green.