Skip to content

fix(llm): route http_client to the matching sync/async Anthropic client#562

Closed
matteomedioli wants to merge 4 commits into
mainfrom
matteo/anthropic-kwargs-bugfix-GENKGB-1658
Closed

fix(llm): route http_client to the matching sync/async Anthropic client#562
matteomedioli wants to merge 4 commits into
mainfrom
matteo/anthropic-kwargs-bugfix-GENKGB-1658

Conversation

@matteomedioli

@matteomedioli matteomedioli commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

…ync Anthropic clients

Route httpx.Client only to the sync anthropic.Anthropic constructor and
httpx.AsyncClient only to the async anthropic.AsyncAnthropic constructor,
mirroring BaseOpenAILLM's existing param-splitting pattern, so passing a
sync-only or async-only http_client no longer collides across both clients.
… type

Mirror BaseOpenAILLM's existing behavior: when http_client is provided but
is neither an httpx.Client nor an httpx.AsyncClient instance, emit a warning
and construct both clients with the default (no custom) http_client instead
of raising.
…tests

Add unit tests verifying httpx.Client reaches only the sync Anthropic
client, httpx.AsyncClient reaches only the async client, and an invalid
http_client type warns and falls back to defaults for both clients.
Also note the stale-venv anthropic version gotcha in AGENTS.md.
Documents the AnthropicLLM sync/async http_client kwargs collision bug
fixed in tasks 001-002, matching the repo's existing changelog style.
@matteomedioli
matteomedioli requested a review from a team as a code owner July 16, 2026 21:45
@matteomedioli
matteomedioli marked this pull request as draft July 16, 2026 21:49
@matteomedioli
matteomedioli force-pushed the matteo/anthropic-kwargs-bugfix-GENKGB-1658 branch from f0c905b to 0751af6 Compare July 16, 2026 21:49
@matteomedioli
matteomedioli deleted the matteo/anthropic-kwargs-bugfix-GENKGB-1658 branch July 16, 2026 23:21
@matteomedioli

Copy link
Copy Markdown
Contributor Author

Accidentally closed by a branch rename (no content lost, no review activity on this PR). Reopened as #565.

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