Repository navigation
refactor(cli): centralize daemon action output - #150047
Conversation
Keep generic result emission JSON-only and route message-bearing successes through the action context. Bind install warnings once in the shared install context while preserving warning order and lifecycle exception boundaries. Characterize human and JSON output through the existing response owners, including foreground restart health ordering and install warning behavior.
|
🦞👀 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. Reviewed September 22, 2026, 6:53 AM ET / 10:53 UTC (Revision 8). ClawSweeper reviewWhat this changesCentralizes Gateway and node service success messages and install warnings in existing CLI helpers while preserving text, JSON output, warning order, and exit behavior. Merge readiness✅ Ready for maintainer review Keep open as useful, maintainer-owned cleanup that current main has not incorporated. No introduced correctness or security defect was found. Priority: P3 Review scores
Verification
How this fits togetherGateway and node service commands pass installation and lifecycle results to shared CLI response helpers. These helpers produce human-readable messages or machine-readable JSON after the existing service and health checks. flowchart TD
A[Gateway and node commands] --> B[Service lifecycle operations]
B --> C[Existing verification and health checks]
C --> D[Shared action context]
E[Install warnings] --> D
D --> F[Human-readable output]
D --> G[JSON response and exit status]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -37, Tests +948. Total +911 across 13 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep output policy in the existing action context while service, readiness, and update owners retain their current responsibilities. Do we have a high-confidence way to reproduce the issue? Not applicable: this refactor reports no broken user behavior; source comparison and characterization tests address preservation of existing output. Is this the best way to solve the issue? Yes: moving repeated emission rules into the existing response owner is a narrow consolidation, and the inspected callers preserve their exception and health-check boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 45ba3419d63e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review Please refresh the review for unchanged head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Preserve daemon action JSON and human output ownership, including current backup and rebind receipts, readiness exit codes, and runtime pin contracts. Related: #150047.
|
Merged via squash.
|
* refactor(cli): centralize daemon action output Keep generic result emission JSON-only and route message-bearing successes through the action context. Bind install warnings once in the shared install context while preserving warning order and lifecycle exception boundaries. Characterize human and JSON output through the existing response owners, including foreground restart health ordering and install warning behavior. * test(daemon): isolate install warning inventory * chore: merge main into daemon output cleanup * chore: merge main into daemon output cleanup Preserve daemon action JSON and human output ownership, including current backup and rebind receipts, readiness exit codes, and runtime pin contracts. Related: openclaw#150047. * test(cli): update daemon restart output fixture * chore(cli): integrate current main for daemon output validation * chore: merge main config reload and wrapper repairs Integrate canonical main 2a74f33, including config include publication fix fda6f32 and wrapper import-closure fix 91a6617. Preserve the published PR ancestry and byte-identical daemon output patch. * chore: merge main pairing fixture repair Integrate canonical main 860100a with SSH pairing fixture fix fadc546 and the reviewed updater owner changes from openclaw#153764. Preserve the published PR ancestry and byte-identical daemon output patch. Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Daemon service commands repeat human-readable success and install-warning rules across callers.
User Impact
No intended behavior change: CLI text, JSON output, warning order, and exit codes remain unchanged.
Why This Change Was Made
Explicit success messages now come from the existing daemon action context, and the install context owns warning accumulation. This removes 37 net production lines across six modules.
Generic emission remains JSON-only. Empty and duplicate warnings, order, failure handling, lazy definition-backup lookup, emission-time rebind receipts, and restart health ordering are preserved. Standalone
still-startingretains exit 2; updaterrestart-health-failedretains exit 1. Runtime pins, definition repair, readiness, and update authority keep their existing owners.Evidence
CI 35717734554 passed on reviewed head
5c9d0a3767ddd297cda450ea234de5aec47dbaa5, attempt 1: 120 successful jobs, 17 skips, and both required CI-gate surfaces green. Checkout logs bind the tests to mergec9c233acd7d31d15c3fb5fbb61d6d9b43ca24de9with actual main parent771a42dab0edefd4cc09fde1d7bb4728d38560f4; all 13 PR files and 47 recorded output/service inputs match. All 116 changed-file cases passed without skips. Their reported CI case-duration sums were response 0.028 s, lifecycle output 0.053 s, install output 2.075 s, external supervision 0.027 s, Gateway owner 0.351 s, and node daemon 0.579 s; these exclude shared import/transform/setup/teardown overhead. The full CLI lane passed 9,077 cases with 51 existing skips in 301.78 s command wall.Both formerly failing cases are now directly verified with their canonical fixes incorporated: included-config reload passed in 1.306 s (995 cases in its current group), and SSH key-match pairing passed in 0.497 s (795 cases in its auth/node group). Their earlier failures and diagnostic limits remain historical evidence. ClawSweeper reviewed this exact head with no correctness/security findings or before-merge items. This CI result adds no claim of a new packaged-update execution or native cross-platform proof; the separately qualified earlier output and updater-owner evidence retains its original source, driver, and schema-observation limits.
The sealed integration is
5c9d0a3767ddd297cda450ea234de5aec47dbaa5, a normal merge of canonical mainca97ceb8f9bd712205da7fef9c65eb99c5cc6f45into published head35febf3aa058660b2aed25313eceaf85a84769b2. Original PR ancestry is preserved. All 13 PR files and all 47 recorded output/service proof inputs remain unchanged from the preceding integration. The output patch is byte-identical to the independently reviewed checkpoint310fdf0b40f1b67377db560806cc2a306a084d9f.7e59fc0a92e653f7ba24a6ff49470207febc2ed7passed the genuine published 2026.9.5 first-hop lane in 735.360 s: canonical package build, integrity checks, and both positive update hops. Both recorded fresh Doctor-finalize workers exited 0, the expected build reachedreadyzand settled status, and no plugin errors or transaction residue remained. This result qualifies the unchanged output contract; no package built from the latest integration has been executed.The first baseline run exposed a stale restart fixture: loaded native restarts supplied no installed command, and the mock omitted two current restart-intent exports. The existing fixture now supplies those values for loaded rows; unloaded/recovery rows still return null. No assertions, cases, ordering, deadlines, or production behavior were weakened. The full 28-case fixture then passed on both sides.
Measured test cost
These are isolated Testbox command-wall seconds for
pnpm test <file> --maxWorkers=1 --reporter=json --outputFile <report>. Baseline totals 192.938 s, including the reused 2.044 s response result; candidate totals 206.315 s. They characterize behavior and test cost, not a speedup.src/cli/daemon-cli/response.test.tssrc/cli/daemon-cli/lifecycle-core.output.test.tssrc/cli/daemon-cli/install.output.integration.test.tssrc/cli/daemon-cli/lifecycle.external-supervision.test.tssrc/cli/daemon-cli/lifecycle.gateway-owner.test.tssrc/cli/node-cli/daemon.test.tssrc/cli/daemon-cli/lifecycle-readiness.test.tssrc/cli/daemon-cli/install.definition-repair.test.tssrc/cli/daemon-cli/install.reinstall.test.tssrc/cli/update-cli/update-command-service-command.test.tssrc/daemon/runtime-pin-state.test.tssrc/daemon/runtime-pin-service.test.tssrc/daemon/service-rebind.test.tssrc/cli/daemon-cli/register-service-commands.test.tssrc/cli/node-cli/register.test.tsHosted CI and canonical fixture repairs
CI 35712514357, attempt 1, tested published
35febf3through mergea6115dace71c4aa687118537fe8f35aa7a2edbd7, whose actual main parent was41f119f66004c2944a79e1aaede0bc77dd35c4d2. Checkout logs and immutable commit metadata agree.All 116 changed-file cases passed, with no skips. The complete CLI lane passed 9,044 cases with 51 existing skips: 303.69 s command wall and 359 s job wall. Summed per-file CI case durations were response 0.024 s, lifecycle output 0.144 s, install output 2.511 s, external supervision 0.042 s, Gateway owner 1.238 s, and node daemon 0.583 s. These sums exclude shared import/transform/setup/teardown overhead.
That run remains failed: 118 jobs succeeded, 17 were skipped, and one SSH-pairing shard plus the aggregate gate failed.
server.node-pairing-ssh-verify.test.ts:178expected the first connect to be rejected, but its immediate mocked approval had already landed. The group passed 794 other cases. Canonical main fixf87f23c483b4c5130f42f2451f0b03e36ea0effe, now incorporated, holds the existing deferred probe until pending/retry-hint assertions finish, then preserves the persisted approval, second handshake, and capability assertions. Its owner reproduced the original full-file order and passed 50 focused cases in 119.25 s, lint, and independent review. Runtime logic and deadlines are unchanged. No blind CI retry was requested.The earlier CI 35698558705 failed in the included-config reload fixture. Its bounded diagnostic passed but did not explain the failure. Canonical
97e9ce9bf66609a4c0667aa59f67d6206e95c543later reproduced the assertion's five-second deadline expiring behind the real lifecycle lease and repaired it by awaiting the existing publication signal while preserving the exact-once callback check. The actual named case passed in 1.374 s in the newer CI run; its current hosted-7 group passed 995 cases. The group moved fromlarge-18tolarge-19, so this statement is bound to the explicit case, not the old job number. Both original failures and diagnostic limitations remain retained.ClawSweeper's exact
35febf3review reported no correctness/security findings or before-merge items. Fresh-head CI and native maintainer gates passed for5c9d0a3; the PR landed as05a0b7be36e7f53d4bf12c4d9672e9fc0a0ef635.Inherited updater changes and proof limits
This PR authors no schema, configuration, or updater-policy change. Current main declares state/agent schemas 18/23. Earlier inherited Doctor/cache/parser changes retain their source-bound owner proof. Retained-deletion fixtures were absent from the prior standard update cell, which is not presented as coverage of those separate branches.
The latest integration includes #153764, which preserves structured update failures and the running updater's worker generation during replacement. All 64 of that owner's source/test paths match its exact tested candidate
f4291a7463b6dc2d1320174b591ed6d31fd59b19; the 65th path is a wrapper manifest whose only additional line is the already repaired SQLite maintenance-cache import. The nearby coordinator change6110505e6d47adds lifecycle-owned idle-pool cleanup while preserving scoped disposal and checked-out custody, with its own failing control, repeated owner tests, changed checks, and review. Worker URL capture, reply settlement, native exit callbacks, and the direct service-child output caller receive no change from this PR.The updater owner's canonical compiled package passed generation retention across distribution replacement, synthetic pressure/reopening, prepared reads, accepted-write drainage, restoration, and the actual sealed service-child registration entrypoint. This is Linux/Node proof with synthetic pressure, not OOM or cross-platform proof. Its optional-fetch negative control produced exactly the two intended stale-branch failures while both tag controls passed; source/runtime were restored.
A genuine published 2026.9.2 driver updated to that exact owner package and exited 0. Native service readiness, unchanged session metadata, both transcript messages, and agent schema 19→23 were recorded. The overall initial qualification remains failed: its immediate
PRAGMA user_versioncheck expected 18 but observed 15. A separate read-only observation on the same database inode and serving process confirmed content schema 18 was recorded before terminal update success, then both published markers reached 18 after the existing five-minute publication delay. The updater was not replayed; service cleanup and lease release were verified. The package's version is 2026.9.5; it was not a published-2026.9.5 driver cell, and no such cell is claimed forf429or this latest head.The retained prior-head 2026.9.5 output/update cell uses a systemctl shim launching the real Gateway, not native systemd/macOS/Windows proof. Its first-hop fixture changes version/inventory metadata; the second also removes legacy compatibility chunks. Healthy activation can avoid the restart path, so paired tests separately cover restart/node output and serialization. No direct persisted-schema snapshot or deterministic 9.5 missing-chunk negative control was retained. The source, artifact hashes, command receipts, and cleanup evidence remain separate from fresh-head CI and enforced merge gates.