Repository navigation
fix(clawdock): keep credentials out of diagnostic output - #133547
Conversation
Keep routine repair and config inspection output free of credential values and prefixes while preserving explicit clawdock-token reveal. Use validated config setters and fail closed when diagnostic rendering fails. Fixes #133535.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:19 PM ET / 21:19 UTC. ClawSweeper reviewWhat this changesThe PR redacts ClawDock configuration diagnostics and token-repair output, returning clear failures instead of printing credentials or backend diagnostics. Merge readinessKeep this maintainer-owned PR open for normal landing review: current main still exposes credentials, while the introduced patch removes those paths and has strong supplied real-Docker proof. The only remaining merge consideration is the documented fail-closed Docker-image prerequisite for configuration inspection. Priority: P1 Review scores
Verification
How this fits togetherClawDock is OpenClaw’s Docker setup helper. It reads host configuration and invokes the gateway CLI, then returns terminal diagnostics and repair status to the operator. flowchart LR
A[Operator command] --> B[ClawDock helper]
B --> C[Host config files]
B --> D[Docker gateway CLI]
C --> E[Safe diagnostic renderer]
D --> F[Token configuration]
E --> G[Redacted terminal output]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceTests +290, Docs +3, Other -33. Total +260 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the helper-owned fail-closed renderer so routine diagnostics never disclose configuration values, while documenting Docker-image availability as its prerequisite. Do we have a high-confidence way to reproduce the issue? Yes. Current main directly prints raw configuration and token prefixes, and the supplied real-Docker before/after run exercises the same helper boundary with synthetic credentials. Is this the best way to solve the issue? Yes. The patch fixes disclosure at the diagnostic helper that owns terminal output, reuses canonical config setters, and retains explicit token reveal only through the named command. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 343fe90926c0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for Exact-head CI run 33335688305 completed successfully. Final local commands passed: node scripts/run-vitest.mjs test/scripts/clawdock-helpers.test.ts
node scripts/check-changed.mjs --timed -- scripts/clawdock/clawdock-helpers.sh test/scripts/clawdock-helpers.test.ts docs/install/clawdock.md scripts/clawdock/README.md
bash -n scripts/clawdock/clawdock-helpers.sh
zsh -n scripts/clawdock/clawdock-helpers.sh
git diff --checkAll 34 Bash/Zsh tests passed. Independent Codex autoreview was scoped-clean at P0. Native review artifacts validated with Real Docker proof used The initial image-interpolation fault was an invalid expectation for Compose ClawSweeper's completed review has no actionable findings or separate Rank-up moves list. Its Docker-image prerequisite tradeoff is accepted as part of the user-approved frozen result: withhold unsafe output when the image/parser is unavailable, with the requirement documented. Exact-head CI now satisfies its other next step. Matching live rulesets require the Actions-owned CI gate, with no enforced separate approval requirement. A queued review refresh does not supersede the fresh completed review of this unchanged head. |
* origin/main: (55 commits) test: include v2026.8.1 release navigation (#133581) fix: stop cloud work before unrelated provider inspection finishes (#133476) fix(e2e): keep delete fixture target-compatible (#133526) fix(release): detect optional target E2E capability (#133525) fix(package): publish readable dist inventory (#133549) docs: add complete v2026.8.1 maintainer change index (#133585) fix(browser): preserve contextless worker and iframe sessions (#133571) fix(voice): discover configured provider candidates (#133507) refactor(ui): simplify chat rendering and lifecycle state (#133567) test: reduce maturity fixture cleanup time (#133566) improve: speed up legacy imports and transcript replacement (#133546) docs: add draft v2026.8.1 release notes (#133557) test: guard multi-project Vitest cache ownership (#133554) fix(memory): clarify default agent scope in command help (#133560) fix(clawdock): keep credentials out of diagnostic output (#133547) refactor(ui): avoid redundant presence work in avatar lists (#133548) fix(agents): recognize internal requester completion replies (#133543) fix: prevent duplicate queued user messages in chat clients (#133542) chore(ui): refresh control ui locales (#133544) fix(beam): restart delivery when the receiver changes (#133533) ...
…cked-delivery * origin/main: (261 commits) fix(clawdock): keep credentials out of diagnostic output (openclaw#133547) refactor(ui): avoid redundant presence work in avatar lists (openclaw#133548) fix(agents): recognize internal requester completion replies (openclaw#133543) fix: prevent duplicate queued user messages in chat clients (openclaw#133542) chore(ui): refresh control ui locales (openclaw#133544) fix(beam): restart delivery when the receiver changes (openclaw#133533) fix(models): recover /models browse from a replaced prepared catalog (openclaw#133221) perf(terminal): reuse control scans and remove repeated sanitization work (openclaw#133527) perf(agents): prepare only consumed tool and skill diagnostics (openclaw#133512) fix(line): offer the card command only on LINE (openclaw#132895) fix: keep Android publication independent of core release (openclaw#133471) refactor(agents): simplify compaction accounting (openclaw#133521) refactor(plugins): simplify registration lifecycle policy (openclaw#133364) perf(plugins): avoid eager loader imports for active registry reads (openclaw#133518) refactor(ui): consolidate chat rendering ownership (openclaw#133508) test(auto-reply): prepare memory flush model capabilities (openclaw#133532) fix(ui): replace startup hourglasses with capacity-aware rings (openclaw#133470) fix(talk): preserve provider conversation order in browser transcripts (openclaw#133493) fix(ui): deduplicate participant and viewer avatars (openclaw#133519) feat(ui): add CRT terminal theme (openclaw#133495) ...
…3547) Keep routine repair and config inspection output free of credential values and prefixes while preserving explicit clawdock-token reveal. Use validated config setters and fail closed when diagnostic rendering fails. Fixes openclaw#133535.
Closes #133535
What Problem This Solves
Fixes an issue where operators running ClawDock token repair or config inspection would expose credential material in routine terminal output.
clawdock-fix-tokenprinted token prefixes, including a mismatched saved token, whileclawdock-show-configprintedopenclaw.jsonverbatim despite advertising redacted values. The.envdisplay also passed comments and multiline fragments through unchanged.Why This Change Was Made
Keep the disclosure boundary at the helper that owns the diagnostics. Config inspection parses JSON5 and dotenv with dependencies already shipped in the OpenClaw Docker image, preserves structure/key names, and replaces every scalar value with a fixed redaction marker. Failed renderer output is withheld rather than printed partially or passed through raw.
Token repair checks both canonical config setters and the restart result without echoing their potentially sensitive output. The old readback comparison is removed:
config getdeliberately returns redacted secrets, and a second raw-config reader would duplicate include/environment-resolution policy owned by the config implementation. Failures now return nonzero instead of continuing to a misleading completion message.User Impact
Routine ClawDock setup/repair/config output no longer reveals credential values or prefixes. The explicitly named
clawdock-tokencommand still prints the complete token on request. Docker port handling, Compose override ordering, and dashboard behavior are unchanged.Config inspection requires Docker and the built OpenClaw image, but neither host-side Node/parsers nor a running gateway. Temporary renderer containers do not start dependencies. All values are hidden, including values under arbitrary plugin keys; comments are omitted. Ambiguous quote-leading dotenv values are conservatively withheld, with the limitation documented. Config and env file contents are not modified by inspection.
Evidence
node scripts/run-vitest.mjs test/scripts/clawdock-helpers.test.ts: 34 passing tests, including short/long/shell-literal tokens, both setter failures, restart failure, nested JSON5 objects/arrays, multiline dotenv, parser/Docker failures, and explicit reveal. Existing Compose override and dashboard-port tests remain green.node scripts/check-changed.mjs -- scripts/clawdock/clawdock-helpers.sh test/scripts/clawdock-helpers.test.ts docs/install/clawdock.md scripts/clawdock/README.md: passed.bash -n scripts/clawdock/clawdock-helpers.sh,zsh -n scripts/clawdock/clawdock-helpers.sh, formatting, andgit diff --check: passed.blacksmith-testbox, leasetbx_01m1a78w22pebcs9k4dhswpjef, Testbox workflow: official OpenClaw 2026.7.1 image pinned toghcr.io/openclaw/openclaw@sha256:2f5ce8848a1a69b3c460622e566cb9395da9fd18d7ef7b038cd8e2c4f195decf, Docker 28.0.4, Compose 2.38.2. Actual helper functions and installed CLI ran with synthetic temporary state, a nonroot gateway, networking disabled, no published ports, and only the proof-owned bind mount. Thirty assertions passed across the initial and focused runs: before/after disclosure, JSON5/dotenv rendering, exact explicit reveal, both persisted token fields, successful restart/health recovery, real write denial, real Compose parser failure, and missing-token handling. Fixture containers/networks/volumes/state were removed and the lease was independently verified completed.config/runbut did not failexec/restart, so its expected-failure assertion was invalid. A focused rerun verified an actual Composeexecparser failure first and passed all six assertions. No product changes resulted. Restart failure after two successful writes is covered by the shell regression suite, not fault-injected in the real Docker run.Production LOC: +45/-78 (net -33). Tests/test support: +291/-1 (net +290). Documentation: +8/-5. No new dependencies, config options, storage, or protocol changes.
The disclosure is present in stable
v2026.7.1source. No specific introducing commit or author is claimed. No operator state or real credentials were used in reproduction or regression tests.Source identity: the final candidate is
42183e31ffee76b9e232793bdfd2e9c96a3259af, rebased once without changing any of the four reviewed files. Docker proof compared the original helper at94259f243740d1d37530180e580210a907123661(SHA-25614ad11125fff8645ea438bb38c69588596d95935264ab37109ba1211e7ef8671) with the candidate helper (SHA-2567d718c26fb04a32dbb66e431c67f28a63a4e0ce0bb7e04b6280e4b56280f44f3).Final candidate verification repeated all 34 Bash/Zsh tests and the full changed-file gate (
node scripts/check-changed.mjs --timed -- scripts/clawdock/clawdock-helpers.sh test/scripts/clawdock-helpers.test.ts docs/install/clawdock.md scripts/clawdock/README.md), all passing. The gate emitted a nonblocking temp-directory migration suggestion; the fixture already cleans up infinally.Final CI: run 33335688305 completed successfully on
42183e31ffee76b9e232793bdfd2e9c96a3259af; the exact-head watcher exited 0 withGREEN. ClawSweeper reported no actionable findings. Its documented Docker-image prerequisite is accepted as part of the approved result; diagnostics intentionally withhold file contents if the image/parser is unavailable.