Repository navigation
fix(cli): report an answer the SDK cannot read as unreadable, not as unreachable - #288
Merged
Merged
Conversation
goldbarth
force-pushed
the
fix/unreadable-model-answer
branch
from
September 30, 2026 11:28
6cb6d41 to
e598b2a
Compare
This was referenced Sep 30, 2026
goldbarth
added a commit
that referenced
this pull request
Sep 30, 2026
…n stops (#299) Follows #298, which added `docs/costs-and-checks.md`, the page this one takes the diagnosis sections from. - **Why:** the messages a run stops with were spread over `cli.md`, `github.md`, `configuration.md`, `what-goes-into-a-release.md` and `run-metrics.md`, each explained where its topic lives, but nothing let a user start from the message. `docs/troubleshooting.md` is that entry: message, cause, fix, with a link to the page that explains more. - **It opens with `chartula doctor`,** which finds most of the setup and range situations before anything is spent, and says which ones it cannot find (a spent rate limit, a first tag, everything that only shows once the model writes a whole release). - **The situations:** no model key; GitHub cannot read the repository (404); a rejected token (401); a token that cannot publish, which stops `generate` before its first model call (#285); the rate limit, with and without a token; a configuration error; a shallow clone; a first tag without a terminal; a failed model call by status (404, 401 with and without a key, 403), an unreachable endpoint, and an answer the SDK cannot read, kept apart from an unreachable one (#288); an answer that does not match the facts; an answer cut off at `maxOutputTokens`; a context window too small; a thorough check that verified nothing; a slow run, read from the progress lines (#297) and the run summary. - **Every message is from a real run of the built binary,** in a scratch repository, with GitHub and the model served by a local stub (a mode per case: 404, 401, rate limit with `x-ratelimit-remaining: 0`, 403 with `x-accepted-github-permissions`, model 404/401, an unknown `finish_reason`, a reported prompt of 120 tokens, prose instead of a verdict, a cut answer, a 4 s delay per call). Paths are anonymized to `/work/my-repo`, the stub's address to `https://api.github.com/` and `http://localhost:11434/v1`. The line after `The endpoint said:` came from the stub, so the page shows it as `...` and says its wording depends on the provider. The slow run's summary is the real local run from the chartula-evals sweep already used in #298. - **One home per explanation:** a message appears here and, where it has one, on the page that explains its topic; the explanation itself stays there and is linked. From `cli.md`, the status-by-status account of a failed model call and the missing-key example move here and are replaced by links. From `costs-and-checks.md`, the three diagnosis sections (slow run, unreadable check, cut prompt) move here; the summary page keeps a short list of the lines that point to a problem, each linking its section. - **A message corrected on the way:** the warning without a GitHub token said a run spends "roughly one [request] per pull request". It spends one per commit in the range, as `docs/github.md` says, so a release merged with merge commits was underestimated. The class comment also still claimed that an exhausted limit fails with a 403 naming a commit; the run names the rate limit (`GitHubErrorResponse.cs`). Both are corrected in `GitHubTokenNotice.cs`. - **README:** Troubleshooting joins the "Setting it up" index; `getting-started.md` links it under "Next". **Verified:** - Every case ran with the binary built from this branch; the outputs match the page, and the corrected no-token warning was rerun after the fix. - Every relative link and anchor in all Markdown files of the repository resolves (script, with a negative test). - `dotnet build -c Release` without warnings, `dotnet format --verify-no-changes` clean. Tests: full suite passing (920), no test changed; no test asserts the warning's wording. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No --- _Generated by [Claude Code](https://claude.ai/code/session_01BQ1Z71j4Q2W1CwGYjF55No)_ Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #263
Describetook every failure without an HTTP error response for "no answer at all", so a local Ollama that sent afinish_reasonthe OpenAI SDK does not know sent the user looking for a network problem.ModelErrorResponseHandleralready saw every response of a model call and kept only the errors. It now keeps the last response of either kind. A call that fails after a success response got an answer; one with no response at all did not. Each SDK throws its own type on an unreadable body, and this holds for both without naming one.answered 200 OK for model '...', but the answer could not be read: Unknown ChatFinishReason value 'weird_reason'.An SDK that meets an unknown value puts it after the parameter name on a line of its own; the message names the value instead. Any other failure keeps the SDK's message, on one line. A second line says the endpoint is reachable and its answer is not in the form the SDK expects.Reproduced and verified end to end, no network, no tokens: the built binary in a scratch repository with two tags, GitHub and an OpenAI-compatible endpoint both served by a local stub that answers
finish_reason: "weird_reason".Before:
After:
Tests:
ModelCallFailureTeststhrough the real SDKs with a stubbed network: an unknownfinish_reasonis reported as unreadable with its value, an answer that is not JSON is unreadable and not unreachable for both providers, an answer after a retried error replaces it, and the existing unreachable test still gets "could not be reached". Full suite 856 passing, build without warnings,dotnet formatclean.