Skip to content

fix(llm): surface claude-cli errors reported on stdout#1864

Open
davetothek wants to merge 1 commit into
Graphify-Labs:v8from
davetothek:fix/claude-cli-errors
Open

fix(llm): surface claude-cli errors reported on stdout#1864
davetothek wants to merge 1 commit into
Graphify-Labs:v8from
davetothek:fix/claude-cli-errors

Conversation

@davetothek

Copy link
Copy Markdown

The claude CLI reports usage-limit and auth errors on stdout with an
empty stderr while exiting non-zero. _call_claude_cli / _call_llm only read
proc.stderr, so these failures surfaced as a bare claude -p exited 1: with
no indication of the actual cause — an unrecoverable usage limit looked
identical to any other non-zero exit.

Fall back to the stdout tail when stderr is empty, so the surfaced error carries
the real message. Adds tests/test_llm_errors.py covering both paths (prefer
stderr when present; fall back to stdout otherwise).

The claude CLI reports usage-limit and auth errors on stdout with an
empty stderr, so failures surfaced as a bare "claude -p exited 1:".
Fall back to the stdout tail when stderr is empty.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants