Skip to content

fix(tui): actionable CLI error messages (doctor, exec, stream, review) - #6725

Merged
Hmbown merged 4 commits into
mainfrom
fix/l2-tui-cli-messages
Sep 29, 2026
Merged

Hmbown merged 4 commits into
mainfrom
fix/l2-tui-cli-messages

Conversation

@Hmbown

@Hmbown Hmbown commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

No-Issue: verified quality-hunt findings; integration evidence tracked in SHA-6705.

CLI failures now give usable recovery commands without exposing pasted credentials or suggesting the wrong authentication flow. Doctor reports safe validation errors and the setup state without reading external credentials merely to form its verdict. Headless route failures use CLI guidance; OAuth errors are not directed to API-key storage. Session-resume errors redact the supplied identifier in every output mode, and the final exec failure line retains the actual error for automation.

DeepSeek recovery guidance puts the save command first and describes Harness import conditionally, without probing PATH or another application's files from the runtime. Error-history rendering preserves explicit line breaks, keeping recovery commands readable in small terminals. Git review distinguishes a missing work tree from other repository failures and retains actionable Git diagnostics.

Streaming errors distinguish refusal/DNS failures from TLS/protocol failures, including typed TLS causes. The HTTP response parser and engine share the context-overflow phrase list. Cloud-error sanitization rejoins control-split tokens before redaction, then bounds the displayed output while keeping its head and tail.

Validation

At production repair head 3886ef026d0868770fb0e895fc70afe2339ecce2:

  • Required npm test: 636 passed, 0 failed; required npm run check:web: passed including production build.
  • Recovered-source Rust selection: 747 passed, 1 failed, 1 ignored. The sole failure was the TLS loopback fixture; its nested-IO cause is fixed at the final head.
  • Final TLS/streaming selection: 15 passed, 0 failed; read-only diagnostic integration: 13 passed, 0 failed; error/history rendering: 4 passed, 0 failed. Unchanged modules from the earlier passing selection were not rerun.
  • The original keyless Engine regression and its 80x24/140x40 visible-command assertions remain unchanged and pass. This was the sole failed Windows test (16,607 passed, 1 failed, 21 skipped) and also failed Ubuntu at the previous remote head.
  • Command-boundary regressions: 23 passed; runtime-module boundary check, blocking-call budget, formatting and diff checks passed. No guard budget was raised.

The local TUI linker emits its existing large-unwind-table warning. Hosted checks must qualify this new head.

Full workspace and hosted checks remain CI responsibilities. No live provider, native app, release, or deployment qualification is claimed.

Recovered Claude Code edits were checkpointed before the follow-up repair; original commits and contributor attribution remain intact. Original session.

Windows fixture follow-up

Windows CI at3886ef026 reported TCP reset10054 in the TLS handshake fixture because its peer immediately dropped unread ClientHello bytes. Commit557cfac53 keeps the peer open and drains it until the client closes. All 15 focused stream tests pass locally; hosted Windows, macOS, Linux and all other current-head workflows passed at 557cfac53a8dbf0231c9dced9809d6f524a686d3. No production behavior changed.

Message-only slices plus one presence-only credential check:

- doctor: plain value/profile validation errors are shown (without the
  rejected value, which may be a pasted secret) with
  `fix: codewhale config set <key> <valid>`; parse and credential errors
  stay suppressed. Text and --json paths share SafeConfigDiagnostic.
- doctor verdict: a key saved with `codewhale auth set` (secret store,
  config, or env; read-only presence) clears "no model provider"; the
  hint is /provider or `codewhale auth set --provider <p>` when headless.
- exec preflight: headless next steps name CLI commands only, no
  duplicate auth instruction, no "..", multi-line guidance keeps its
  indentation; DeepSeek zsh caveat on its own line and the DeepSeek
  Harness bullet only when dsh is on PATH; the final exec failure line
  no longer repeats an error the stream already printed.
- `config set provider <typo>` reuses "Invalid provider 'x': expected ...".
- SSE H1 fallback: full error chain, FORCE_HTTP1 hint only after
  protocol/TLS errors, connect failures read "Cannot reach host:port".
- 400s classify as ContextLengthError only on context-specific phrases.
- cloud sanitize_error: controls/whitespace collapse to one space,
  redact before cut, keep head and tail.
- exec --resume shows the typed id (redacted only for stream-json) plus
  `Run \`codewhale sessions\` to list ids.`; review outside a repo says
  "Not inside a git repository (cwd: ...)", git diff errors keep one line.

Tests: targeted codewhale-tui lib tests, 63 passed / 0 failed; touched
modules (config::tests, llm_client, cloud_dispatch, exec_agent,
route_preferences, doctor) 724 passed / 0 failed / 1 ignored.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ZwqatxgVFxHvovngywnks
Copilot AI balanced review requested due to automatic review settings September 29, 2026 06:31
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread crates/tui/src/lib.rs Fixed
Comment thread crates/tui/src/lib.rs Fixed
Hmbown and others added 3 commits September 29, 2026 00:22
Checkpoint the 12-file working tree left by the original Claude repair:L2
worker for PR #6725 after its session limit interrupted the repair. Preserve
that work before the DSH helper ownership move; this commit is local only
and is not a green landing claim.

Provenance: original lane commit 2562f29;
Claude session_014ZwqatxgVFxHvovngywnks; repair workflow receipt
wg9a2bnyw.output reports the quota stop. No original edits were discarded.

Verification at checkpoint:
- git diff --check: pass.
- scripts/split/module_graph.py --check: FAIL, four new integrations-to-UI
  references (two crate-root references and two ratatui imports).
- Recovered repair log b0yfkj7tx.output: test result: FAILED. 332 passed;
  1 failed (tls_failure_during_connect_keeps_the_http1_hint).
- Hosted Ubuntu at the preceding PR head failed the 80x24 keyless error
  visibility test; the recovered tree has no repair of that rendering yet.
- No Rust build or npm/check:web gate was run for this checkpoint.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hunter B <hmbown@gmail.com>
Finish the interrupted PR #6725 repair preserved in a4740de. Render each
explicit error-text line through the existing wrapper, keeping the recovery
command visible after a config acknowledgement at 80x24 and 140x40. Keep
DeepSeek Harness consent advice conditional without probing PATH or another
application's credential file from the runtime's missing-key path. The
existing integration detector remains intact.

Recognize rustls errors inside the two nested IO wrappers produced by the
current hyper-rustls/tokio-rustls stack, so TLS handshake failures retain the
protocol hint while refused connections retain their host-specific message.

Verification:
- npm test: 636 passed (68 wrapper, 16 runtime SDK, 50 extension host,
  502 web); npm run check:web: passed including production build.
- Targeted recovered-source Rust run: 747 passed, 1 failed, 1 ignored.
  The sole failure was the real loopback TLS fixture fixed here; unchanged
  passing modules were not rerun.
- After the final nested-IO fix: stream_entry 15/0, diagnostic_read_only
  integration 13/0, and error/history rendering 4/0. The original keyless
  test and its 80x24/140x40 visible-command assertions remain unchanged.
- Command-boundary regression suite: 23/0; module graph check passed.
- Blocking-call inventory: 747 sites across 209 files, within existing
  budget; no budget increase. cargo fmt and git diff --check passed.

Hosted Ubuntu and Windows at 2562f29 failed the same keyless rendering
assertion. Local results above do not claim new hosted CI or release proof.
Preserve the original Claude repair worker's provenance and checkpoint.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hunter B <hmbown@gmail.com>
Windows CI received TCP reset10054 when the test peer dropped unread
ClientHello bytes, masking the intended TLS protocol error. Drain the
peer until client closure so the assertion checks the actual TLS path.

Validation: 15 focused stream tests passed; 0 failed. git diff --check
passed. Required npm636pass and check:webpass from3886ef026 remain
applicable: this follow-up changes only four lines in the Rust fixture.
Hosted Windows proof is pending the pushed head.
@Hmbown
Hmbown merged commit ee1d865 into main Sep 29, 2026
36 checks passed
@Hmbown
Hmbown deleted the fix/l2-tui-cli-messages branch September 29, 2026 09:58
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.

3 participants