Repository navigation
fix: keep failed idle database cleanup from blocking every agent - #157693
roboclaw-bot wants to merge 18 commits into
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: needs maintainer review before merge. What this changesThis PR frees healthy idle capacity after database cleanup fails, preserves nested failure causes, exposes protected diagnostics, and serializes selected system-runtime CI work. Example: Four agents are warm when a fifth finishes, and cleanup of agent first fails with SQLITE_BUSY.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep this PR open: its remaining cleanup-capacity and diagnostic repairs are useful and absent from main; no actionable introduced bug was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe agent execution owner manages native SQLite generations and idle reuse; worker failures enter that owner, and cleanup facts leave through Gateway readiness diagnostics. flowchart TD
A[Agent requests] --> B[Execution owner]
B --> C[Idle executor pool]
B --> D[SQLite worker broker]
D --> E[Native database generation]
E --> B
B --> F[Protected readiness diagnostics]
Technical reviewBest possible solution: Land the scoped capacity and diagnostic repair while preserving cleanup custody and tracking the original platform fault separately. Do we have a high-confidence way to reproduce the issue? Current main shows the failed-idle-capacity path directly, and the supplied native-worker fixture exercises it; the original Windows/Linux initiating fault remains unidentified. Is this the best way to solve the issue? The repair keeps one cleanup owner, preserves same-agent recovery and revocation, and follows the recorded readiness decision without changing persisted formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 35b6b308f6cb. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +56, Tests +288, Docs +20, Other +16. Total +380 across 17 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 (24 earlier review cycles; latest 8 shown)
Reviewed October 11, 2026, 3:11 AM ET / 07:11 UTC (Revision 25). |
|
Additional release-candidate validation supporting this PR's isolation approach:
This is supporting validation of your existing work, not a claim to a new isolation design. The tests were run on the local release adaptation, not on the current head of this PR. We have not identified the original field-native failure or established long-term production stability. We also isolated a separate, release-specific reclamation defect during that work: #159916. It concerns a dedicated worker terminated before dispatch and does not replace this PR's cross-agent isolation fix. If narrowing the readiness portion helps unblock the existing review, the local result supports keeping the cleanup-isolation repair independently useful. No change to the PR's branch has been made by us. |
a1481eb to
5b91e09
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
5b91e09 to
76ffea9
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
76ffea9 to
c9b2069
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
737c180 to
9b57a58
Compare
An explicit cron run reads its authorized job definition and private scratch separately inside a SQLite read transaction. Read both in one dialect-layer LEFT JOIN so they share a statement snapshot, removing three SQL statements per SQLite run without another worker request. The job reader keeps its all-column authorization relation, ordered narrow projection, exact returned-ID check, existing decoder/config revision and legacy creation fallback. Missing scratch still reports revision 0; deletion keeps its revision tombstone. The standalone maintenance reader remains. No schema, cache, write, receipt, claim-before-effect, delivery authority, FIFO or 64-receipt retention change. PostgreSQL retains the shared reader's outer read-only transaction and rollback: its exact-job read is 4→3 SQL, not 4→1. SQLite exact-job is 4→1, heartbeat 3→1; PostgreSQL heartbeat remains 3→3. Accepted noncontract edges: an absent/malformed job can now require scratch SELECT privilege, and malformed job plus unsafe numeric scratch can reject the numeric data first. These do not remove the existing caller/source/cancellation checks. The production delta is +3 lines: one joined query replaces the transaction and duplicate read while sharing NULL handling with heartbeat. Existing test files cover read-after-write, tombstones, missing jobs/monitors and both database engines. No new suite or runner is added. Acceptance was registered before measurement: the committed `scripts/bench-cron-run.mts` drives signed WebSocket `cron.run` against an isolated synthetic Gateway/provider, once cold and twice warm. Each run must produce one start, one finish, one Responses request and exact-run history verification. Compare execution, history verification and settlement separately and together, plus shutdown and the entire invocation. The scratch owner must fall from 4→1 SQL with 1 request and 0 MAIN throughout; no cost may be deferred outside the run. Keep cold/warm separate and report median/p95/range. Three same-platform alternating pairs when calm, or one pair plus source attribution under campaign load. Counts and profiles make no latency/CPU-speed claim; timing claims require the timing lock, load below 24 and ≥5 alternating samples per arm. A 20% user-facing regression stops acceptance. Delivery mode none does not claim an external-send proof. The same-platform explicit comparison (baseline 814e732, candidate 93a6c4) gives: | SQL / requests / MAIN | Baseline | Candidate | | --- | --- | --- | | Cold execution + verification + settlement | 257 / 80 / 0 | 254 / 78 / 0 | | Warm 1 | 247 / 64 / 0 | 235 / 60 / 0 | | Warm 2 | 252 / 61 / 0 | 245 / 65 / 0 | | Warm median | 249.5 / 62.5 / 0 | 240 / 62.5 / 0 | | Warm descriptive p95 | 252 / 64 / 0 | 245 / 65 / 0 | | Warm range | 247–252 / 61–64 / 0 | 235–245 / 60–65 / 0 | | Shutdown | 22 / 6 / 5 | 40 / 10 / 5 | | Whole invocation | 1383 / 356 / 58 | 1369 / 352 / 58 | Each of the three runs completed one start, finish, Responses request and exact history verification. The scratch owner is exactly 4/1/0 → 1/1/0 in every run, all in its execution phase, with no extra or deferred scratch requests. All execution/verification/settlement phases are SQL-error-free and runtime MAIN remains zero. The count comparison is diagnostic, not an error-free full invocation: the frozen analyzer rejects two failed shutdown `state_leases` DELETEs (`database is locked`). Shutdown exceeds the 20% stop threshold; it was stopped and explicitly accepted by the coordinator as inherited after an independent main shutdown-lock reproduction. The separate SHUTDOWNLOCK lane owns that repair. The scratch join changes no lease code or writes. No latency or CPU-speed claim is made. The frozen 3.1.5 standard workload is a different scheduled `cron.add` flow: three valid baselines gave 06.cron 231/62/0, 235/65/0, 233/63/0 (median 233/63/0), versus ordinary warm 45/12/0. The descriptive excess is 188 SQL/51 requests, not causal subtraction. One extra standard setup aborted before any Gateway; it supplies no performance evidence. The existing scratch source is identical across that baseline and the explicit baseline. Full current-standard delta is deferred to the next census. Validation: count regression red on baseline (2 SELECTs and BEGIN/COMMIT), all 17 scratch-store tests green on the candidate; two isolated Codex P0–P2 reviews scoped-clean. The existing two-engine conformance test passed on actual SQLite and PostgreSQL 17, with catalog/trigger parity and cleanup verified. Test cost: scratch cases totaled 6.528 s (125.95 s file duration, mostly transform); the two engine cases totaled 1.846 s (260.62 s file duration, mostly transform). The candidate build and official source-freshness check passed at measured runtime head 93a6c4d; the three-sample invocation completed with the shutdown limitation above. Exact-head CI run 40176443806 completed successfully: 39 successful jobs, 26 skipped, no failures, including all three actual PostgreSQL shards, production/test types, lint, source contracts, Madge, and worker/T1/dialect ratchets. The earlier run passed types, lint and source contracts but found a worker-inventory omission: the new direct query was conservatively labeled T1. Head a187ecf corrects only inventory metadata and regenerates its snapshot: the worker snapshot and its private heartbeat helper are W, while the native Doctor reader stays T3. No runtime or SQL change is involved. The generated snapshot also catches up existing main classifications; targeted script lint and formatting pass. The two production reviews remain valid; this tooling-only correction adds no production review round. PG review approved the semantics at 68c24c4, and the coordinator explicitly carried REVIEW-OK to 93a6c4d because only benchmark TypeScript annotations changed. Candidate counts and the inherited-shutdown disposition are recorded; the corrected head’s CI and all three PG shards passed. The test-only import relocation avoids another open PR's adjacent import change; production bytes remain identical to both isolated reviews and database proof. The benchmark annotations fix CI TS7022 without changing emitted behavior. Final-head overlap at a187ecf: complete shared-index base-versus-candidate merge-tree comparison covers 21 peers (#183410, #183285, #181057, #180871, #180286, #180139, #169241, #168956, #168615, #167546, #167471, #165039, #161997, #157922, #157693, #156613, #141004, #137788, #136476, #129388, #121204). No new source conflict paths, regions or messages. Six peers (#181057, #180871, #180139, #169241, #129388, #121204) have added or changed conflicts confined to the fully generated worker inventory. The coordinator explicitly accepted this class because main's snapshot was stale and generated outputs must be regenerated, not hand-edited. The same exact-head disposition carries PG REVIEW-OK because runtime bytes are unchanged. Exact-head CI and all three PostgreSQL shards passed. PG checklist: (1) read-only; existing writer transaction/advisory-lock, DML/conflict and cross-store commit ordering unchanged. (2) At most one joined row via the existing composite primary keys, original job fields plus four scratch fields, unchanged 256 KiB scratch write bound. (3) No cache/generation or invalidation change; one statement snapshot, existing outer PG read transaction retained. (4) No schema/admission/identity/retry/probe change. (5) Same worker owner, one request, no MAIN expansion; target 4→1 SQL in all three real Gateway runs, with the inherited shutdown failure disclosed above. (6) Actual PostgreSQL 17 and SQLite owner conformance passed; all three final-head PostgreSQL CI shards and the other selected static checks passed. Knip was run separately because ordinary PR CI excludes it. The canonical candidate export scan failed with 26 script, 20 production and 16 full-tree findings; none is in a changed file. All 62 occurrences (52 unique file/symbol pairs), scanner/config/compiler inputs and package inputs are unchanged from merge-base dada70f. The only removed imports, runSqliteReadSnapshotSync and loadCronRows, both retain multiple real production consumers. Current-main diagnostic sections reported 14 script and 7 production findings; main has already repaired 40 candidate occurrences in unrelated changes. Its separate full-tree scan was intentionally stopped after the coordinator accepted the source-attributed inherited findings; it is not a passing full-main scan. No ignored exports, baselines or unrelated code were changed. The failed candidate scan is explicitly accepted as inherited; all branch changes and selected CI static checks pass. Pre-merge shared-index refresh retains 17 open peers from that audit. Only #180871 moved (f140f16); its fresh base-versus-candidate comparison still adds conflicts solely in the generated worker inventory, within the coordinator-accepted class. No new source conflicts. Co-authored-by: Peter Steinberger <[email protected]>
An explicit cron run reads its authorized job definition and private scratch separately inside a SQLite read transaction. Read both in one dialect-layer LEFT JOIN so they share a statement snapshot, removing three SQL statements per SQLite run without another worker request. The job reader keeps its all-column authorization relation, ordered narrow projection, exact returned-ID check, existing decoder/config revision and legacy creation fallback. Missing scratch still reports revision 0; deletion keeps its revision tombstone. The standalone maintenance reader remains. No schema, cache, write, receipt, claim-before-effect, delivery authority, FIFO or 64-receipt retention change. PostgreSQL retains the shared reader's outer read-only transaction and rollback: its exact-job read is 4→3 SQL, not 4→1. SQLite exact-job is 4→1, heartbeat 3→1; PostgreSQL heartbeat remains 3→3. Accepted noncontract edges: an absent/malformed job can now require scratch SELECT privilege, and malformed job plus unsafe numeric scratch can reject the numeric data first. These do not remove the existing caller/source/cancellation checks. The production delta is +3 lines: one joined query replaces the transaction and duplicate read while sharing NULL handling with heartbeat. Existing test files cover read-after-write, tombstones, missing jobs/monitors and both database engines. No new suite or runner is added. Acceptance was registered before measurement: the committed `scripts/bench-cron-run.mts` drives signed WebSocket `cron.run` against an isolated synthetic Gateway/provider, once cold and twice warm. Each run must produce one start, one finish, one Responses request and exact-run history verification. Compare execution, history verification and settlement separately and together, plus shutdown and the entire invocation. The scratch owner must fall from 4→1 SQL with 1 request and 0 MAIN throughout; no cost may be deferred outside the run. Keep cold/warm separate and report median/p95/range. Three same-platform alternating pairs when calm, or one pair plus source attribution under campaign load. Counts and profiles make no latency/CPU-speed claim; timing claims require the timing lock, load below 24 and ≥5 alternating samples per arm. A 20% user-facing regression stops acceptance. Delivery mode none does not claim an external-send proof. The same-platform explicit comparison (baseline 814e732, candidate 93a6c4) gives: | SQL / requests / MAIN | Baseline | Candidate | | --- | --- | --- | | Cold execution + verification + settlement | 257 / 80 / 0 | 254 / 78 / 0 | | Warm 1 | 247 / 64 / 0 | 235 / 60 / 0 | | Warm 2 | 252 / 61 / 0 | 245 / 65 / 0 | | Warm median | 249.5 / 62.5 / 0 | 240 / 62.5 / 0 | | Warm descriptive p95 | 252 / 64 / 0 | 245 / 65 / 0 | | Warm range | 247–252 / 61–64 / 0 | 235–245 / 60–65 / 0 | | Shutdown | 22 / 6 / 5 | 40 / 10 / 5 | | Whole invocation | 1383 / 356 / 58 | 1369 / 352 / 58 | Each of the three runs completed one start, finish, Responses request and exact history verification. The scratch owner is exactly 4/1/0 → 1/1/0 in every run, all in its execution phase, with no extra or deferred scratch requests. All execution/verification/settlement phases are SQL-error-free and runtime MAIN remains zero. The count comparison is diagnostic, not an error-free full invocation: the frozen analyzer rejects two failed shutdown `state_leases` DELETEs (`database is locked`). Shutdown exceeds the 20% stop threshold; it was stopped and explicitly accepted by the coordinator as inherited after an independent main shutdown-lock reproduction. The separate SHUTDOWNLOCK lane owns that repair. The scratch join changes no lease code or writes. No latency or CPU-speed claim is made. The frozen 3.1.5 standard workload is a different scheduled `cron.add` flow: three valid baselines gave 06.cron 231/62/0, 235/65/0, 233/63/0 (median 233/63/0), versus ordinary warm 45/12/0. The descriptive excess is 188 SQL/51 requests, not causal subtraction. One extra standard setup aborted before any Gateway; it supplies no performance evidence. The existing scratch source is identical across that baseline and the explicit baseline. Full current-standard delta is deferred to the next census. Validation: count regression red on baseline (2 SELECTs and BEGIN/COMMIT), all 17 scratch-store tests green on the candidate; two isolated Codex P0–P2 reviews scoped-clean. The existing two-engine conformance test passed on actual SQLite and PostgreSQL 17, with catalog/trigger parity and cleanup verified. Test cost: scratch cases totaled 6.528 s (125.95 s file duration, mostly transform); the two engine cases totaled 1.846 s (260.62 s file duration, mostly transform). The candidate build and official source-freshness check passed at measured runtime head 93a6c4d; the three-sample invocation completed with the shutdown limitation above. Exact-head CI run 40176443806 completed successfully: 39 successful jobs, 26 skipped, no failures, including all three actual PostgreSQL shards, production/test types, lint, source contracts, Madge, and worker/T1/dialect ratchets. The earlier run passed types, lint and source contracts but found a worker-inventory omission: the new direct query was conservatively labeled T1. Head a187ecf corrects only inventory metadata and regenerates its snapshot: the worker snapshot and its private heartbeat helper are W, while the native Doctor reader stays T3. No runtime or SQL change is involved. The generated snapshot also catches up existing main classifications; targeted script lint and formatting pass. The two production reviews remain valid; this tooling-only correction adds no production review round. PG review approved the semantics at 68c24c4, and the coordinator explicitly carried REVIEW-OK to 93a6c4d because only benchmark TypeScript annotations changed. Candidate counts and the inherited-shutdown disposition are recorded; the corrected head’s CI and all three PG shards passed. The test-only import relocation avoids another open PR's adjacent import change; production bytes remain identical to both isolated reviews and database proof. The benchmark annotations fix CI TS7022 without changing emitted behavior. Final-head overlap at a187ecf: complete shared-index base-versus-candidate merge-tree comparison covers 21 peers (openclaw#183410, openclaw#183285, openclaw#181057, openclaw#180871, openclaw#180286, openclaw#180139, openclaw#169241, openclaw#168956, openclaw#168615, openclaw#167546, openclaw#167471, openclaw#165039, openclaw#161997, openclaw#157922, openclaw#157693, openclaw#156613, openclaw#141004, openclaw#137788, openclaw#136476, openclaw#129388, openclaw#121204). No new source conflict paths, regions or messages. Six peers (openclaw#181057, openclaw#180871, openclaw#180139, openclaw#169241, openclaw#129388, openclaw#121204) have added or changed conflicts confined to the fully generated worker inventory. The coordinator explicitly accepted this class because main's snapshot was stale and generated outputs must be regenerated, not hand-edited. The same exact-head disposition carries PG REVIEW-OK because runtime bytes are unchanged. Exact-head CI and all three PostgreSQL shards passed. PG checklist: (1) read-only; existing writer transaction/advisory-lock, DML/conflict and cross-store commit ordering unchanged. (2) At most one joined row via the existing composite primary keys, original job fields plus four scratch fields, unchanged 256 KiB scratch write bound. (3) No cache/generation or invalidation change; one statement snapshot, existing outer PG read transaction retained. (4) No schema/admission/identity/retry/probe change. (5) Same worker owner, one request, no MAIN expansion; target 4→1 SQL in all three real Gateway runs, with the inherited shutdown failure disclosed above. (6) Actual PostgreSQL 17 and SQLite owner conformance passed; all three final-head PostgreSQL CI shards and the other selected static checks passed. Knip was run separately because ordinary PR CI excludes it. The canonical candidate export scan failed with 26 script, 20 production and 16 full-tree findings; none is in a changed file. All 62 occurrences (52 unique file/symbol pairs), scanner/config/compiler inputs and package inputs are unchanged from merge-base 71bc695. The only removed imports, runSqliteReadSnapshotSync and loadCronRows, both retain multiple real production consumers. Current-main diagnostic sections reported 14 script and 7 production findings; main has already repaired 40 candidate occurrences in unrelated changes. Its separate full-tree scan was intentionally stopped after the coordinator accepted the source-attributed inherited findings; it is not a passing full-main scan. No ignored exports, baselines or unrelated code were changed. The failed candidate scan is explicitly accepted as inherited; all branch changes and selected CI static checks pass. Pre-merge shared-index refresh retains 17 open peers from that audit. Only openclaw#180871 moved (f140f16); its fresh base-versus-candidate comparison still adds conflicts solely in the generated worker inventory, within the coordinator-accepted class. No new source conflicts. Co-authored-by: Peter Steinberger <[email protected]>
Preserve main lifecycle notifications, agent recovery readiness, and proxy probe policy while retaining cleanup isolation and diagnostic proof. Adapt native lease fault injection to DELETE RETURNING and the HTTP fixture to the current readiness contract.
Integrate current main while retaining its detached async root for idle cleanup and restart drain. Preserve the unchanged cleanup-isolation patch and its resource-owned diagnostic reporting.
|
Additional scoped runtime observation (2026-11-02), possibly useful for #157325 / this PR. Environment: Linux, Node24.22.1, a locally modified2026.10.10-beta.5 installation with multiple prior backports. This is not an unmodified release/current-main reproduction. Before the admission stall, logs recorded a transaction on the shared state DB labeled
Separately, a private regression using the installed compiled Is there an existing follow-up specifically covering shared-state BEGIN contention during agent cleanup/preparation and the resulting peer admission invalidation? |
Related: #157325. Builds on merged same-owner cleanup recovery in #159451 and preserves the earlier #157064 contributor history.
What Problem This Solves
When one agent's idle database cleanup fails, a healthy agent can lose its warm database capacity too. Operators also lack protected cleanup diagnostics that explain the failure and next repair step.
User Impact
Healthy agents keep reusable database capacity while the failed owner retains its generation and lease custody. Detailed readiness reports the native failure under the active redaction policy without making an otherwise healthy Gateway unready.
No schema, migration, retention, durability, or permission change is introduced. Do not delete database or lease files to clear the diagnostic. The original Windows/Linux outage trigger remains unidentified: this fixes cleanup isolation and diagnostics, not that initiating platform fault.
Why This Change Was Made
Main already contains worker-error hydration, worker-slot failure settlement, and same-owner recovery. The remaining fix frees a failed owner's reusable idle slot, not its cleanup custody. It projects current owner-held diagnostics through the existing readiness owner; revoked owners retain restart-only guidance. Raw errors remain with the cleanup owner rather than caching policy-dependent text.
The changed-PR CI adjustment isolates process-heavy system-runtime children at their existing two-worker ceiling without serializing unrelated siblings. Already-serial hosted rows retain their original worker allocation and timing identity. Extracted children return through the canonical packing owner; unrelated siblings retain their shared parallel envelope. Coverage, row budgets, and unique check identities are preserved. Full-plan defaults, worker-envelope normalization, and volume preparation remain unchanged.
Evidence
58a3e19e9a61, the capacity regression expects only failed ownerfirstto close but also observes healthyfifthclosing (37 ms case; 39.07 s cold command wall). The repaired idle suite passes. Later integrated maine25ad96fb3d62c9934f4be4797b1a5e4cbcb4fc3only changes completed absent-file retirement in this owner; its retained/released first-session regressions are preserved and pass.83ca4232ccafc6b2f10837974ac6a4c6b971ca8fpreserves previous PR heade87adcc0d01296ed8218aa9b9a78635885cfdf7dand the pinned main above without rewriting history. It retains main's accepted-work/lifetime, physical-file identity, error-stack materialization, startup-worker handling, reader-before-executor shutdown, prepared readiness, and agent-deletion diagnostics. Retired pending-agent readiness is not restored.ERR_SQLITE_ERROR/errcode=5; its retained error flows through the production readiness checker and a listening Gateway HTTP server, using a claimed loopback port and a realfetchclient. A configured trusted-proxy identity exercises authenticated detail and unauthenticated remote aggregation over TCP. The endpoint includeserrcode=5, masks the synthetic bearer value, and immediately masks an additional canary afterapplyLoggingConfigpublishes a new rule. The isolated listener is not the operator's live Gateway, a model-run proof, or a platform-outage reproduction.e25ad96fb3d62c9934f4be4797b1a5e4cbcb4fc3→83ca4232ccafc6b2f10837974ac6a4c6b971ca8f: no findings; patch correct, security cleared, and real-behavior proof sufficient. Prior P2 redaction/native-code and CI-planner findings have red-before/green-after proof. An earlier P3 suggestion to avoid optional diagnostic formatting on aggregate probes is deferred: this repair preserves the shared prepared-readiness contract, and no latency failure was demonstrated. Broad-selection headroom under the 130-row matrix cap was not measured locally; exact-head CI owns broad coverage.83ca4232ccafc6b2f10837974ac6a4c6b971ca8fand in progress; no current-head green gate is claimed. Older passing or failed runs do not qualify this head. The PR remains unmerged with auto-merge off; no native preparation or merge admission is claimed, and the retained tooling-state incompatibility was not bypassed.Listening HTTP terminal capture — synthetic fixture data only
A real client receives the retained worker error through the listener. The before-request sees the controlled canary; after the logging owner applies the new rule, detailed output masks it and still includes the native result code. The unauthenticated remote identity is supplied through an explicitly trusted loopback proxy. No response or auth value is fabricated in this capture; listener addresses and ports are omitted.
{ "before": { "status": 200, "canaryVisible": true }, "after": { "status": 200, "body": { "ready": true, "coreReady": true, "failing": [], "uptimeMs": 144, "agentCleanup": [ { "agentId": "first", "reason": "Agent database cleanup failed | controlled idle worker lease failure; cleanu…vate; Authorization: Bearer synthe…cret | ERR_SQLITE_ERROR | controlled lease release refused (code=ERR_SQLITE_ERROR, errcode=5)", "repairHint": "Idle cleanup retries on this agent's next request. If cleanup remains blocked, restart the Gateway; do not delete its database or lease." } ] } }, "unauthenticatedRemote": { "status": 200, "body": { "ready": true } } }Test cost and scope
The recorded changed-owner run passes 219 cases in 156.20 s command wall: idle shard 1.76 s, existing full planner file 98.05 s, readiness/HTTP 6.85 s, and real-worker/HTTP fault shard 8.67 s (3.809 s fault case). The remaining 46 lifecycle/creation cases pass in 77.70 s command wall (45.42 s test shard). Before the final CI-only repair, the uninstrumented replay passes all four affected cases (three planner and one real-worker/listening-HTTP case) in 19.76 s command wall; its real-worker case takes 4.218 s. The separate terminal capture passes in 14.26 s command wall (3.853 s fault case); temporary console instrumentation was removed before commit. After the final CI-only repair, all three affected planner cases (including both two-/three-group variants) pass in 4.12 s wrapper time; both script and tooling-test types, scoped lint/format, and the +398/400 test-line guard pass again.
The lease, recovery, physical-creation, and real-error-to-HTTP contracts need real workers and storage; helper mocks cannot prove them. The added planner assertions and HTTP flow reuse existing fixtures. Local worker preparation and targeted checks are not a complete package build; exact-head CI owns broad coverage. Earlier finalization and SPA-fixture timeouts remain historical unexplained failures, not claimed fixes.
Residual scope against the pinned main: 16 files, +546/−39. Cached formatted cleanup text and duplicate diagnostic dispatch are removed; there is no new lifecycle, storage, or retry owner.
Contributor credit: requested by @RomneyDa for the release-blocking outage; thanks to @desksk and @PashaGanson for the Windows/Linux reports. Worked on by @RomneyDa.
Work session: https://team.openclaw.ai/chat/roboclaw/dashboard/68c9aa3c-c787-440d-be5f-66ec9dd1706e