Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 6:29 AM ET / 10:29 UTC. ClawSweeper reviewWhat this changesThe PR makes secrets CLI failures emit the canonical JSON error envelope on stdout when Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open. The PR repairs a current scripting defect with one shared output owner; no introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe secrets CLI invokes local store operations or Gateway-backed secret operations, then emits human text or script-consumable JSON. Its output path determines what automation receives before the process exits. flowchart LR
A[Operator or script] --> B[Secrets CLI command]
B --> C[Local store or Gateway operation]
C --> D[Success or failure result]
D --> E[Human text or JSON output]
E --> F[Drained output and exit status]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +47, Tests +178. Total +225 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one secrets-result owner for all JSON-capable commands, preserving command-specific human diagnostics and their existing exit semantics. Do we have a high-confidence way to reproduce the issue? Yes—high-confidence source reproduction is available with Is this the best way to solve the issue? Yes. A shared result owner fixes the split success/failure handling at the output boundary while preserving each command’s existing human rendering and exit code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a244b3a2c246. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
Thanks @qingminglong! Proof:
|
## What Problem This Solves `openclaw secrets ... --json` wrote plain-text terminal errors for command failures. Scripts received no JSON document on stdout. The same defect also affected `secrets store list/get --json`. Valid `secrets audit --check --json` reports could be caught as operational failures in non-exiting runtimes. ## Root Cause Each secrets command owned success and failure output separately. The store commands had another failure owner. Audit performed its nonzero result exit inside the operational catch. ## Fix - Route secrets JSON success and failure through one result owner. - Reuse the canonical sanitized CLI failure envelope. - Exit only after the selected result is written and stdout can drain. - Preserve human output and documented exit codes, including audit exits `1` and `2` and store-get exit `3`. - Cover `reload`, `audit`, `configure`, `apply`, and store `list/get`. No secret values are added to failures. No configuration, persistence schema, or security policy changes. ## Evidence - Current main `ab2638c77e2754fa17df299b0730b99944bd0be2`: missing-plan apply exited `1`, wrote empty stdout, and wrote plain text to stderr. - Anti-cheat: changing the missing plan path changed the plain-text terminal failure. - Exact head `980a5f9be0c40943bf52f38942fcdcc6ffbecc5a`: missing-plan apply exits `1` with one parsed JSON failure and empty stderr. - Exact head: missing store get exits `3` with one parsed JSON failure and empty stderr. - Exact head: empty store list exits `0` with one parsed JSON array and empty stderr. - Human apply and store failures keep their prior text and exit codes. - Regression tests fail eight cases on the recorded baseline and pass 43/43 on the repaired source. - Focused formatting, lint, assertion-safety, dead-export, import-cycle, coercion, deprecated-API, and diff checks pass. ## Review Note The ClawSweeper rank-up move is applied: the repeated mode guards were replaced with one result owner. Production growth creates that owner and covers the previously omitted store commands and audit outcome sequencing. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
openclaw secrets ... --jsonwrote plain-text terminal errors for command failures. Scripts received no JSON document on stdout.The same defect also affected
secrets store list/get --json. Validsecrets audit --check --jsonreports could be caught as operational failures in non-exiting runtimes.Root Cause
Each secrets command owned success and failure output separately. The store commands had another failure owner. Audit performed its nonzero result exit inside the operational catch.
Fix
1and2and store-get exit3.reload,audit,configure,apply, and storelist/get.No secret values are added to failures. No configuration, persistence schema, or security policy changes.
Evidence
0f553a2d60752dbc739812e4dcad92f3cf5281de: missing-plan apply exited1, wrote empty stdout, and wrote plain text to stderr.980a5f9be0c40943bf52f38942fcdcc6ffbecc5a: missing-plan apply exits1with one parsed JSON failure and empty stderr.3with one parsed JSON failure and empty stderr.0with one parsed JSON array and empty stderr.Review Note
The ClawSweeper rank-up move is applied: the repeated mode guards were replaced with one result owner. Production growth creates that owner and covers the previously omitted store commands and audit outcome sequencing.