Repository navigation
fix(memory): emit one JSON result for command failures - #147366
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: blocked before merge. Reviewed September 13, 2026, 5:11 PM ET / 21:11 UTC (Revision 3). ClawSweeper reviewWhat this changesMemory commands now send execution failures through the shared CLI JSON formatter, finish historical scratch cleanup before reporting success, and register the integration test’s runtime-build prerequisite. Merge readiness⛔ Blocked before merge - 1 item remains This PR remains useful: current main still contains the reported failure paths, and no actionable patch defect was found. The previous migration-proof blocker is inapplicable because stored formats, storage writers, and their arguments remain unchanged. Priority: P2 Review scores
Verification
How this fits togetherThe Memory Core plugin handles CLI requests to search, inspect, and manage agent memory. Its command handlers pass failures to the root CLI, which produces machine-readable stdout and human-readable stderr. flowchart TD
A[Memory CLI request] --> B[Validate input and acquire backend]
B --> C[Run memory operation]
C --> D[Finish historical scratch cleanup]
D --> E[Publish success JSON]
B -->|Failure| F[Root CLI error formatter]
C -->|Failure| F
D -->|Failure| F
F --> G[One error JSON and stderr diagnostics]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -56, Tests +614, Docs +4, Other +2. Total +564 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the root CLI as the failure-output owner and publish historical command results only after fallible scratch cleanup settles. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a clear path: current-main Is this the best way to solve the issue? Yes. Reusing the existing error formatter and consolidating scratch ownership repairs the output contract without introducing another formatter, plugin API, or storage migration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8fd2838b57cf. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…1-prep * commit '912ae8d96e5964dfdcdf419b79613fb941cdf0a8': (350 commits) fix: keep workspace preparation responsive during cleanup (openclaw#147358) docs: alphabetize donors and sponsors and add Red Hat logo (openclaw#147302) fix(plugins): retain update authority through doctor effects (openclaw#144316) refactor(qa): share Multipass mount retry lifecycle (openclaw#147084) fix(memory): emit one JSON result for command failures (openclaw#147366) improve(plugins): speed up cold metadata loading (openclaw#147411) fix(sessions): avoid duplicate work after waited child replies (openclaw#147394) fix(agents): retain outstanding child results in parent context (openclaw#112623) test: preserve native workflow loader selection (openclaw#147403) fix: reduce repeated work while polling session pull requests (openclaw#147373) test(qa): preserve task cancellation across process replacement (openclaw#147382) fix: prevent sidebar refresh storms during session activity (openclaw#147400) refactor: simplify skills CLI formatting (openclaw#147368) fix: prevent Git checkout certificate failures behind egress proxy (openclaw#147410) fix(qa): stop live threads after their process leader exits (openclaw#147386) refactor(release): share agent turn retry lifecycle (openclaw#147076) fix(ui): keep uploaded images aligned with their prompts (openclaw#147389) fix(fs): guard skill reads and bound worker bundle staging (openclaw#147336) fix(ci): restore Linux service ownership fixtures (openclaw#147398) fix(plugins): preserve manifest permissions when building plugins (openclaw#147393) ...
* fix(memory): emit one JSON result for command failures * test(memory): prepare the SDK before root CLI integration tests
What Problem This Solves
Memory commands can exit with empty JSON output after invalid input or an execution error. Historical REM commands can also print success before temporary-workspace cleanup fails, producing two JSON documents.
User Impact
Scripts receive one standard CLI error document and exit code 1 for terminal command failures. Successful results and the existing disabled/backend-acquisition responses retain their shapes. Human-readable diagnostics remain on stderr.
Why This Change Was Made
Command execution now passes failures to the existing root CLI error owner. Historical scratch ownership covers preparation through awaited cleanup, and the command publishes success only after that scope completes. Contextual errors preserve their original causes. This removes duplicated error handling and reduces production code by 56 lines. The required test-build declaration adds two tooling lines, for a combined reduction of 54.
The change leaves memory storage, migrations, manager acquisition, nonfatal manager-close diagnostics, aggregate status, and human-only multi-agent indexing unchanged. It extends the execution boundary; #140229 covered backend acquisition before command work begins.
Evidence
Native proof uses local simulated embeddings, not hosted inference. Filesystem cleanup faults are covered by deterministic tests. Historical native proof verifies diary readback and reported short-term counters; it does not independently verify short-term-store rollback completeness. Source validation was performed on
bc183cbbf7a387e9cea8991a2da539b92a0a70b2plus this patch. Exact-head hosted CI is required before landing.Data compatibility
The review’s generated data-model checklist is not applicable to this patch. The full diff changes no schema, version, migration, stored representation, retention rule, or storage writer.
dreaming-dreams-file.ts,short-term-promotion.ts,session-backfill.ts,memory-forget.ts, the acquisition owner, and the root failure formatter have identical Git blobs between the base and this PR. Their existing operations and arguments are retained; only command error propagation and the temporary scratch scope change. Successful JSON fields and disabled/acquisition envelopes are unchanged and covered by the passing controls. No upgrade migration or operator action is needed. This does not claim transactional rollback across historical diary and short-term writes; those existing semantics remain unchanged.Clean-checkout CI verification
The first hosted run exposed a missing prerequisite in the new integration test: native plugin loading needs the built JavaScript SDK, which the local built checkout already had. A source-only checkout reproduced all three failures. Declaring this test in the existing runtime-consumer registry now makes the ordinary runner build the runtime before workers start. The original test and its assertions remain unchanged. The automatic build and all three cases pass; 112 prerequisite-routing cases, two CI partition checks, the complete two-file changed gate and fresh scoped P0–P2 review also pass. The initial failed hosted run is retained; this correction requires a fresh green exact-head run before landing.