Skip to content

Make CLI connection errors short and actionable - #19

Merged
ShmueLior merged 2 commits into
mainfrom
fix/cli-error-messages
Nov 28, 2026
Merged

ShmueLior merged 2 commits into
mainfrom
fix/cli-error-messages

Conversation

@ShmueLior

Copy link
Copy Markdown
Owner

Makes CLI connection errors short and actionable, found while dogfooding against real servers.

  • --timeout N now stops after about N seconds on a stdio server that won't exit. The shutdown grace is 500 ms instead of 5 s, and the error no longer ends with "A task was canceled.".
  • A pinned --transport sse or streamable-http that gets 400/404/405 says the URL didn't answer as that transport and points at the other one.
  • 401 shows the WWW-Authenticate challenge and suggests --header 'Authorization: Bearer <token>', or says the header was rejected.
  • Other error bodies are one line, max 200 chars, HTML stripped, instead of a whole page.

Exit codes are unchanged (0/1/2). Tests pass on net8.0 and net10.0, and a packed CLI was checked on 70 cases including a live Microsoft Learn server.

DescribeWithCauses always appends a period after the line. A body that already ended with a period was printing as "found.". Keep a truncation ellipsis and drop only a trailing sentence period so the message period sits after the closing quote.
@ShmueLior
ShmueLior merged commit 380f20f into main Nov 28, 2026
3 checks passed
@ShmueLior ShmueLior mentioned this pull request Nov 28, 2026
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.

1 participant