Repository navigation
fix(cli): redact sessionKey from starter CLI JSON output - #8
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 maintainer review before merge. Reviewed September 5, 2026, 4:32 PM ET / 20:32 UTC. ClawSweeper reviewWhat this changesThe two standalone CLI starters mask sensitive fields in structured JSON output, with local helpers, documentation, and regression tests. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still prints unredacted starter JSON. The focused patch follows the existing recipe policy, and the recorded compiled-CLI proof supports the intended masking behavior. No blocking defect was found. Likely related people: Vincent Koc and SebTardif (low-confidence routing suggestions from relevant merged history). Priority: P2 Review scores
Verification
How this fits togetherThe cookbook’s terminal starters turn prompts into SDK runs and print their events and results. This change filters structured results before terminal output while preserving the session values sent to the SDK. flowchart LR
A[Prompt and session settings] --> B[CLI starter]
B --> C[SDK run]
C --> D[Structured results]
D --> E[Sensitive field masking]
E --> F[Terminal output]
C --> G[Assistant text]
G --> F
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Apply the established masking policy at each starter’s JSON display boundary while keeping SDK inputs and streamed text intact. Do we have a high-confidence way to reproduce the issue? Yes: current-main source passes the SDK result containing sessionKey directly to JSON.stringify in both starters. The recorded compiled-CLI comparison corroborates the exposure; this review did not execute target code. Is this the best way to solve the issue? Yes: local copies of the existing recipe redactor are a narrow fit for independently copyable starters, and the patch changes display output without mutating SDK state. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 6deea84fc441. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
|
Verified at Set node sdk/coding-agent-cli/dist/index.js 'Cookbook proof'
node sdk/quickstart/dist/index.js 'Cookbook proof'Both completed normally and printed Brought this branch's dependency manifests/lockfile forward to the already-landed main toolchain, documented the JSON-only masking boundary, and added an Unreleased entry crediting @SebTardif. Streamed assistant text remains verbatim. No live Gateway/provider behavior is claimed. Prepared for maintainer approval; not merged. |
Apply the established redaction policy to standalone result, status, and cancellation JSON while preserving the cancellation lifecycle already on main. Keep each starter independently copyable. Release notes are consolidated in PR openclaw#12. Co-authored-by: Sebastien Tardif <[email protected]>
3f7df4f to
a4a28b5
Compare
|
Restacked independently onto main This PR has no changelog diff; the complete Unreleased section is in #12. The four PRs touch disjoint files and reconstruct the previously proven combined source tree exactly ( The full cookbook gate passed (20 tests, formatting, types, lint, docs, all four starter builds, and both compiled CLI smokes). Branch autoreview through P2 is clean. Exact-head CI: https://github.com/openclaw/cookbook/actions/runs/33990013809 Local runs were serialized using short private macOS temp directories after concurrent subprocess timeouts and a too-long tsx socket path. No test timeouts or product code were weakened. No merge or release performed. |
The standalone CLI starters now apply the cookbook's established redaction policy to result, status, and cancellation JSON. Local helpers keep the examples independently copyable; assistant text remains verbatim.
Independently rebased onto main at
6deea84fc44138676bdf0d4b99dae98ec33d43ff. The CLI source and README exactly match the previously proven combined resolution with the already-landed #7 lifecycle. This PR has no changelog changes; #12 owns the complete Unreleased section. Contributor credit is preserved in the commit.Previous live compiled-CLI proof for the same output behavior: #8 (comment)