fix: route Azure Astra through Responses API - #15845
Conversation
The Azure deployment alias in `modelKwargs.model` is spread after `model` by langchain, so the SDK's same-provider summarizer, which copies the agent's client options and overrides only `model`, still reached the Astra deployment when configured with a different model. Hand the summarizer the agent's kwargs without the alias whenever its model differs. Also derive the Astra routing decision once, reuse the first-party OpenAI predicate in the GPT-5.6 rule, pin the opt-out shape in the Azure spec, and expect `firstPartyEndpoint` for canonical Azure hosts in the backward-compat spec. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4237cd72ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
To use Codex here, create a Codex account and connect to github. |
Summary
Azure OpenAI agents using
gpt-6-astrafail with a 400 when they call a function tool unless the user manually enables the Responses API. Astra support in #15567 limited automatic routing and SDK request constraints to canonical OpenAI endpoints. Azure now receives the same Responses default, with the correct URL and deployment name, and compaction resolves the configured summary model's deployment and credentials.Fixes #15844.
How it works
Recognize direct Azure OpenAI configurations and canonical Azure hosts, resolving URL placeholders before checking the host. Normalize bare resource URLs to the API path, recover deployments specified only in a URL, and move query parameters into the SDK's query options so it can append
/responsescorrectly. Explicit API opt-outs, custom gateway routing, and Azure's fallback model selection remain intact.The logical Astra model remains available to the SDK for parameter validation and encrypted reasoning, while the request carries Azure's deployment name. A different summary model resolves through Azure's existing model/group maps; self-summarization keeps the agent's resolved options. No SDK dependency update or new configuration field is required.
Azure's support table lists Astra function calling as Responses-only. Chat Completions remains available without tools; tools are attached after configuration, so the default is chosen at configuration time.
Change Type
Testing
npx tsc --noEmitpassed inpackages/api;packages/data-provideralso passed for the original comment-only change. ESLint, formatting, import sorting, and pre-commit static checks passed.calculator,reasoning_effort: low, and nouseResponsesApisetting returned4for2 + 2; after reloading, it called the calculator again and returned12. The subsequent URL and compaction changes are covered by the SDK tests above.npm run lighthousecompleted the production build, but the local audit failed during Chrome's temporary-profile cleanup with WindowsEPERM. Lighthouse CI passed on the previous reviewed commit; the updated commit needs its own CI result.Checklist