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: needs real behavior proof before merge. What this changesThis PR scales the metadata inventory worker’s stdout limit with its serialized input and adds a large-inventory regression test. Example: Inventory 12,000 existing database paths on Windows 11 with Node 26.12.1.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains This PR provides a focused repair for a current-main inventory failure; the competing proposals do not yet establish a safely landable replacement. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe updater sends database paths to an isolated metadata worker, receives JSON containing paths and SQLite-family sizes, and uses those measurements for backup and schema inspection. flowchart TD
A[Update capture] --> B[Database path inventory]
B --> C[Metadata inventory launcher]
C --> D[Isolated filesystem worker]
D --> E[Bounded JSON result]
E --> F[Backup and schema inspection]
Technical reviewBest possible solution: Keep the input-derived bound in the existing inventory owner and describe this PR as a partial repair until the complete capture path is verified. Do we have a high-confidence way to reproduce the issue? Yes: enough existing long-path entries deterministically exceed current main’s fixed cap, and the contributor supplies matching base-versus-fix production-function output; this read-only review executed no target code. Is this the best way to solve the issue? The serialized-input budget is a small, sound repair for this worker’s result-size mismatch, but sibling discovery and backup receipts retain separate limits that can still prevent large captures from sealing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f833e0723294. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests +12. Total +16 across 2 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 Reviewed October 30, 2026, 9:30 PM ET / October 31, 2026, 01:30 UTC. |
|
On the requested shipped-CLI proof, here is what I found while trying to set it up. I'm asking whether the current evidence is enough, rather than requesting a re-review.
What the PR proves today:
If a maintainer can point to a state shape or harness that drives the original-state capture with a large declared resource tree, I'll run it on this branch and attach the sealed-manifest result. Otherwise I'd suggest treating the function-level A/B as the evidence for this cap change. |
Fixes #188897
Note: #188907 was opened while this was in progress; at the time of writing it contains only a planned
it.todo. This PR has the implementation, the failing-then-passing regression and a live A/B run.What Problem This Solves
The update capture measures every state database through
readUpdateStateDatabaseSizes(). That function sends the path list to theupdateStateSizeschild process and reads back one JSON array. The child's stdout was capped at a fixed 1 MiB withterminateOnOutputLimit. Each result entry repeats its path, so the cap is reached after roughly 6,000 to 7,000 databases (fewer when paths are long). The child is then killed withoutput-limitand the capture is never sealed. The reporter has about 640,000 inventory paths and 4 of 4 retained capturesincomplete("no sealed manifest is available").User Impact
Long-lived installs with many agent databases get a sealed recovery set again, instead of an update that succeeds with no usable rollback capture.
Why This Change Was Made
The child's output is derived from its input: one entry per existing path, holding that same path plus a decimal
sizeBytes. So the stdout cap is now computed from the request: input JSON bytes, plus 64 bytes per path for the size field and punctuation, plus 1 MiB of slack. This keeps output bounded (a misbehaving child still hitsoutput-limit) without making the bound a fixed count that scales the wrong way. The child script, the timeout budget and the progress channel (stderr) are unchanged.Not addressed here: the reporter's very large inventories still pass every path through one child request and one parsed array. That works at the measured sizes, but chunking could be a follow-up if maintainers prefer it.
Evidence
Production
readUpdateStateDatabaseSizes()with the realupdateStateSizeschild process, on Windows 11 / Node 26.12.1.<state>/agents/agent-NNNNNN/agent/openclaw-agent.sqlite) created on disk.src/infra/update-candidate-state.sizes.tsdiffers between main 2908f7a and this branch.output-limit: "State schema inventory failed (output-limit): Worker output exceeded its capture limit" (1.2 s)output-limit(2.6 s)The regression is a new case in
src/infra/update-candidate-state.budget.test.ts, "inventories more paths than a fixed 1 MiB result would hold". It inventories 12,000 paths through the real child.output-limitthe reporter saw.Command:
node scripts/run-vitest.mjs run src/infra/update-candidate-state.budget.test.ts -t "inventor".Gates run locally: oxfmt, oxlint,
pnpm check:line-cap-ratchet,pnpm check:test-lines-ratchet. Not run: a fullopenclaw updateon a large real state directory. The proof calls the inventory step directly.