Skip to content

fix(exceptions): apply provider-name heuristic to single-positional B…#15

Merged
vitalii-dynamiq merged 1 commit into
mainfrom
fix/badrequesterror-single-arg-disambiguation
May 10, 2026
Merged

fix(exceptions): apply provider-name heuristic to single-positional B…#15
vitalii-dynamiq merged 1 commit into
mainfrom
fix/badrequesterror-single-arg-disambiguation

Conversation

@vitalii-dynamiq

@vitalii-dynamiq vitalii-dynamiq commented May 10, 2026

Copy link
Copy Markdown
Contributor

…adRequestError

BadRequestError's docstring promises a SUPPORTED_PROVIDERS lookup to disambiguate arcllm's (message, provider, model) from litellm's (message, model, llm_provider). The lookup was only wired into the two-positional branch — a single positional was unconditionally stored as provider.

That broke litellm callers using the most common pattern, BadRequestError("Bad input", "gpt-4o-mini"), which silently landed as provider="gpt-4o-mini" instead of model="gpt-4o-mini". The fix extends the same SUPPORTED_PROVIDERS heuristic to the single-arg branch.

Six new tests pin both shapes (provider-then-model, model-then-provider) across one- and two-positional inputs plus the param-kwarg path. Full unit suite: 798 passed.


Note

Low Risk
Low risk: narrowly adjusts BadRequestError positional-argument parsing to avoid mislabeling model names as providers, with added unit tests covering the supported positional shapes and param passthrough.

Overview
Fixes BadRequestError positional-argument disambiguation to apply the SUPPORTED_PROVIDERS heuristic to single-positional calls, so BadRequestError(msg, "gpt-4o-mini") is treated as model rather than incorrectly landing in provider.

Adds a focused test suite to pin both arcllm and litellm positional shapes (one- and two-argument forms) and to ensure the param= keyword continues to be preserved.

Reviewed by Cursor Bugbot for commit b4a24b6. Bugbot is set up for automated code reviews on this repo. Configure here.

…adRequestError

BadRequestError's docstring promises a SUPPORTED_PROVIDERS lookup to
disambiguate arcllm's ``(message, provider, model)`` from litellm's
``(message, model, llm_provider)``. The lookup was only wired into the
two-positional branch — a single positional was unconditionally stored as
``provider``.

That broke litellm callers using the most common pattern,
``BadRequestError("Bad input", "gpt-4o-mini")``, which silently landed as
``provider="gpt-4o-mini"`` instead of ``model="gpt-4o-mini"``. The fix
extends the same SUPPORTED_PROVIDERS heuristic to the single-arg branch.

Six new tests pin both shapes (provider-then-model, model-then-provider)
across one- and two-positional inputs plus the param-kwarg path. Full
unit suite: 798 passed.
@vitalii-dynamiq vitalii-dynamiq merged commit 9904892 into main May 10, 2026
15 checks passed
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