Skip to content

stagehand-python@4.2.1a0.dev1594

@miguelg719 miguelg719 tagged this 09 Oct 23:57
## What

Internal hardening of how the browser runtime issues authenticated LLM
and Model Gateway requests: they now use a `fetch` reference captured at
startup rather than the ambient global. No public API or behavior change
for callers.

## Changes

- `extension/llm/boundFetch.ts` (new) — a `fetch` reference captured at
module load.
- `extension/llm/aiSdkClient.ts` — pass `boundFetch` into the provider
connection (OpenAI/Anthropic/Google/Groq/Cerebras).
- `extension/llm/LLMProvider.ts` — pass `boundFetch` into
`getAISDKLanguageModel`'s provider factory.
- `extension/llm/gatewayClient.ts` — `fetchWithoutModel` uses
`boundFetch`; `createGatewayLanguageModel` always passes the load-time
reference (previously only when no model config).
- `sdk-go` embedded extension regenerated; `gateway-client` test updated
to the new contract.

Draft — part of an incremental hardening series.
Assets 2
Loading