Skip to content

fix(cli): keep error lines from hard-wrapping mid-command - #150

Merged
allenhutchison merged 1 commit into
Vycari:mainfrom
bniladridas:fix/error-lines-soft-wrap
Oct 28, 2026
Merged

allenhutchison merged 1 commit into
Vycari:mainfrom
bniladridas:fix/error-lines-soft-wrap

Conversation

@bniladridas

@bniladridas bniladridas commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Human overview

Error lines hard-wrapped at the terminal width, so a long credentials path could split Run 'pepper login' first. and break a copied command. This soft-wraps error lines by default and rewrites the not-logged-in test to pin the console width and a long home path instead of depending on the ambient temp path. Fixes #108.

AI reviewer

What changed

  • src/pepper_cli/render.py: error() now defaults soft_wrap=True, so Rich does not insert newlines into an error line. The docstring records that the old fold point depended on the length of an interpolated path.
  • src/pepper_cli/cli.py: _emit_error() defaults soft_wrap=True. This is the path _creds_or_fail and _load_or_error use, so the not-logged-in message is covered alongside direct render.error() calls.
  • tests/test_cli_research.py: test_not_logged_in sets COLUMNS=80 and a 120-character HOME and USERPROFILE, so the wrap condition is deterministic and independent of the ambient temp path. It asserts pepper login stays contiguous and the line has no interior newline.

Existing explicit soft_wrap=True call sites were left alone to keep the diff to the three reported files.

Invariants

  • Tokens stay secret: credential loading and message content are unchanged; only line folding on stderr changes.
  • Exit codes and stdout are unchanged; this affects stderr rendering only.
  • No /api/v1 call, wire model, # MIRROR: comment, or stream frame changes.

Verification

  • Regression test fails on the pre-fix code: assert 4 == 0 from four interior newlines with a long home and COLUMNS=80. It passes after the change.
  • uv run ruff format --check: 119 files already formatted.
  • uv run ruff check: All checks passed.
  • uv run ty check src/pepper_cli/: All checks passed.
  • uv run pytest: 2,485 passed, 2 skipped. The remaining warnings are an existing Textual thread-teardown warning, unrelated to this change.
  • uv run pytest --cov --cov-report=json:coverage-summary.json, then the coverage adapter and ratchet: 95.066 percent line coverage against the 88 percent floor.

Deferred

  • The explicit soft_wrap=True arguments at other error call sites are now redundant. They were left out of this diff per review scope; a separate cleanup can remove them.

Checklist (repo-specific)

  • uv run ruff format --check and uv run ruff check clean (no new lint ignores)
  • uv run ty check src/pepper_cli/ clean
  • uv run pytest passes; coverage floor in .claude/maintainerd.json not lowered
  • Server-contract changes: not applicable, no /api/v1 usage, wire model, or stream frame changed.
  • No token or credential is logged, printed, or put in a fixture
  • README and the bundled SKILL.md: not applicable, no command, flag, or rendered output shape changed; only stderr line folding changed.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Error messages now default to soft_wrap=True, keeping long paths and suggested commands free of inserted newlines.

  • Pepper’s text errors keep commands and paths on one output line.

Reviews (1) · Last reviewed commit: "fix(cli): keep error lines from hard-wra..." · Reviewed by Greptile

Error lines now soft-wrap by default, so a long credentials path cannot fold `Run 'pepper login' first.` across two lines. The not-logged-in test pins the console width and a long home path instead of depending on the temp path.

Signed-off-by: Niladri Das <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T02:19:39.818016Z 94e7b43 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@vycari-review

vycari-review Bot commented Oct 28, 2026

Copy link
Copy Markdown

Vycari Review (shadow)

Shadow round 1 on 94e7b43. This comment is non-gating and needs no response: it is collected to measure agreement with the current reviewer. The round's verdict is the Vycari Review (shadow) check run.

Open: P0 0 · P1 0 · P2 0 · confirmed fixed 0 · withdrawn 0

Judge's notes

Incomplete: 1 stage call(s) failed (hunter:general). No candidate findings were raised.

No open findings this round.

@allenhutchison
allenhutchison added this pull request to the merge queue Oct 28, 2026
Merged via the queue into Vycari:main with commit 92cf41c Oct 28, 2026
5 checks passed
@allenhutchison allenhutchison mentioned this pull request Oct 30, 2026
4 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error output wraps mid-command; test_not_logged_in fails when the temp path is long

2 participants