fix(cli): fix flaky config set help text test caused by env var leakage and word wrapping#83423
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection shows the asserted examples are passed through env-aware PR rating What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. PR egg Rarity: 🥚 common. What is this egg doing here?
Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the focused test-only assertion update after ordinary maintainer and CI review so CLI help tests tolerate env-injected prefixes and Commander wrapping without changing runtime behavior. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows the asserted examples are passed through env-aware Is this the best way to solve the issue? Yes. Normalizing whitespace in the assertion is the narrowest maintainable fix because it keeps checking the important help examples while removing sensitivity to line wrapping and injected CLI prefixes. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b2c5ba6d4c4e. |
There was a problem hiding this comment.
Pull request overview
Fixes a flaky CLI help-text unit test in config-cli.test.ts by making assertions resilient to commander word-wrapping and environment-driven flag injection (e.g., OPENCLAW_PROFILE/OPENCLAW_CONTAINER_HINT) when tests share a worker.
Changes:
- Adds whitespace normalization (
replace(/\s+/g, " ")) forconfig sethelp text before matching. - Updates help-text assertions to match stable substrings rather than exact single-line examples.
…age and word wrapping
c79323f to
86d81ac
Compare
|
Merged via squash.
Thanks @medns! |
…k / continue_delegate / request_compaction) This is the continuation feature presented in full against current upstream/main. Per upstream's stated cadence canon this is XL; opened as DRAFT for review-quality engagement. Cure-(20)v3 = drift + 2 substrate-restores + 2 surgical test-cascade-fixes: - Class-1 drift-rebase onto upstream/main d124c5a (3 commits beyond cure-(19)'s parent 424c6d0: fix(outbound): resolve send-capable channel registry openclaw#83733, fix: keep inter-session provenance out of transcripts openclaw#83755, fix(cli): fix flaky config set help text test caused by env var leakage and word wrapping openclaw#83423 — all orthogonal to orphan-restore + cascade-fix scope) - Class-2 cure-substrate-original revert restoring 4 deleted files + 1 modified file: src/flows/doctor-repair-flow.{ts,test.ts}, src/commands/doctor-session-snapshots.{ts,test.ts}, src/flows/doctor-health-contributions.ts (4 hunks). All orthogonal to continuation surface (0 keyword hits). Caught by local impacted-vitest after cure-(19) Class-2 revert of src/config/io.ts. - Class-3 cascade-fix in src/agents/subagent-registry.test.ts (test substrate only; runtime unchanged): added resolveSessionStoreEntry mock (cure-(17) family cascade-miss for cure's added call at subagent-registry-helpers.ts:79+102) + renamed/inverted the "preserves run-mode keep entries past SESSION_RUN_TTL_MS sweep" test to "sweeps...after cleanup completes" with expect(run).toBeUndefined() matching cure's intentional cleanupCompletedAt-based deferred- cleanup-sweep policy for continue_delegate lifecycle (cohort byte-walks at Discord 1506039161 + 1506039225 + 1506039263 confirmed cure-behavior IS correct continuation-feature substrate). Co-Authored-By: scribe.dandelion.cult <scribe.dandelion.cult@hotmail.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
…ge and word wrapping (openclaw#83423) Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
Summary
config cli > config set parsing flags > shows --strict-json...test is flaky.OPENCLAW_PROFILEleak, causingcommanderto inject flags and word-wrap the help text, breaking thetoContainassertions.toContainwith a whitespace-normalized string match (replace(/\s+/g, " ")) to make the assertions immune to flag injection and line reflowing.commanderconfiguration.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
config-cli.test.tsdue tocommanderword-wrapping injected flags.OPENCLAW_PROFILEenv vars.Root Cause (if applicable)
commanderautomatically word-wraps help text based on terminal width and command length. Leaked env vars likeOPENCLAW_PROFILEinject flags into the command, pushing the length past the wrap boundary and replacing spaces with newlines, which breaks strict string assertions.Regression Test Plan (if applicable)
src/cli/config-cli.test.tsUser-visible / Behavior Changes
None.
Diagram (if applicable)
N/A
Security Impact (required)
NoNoNoNoNoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
OPENCLAW_PROFILEenvironment variable.pnpm test src/cli/config-cli.test.ts -t "shows --strict-json and keeps --json as a legacy alias in help".Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
OPENCLAW_PROFILEto forcecommanderto word-wrap the help text.commander's auto-wrapped output).Review Conversations
Compatibility / Migration
YesNoNoRisks and Mitigations
None.