Repository navigation
docs: clarify ModelBadRequestError covers any other 4xx - #36
Merged
folathecoder merged 1 commit intoNov 5, 2026
Merged
Conversation
folathecoder
self-requested a review
November 5, 2026 16:22
folathecoder
approved these changes
Nov 5, 2026
Collaborator
|
@zheng-guannan577 Looks great. Can you optionally star the project to support? |
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 #22.
The old docstring only said HTTP 400/404/422, but the three example providers (anthropic/openai/ollama) use a catch-all mapping — after excluding 401/403 (Auth), 429 (RateLimit), 5xx (Server), and body hints for bad-key or over-long prompt, every other 4xx lands in ModelBadRequestError; tests already prove 413 maps there and the README says 'Any other 4xx'.
Local tests passed (PYTHONPATH=src:. python3 -m pytest tests/: 537 passed, 7 skipped, including errors, public_api and three provider mapping test groups with 97 passed; ruff was not installed locally so lint was skipped, and the change is docstring only).
Wording choice: rule-plus-exclusions rather than enumerating roughly 96 status codes one by one, because the mapping itself is catch-all; if the maintainer insists on a literal full list, that is a wording follow-up only, not a behavior change.
Change: docstring only, +9/-1 in src/agentling/errors.py, no behavior code change.