Repository navigation
fix(claws): keep update JSON output parseable - #124130
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:27 AM ET / 09:27 UTC. ClawSweeper reviewWhat this changesThe PR passes a log-muted runtime through Claws update package installation in JSON mode so stdout contains only the final update document. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this maintainer-owned PR open: it fixes a source-proven JSON-output regression through the existing package-lifecycle runtime path, with no blocking patch finding. Exact-head CI is still in progress before landing. Priority: P2 Review scores
Verification
How this fits togetherThe Claws CLI turns an update request into an update plan and then invokes shared package lifecycle code. Package installation can emit progress logs, while JSON mode must reserve stdout for one machine-readable result. flowchart LR
A[Operator runs JSON update] --> B[Claws update command]
B --> C[Update lifecycle]
C --> D[Package installer]
D --> E[Runtime output routing]
E --> F[One JSON result on stdout]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +10. Total +15 across 4 files. View PR surface stats
Review metrics
Merge-risk options
Maintainer options:
Technical reviewBest possible solution: Land the existing runtime propagation once exact-head CI is green; it is the smallest canonical extension of the add-command output boundary and preserves interactive installer guidance. Do we have a high-confidence way to reproduce the issue? Yes. On current main, update package installation reaches an installer that defaults to process runtime logging before the command writes its JSON result; the submitted regression test models that exact path. Is this the best way to solve the issue? Yes. Passing the JSON-muted runtime through the existing update options chain matches the established Claws add path and fixes the output owner rather than filtering stdout after the fact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 30216f52fabe. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper before-merge items are addressed:
No |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where operators running
openclaw claws update --jsoncould receive plugin installer progress and restart messages before the update result, making stdout contain multiple values instead of one parseable JSON document.Why This Change Was Made
The Claw update CLI now carries its runtime through the update and package lifecycle owners, using a log-muted runtime only for JSON mode. Human-readable updates keep the original runtime, so experimental, installer, warning, restart, and completion messages remain visible.
The root cause was that update did not pass the runtime that
claws addalready uses for the same nested package installer. The installer therefore fell back to the process default stdout runtime.Production LOC: +5/-0. Tests: +10/-0.
This is deliberately limited to update output. It does not change config shape, files or provenance semantics, rollback or compensation, package trust or security policy, schemas, protocols, the Plugin SDK, dependencies, or release behavior. The analogous remove-side nested-uninstall logging path is excluded from this PR and remains a separate follow-up.
User Impact
openclaw claws update --jsonnow emits exactly one JSON document on stdout even when the update installs a plugin package. Scripts can parse the result reliably, while interactive users retain the existing human-readable installer and restart guidance.Evidence
src/cli/claws-cli.test.tsreported 35 passing tests and one expected failure because stdout contained the installer line plus JSON. Restoring the candidate produced 36/36 passing tests.b289ad98b6fe5287a525e6c9ebd8f3b78f45de5a: format, core and test types, lint with zero warnings/errors, import cycles, and selected guards.HOME, config, and state roots. JSON update exited 0 with exactly one stdout JSON document and empty stderr; config, installed files, and SQLite-backed Claw provenance were present; cleanup completed.origin/main: no accepted or actionable findings.