pi-mono/packages/coding-agent/src/core
Justin Santer a37306d437
feat(ai): support Azure Foundry Chat Completions deployments (#9714)
* feat(ai): support Azure Foundry Chat Completions deployments

The Azure provider only implemented the Responses API, so Foundry
deployments that speak Chat Completions could not be used. On Chat
Completions the deepseek/deepseek-v4-pro model sends `thinking` and
`prompt_cache_key`, both of which Azure rejects with 400.

The provider now dispatches openai-completions alongside
azure-openai-responses. A stream wrapper resolves the Azure endpoint
onto the model first, since the shared openai-completions
implementation reads it off the model.

The request-shape differences are catalog compat rather than api code:
reasoning_effort instead of DeepSeek's thinking field, no prompt cache
parameters, reasoning_content kept on assistant turns so the prefix
Foundry cached stays byte-identical, and effort clamped to the
low/medium/high the deployment accepts.

The provider is renamed from azure-openai-responses to azure, since it
now serves more than the Responses API. The azure-openai-responses api
id is unchanged. Breaking: auth.json and models.json entries keyed on
azure-openai-responses must move to azure, and existing sessions see a
different provider on their next turn.

closes #9645

* feat(ai): apply the Azure deployment name map to Chat Completions

The Responses path already sent the deployment name from
AZURE_OPENAI_DEPLOYMENT_NAME_MAP. The Chat Completions path sent the
catalog model id, so any deployment not named after the model 404'd.

The Azure provider now swaps the deployment name into the request via
onPayload before dispatch, then runs the caller's own onPayload on it.
model.id stays the catalog id. The map helpers move to
azure-openai-config.ts so the provider can share them without
importing the SDK.

* docs(ai,coding-agent): add changelog entries for the Azure provider rename

Breaking: the azure-openai-responses provider is now azure. Users rename
the key in auth.json, models.json, and settings.json; SDK users switch to
getModel("azure", ...) and providers/azure.

Also note Azure Foundry Chat Completions support (DeepSeek V4 Pro).

---------

Co-authored-by: David Brailovsky <davidbrai@gmail.com>
2026-10-05 09:46:48 +02:00
..
compaction feat(coding-agent): report codemode classifier and nested tool usage in session cost 2026-09-29 16:21:39 +02:00
export-html fix(coding-agent): render MCP tool calls before their server connects 2026-10-03 13:54:18 +02:00
extensions fix(coding-agent): render MCP tool calls before their server connects 2026-10-03 13:54:18 +02:00
tools feat(coding-agent): save codemode image() output to temp files 2026-10-04 23:32:43 +02:00
agent-session-runtime.ts fix(coding-agent): save new session file at the first user message 2026-09-25 16:27:51 +02:00
agent-session-services.ts feat(coding-agent): Virtual models (#10035) 2026-09-28 23:30:45 +02:00
agent-session.ts fix(coding-agent): render MCP tool calls before their server connects 2026-10-03 13:54:18 +02:00
auth-guidance.ts
auth-storage.ts fix(coding-agent): preserve managed state file permissions 2026-08-22 01:19:25 +02:00
bash-executor.ts feat(coding-agent): save codemode image() output to temp files 2026-10-04 23:32:43 +02:00
bug-report-upload.ts feat(coding-agent): add bug reporting 2026-09-19 17:55:49 +02:00
bug-report.ts feat(ai,coding-agent): add alternative sign in for the openai provider 2026-09-29 17:16:15 +02:00
cache-stats.ts feat(coding-agent): add prompt cache warming (#9668) 2026-09-19 21:18:15 +02:00
cache-warmer.ts fix(coding-agent): skip late cache warming refreshes 2026-09-20 15:53:22 +02:00
crash-log.ts refactor(coding-agent): resolve built-in extensions as builtin:<name> paths (#10159) 2026-09-29 10:51:01 +02:00
defaults.ts fix(coding-agent): keep model and thinking level changes session scoped (#8356) 2026-08-19 16:48:29 +02:00
diagnostics.ts
event-bus.ts
exec.ts
experimental.ts feat(coding-agent): prefer strict sampling for built-in tools by default 2026-09-05 23:54:20 +02:00
footer-data-provider.ts docs(coding-agent): clarify custom footer usage APIs (#8482) 2026-08-23 23:34:08 +02:00
http-dispatcher.ts fix(coding-agent): tunnel proxied HTTP requests 2026-09-02 09:23:23 +02:00
index.ts fix(coding-agent): keep prompt and tool state across context handlers (#9846) 2026-09-21 17:14:22 +02:00
keybindings.ts fix(coding-agent,tui): paste Finder file paths instead of icons (#10136) 2026-09-28 20:59:29 +01:00
mcp-servers.ts feat(coding-agent): opt-in MCP OAuth client ID metadata documents 2026-10-02 16:02:43 +02:00
messages.ts Mid conversation system messages (#9548) 2026-09-16 15:54:07 +02:00
model-config.ts feat(ai): add per-thinking-level sampling parameters (#9776) 2026-10-04 01:29:01 +02:00
model-registry.ts feat(coding-agent): add models.generateImages() to codemode 2026-10-01 16:50:29 +02:00
model-resolver.ts feat(ai): support Azure Foundry Chat Completions deployments (#9714) 2026-10-05 09:46:48 +02:00
model-runtime.ts fix(coding-agent): mark native providers with stored credentials as configured on registration (#10190) 2026-09-29 22:16:56 +02:00
models-store.ts fix(coding-agent): normalize UTF-8 BOMs in text inputs 2026-08-19 14:11:02 +02:00
nested-tool-calls.ts feat(coding-agent): report codemode classifier and nested tool usage in session cost 2026-09-29 16:21:39 +02:00
output-guard.ts fix(coding-agent): retry RPC stdout backpressure 2026-05-24 22:59:35 +02:00
package-manager.ts refactor(coding-agent): resolve built-in extensions as builtin:<name> paths (#10159) 2026-09-29 10:51:01 +02:00
pi-manifest.ts fix(coding-agent): normalize UTF-8 BOMs in text inputs 2026-08-19 14:11:02 +02:00
project-trust.ts fix(coding-agent): use APP_NAME in user-facing messages (#8067) 2026-08-14 11:26:20 +02:00
prompt-templates.ts fix(coding-agent): report invalid prompt frontmatter (#9830) 2026-09-21 15:22:17 +02:00
provider-attribution.ts fix(coding-agent): remove Vercel AI Gateway attribution 2026-07-03 15:14:01 +02:00
provider-composer.ts feat(ai): add per-thinking-level sampling parameters (#9776) 2026-10-04 01:29:01 +02:00
radius.ts feat(coding-agent): offer Radius sign-in and MCP setup in /login 2026-10-01 15:12:24 +02:00
remote-catalog-provider.ts fix(coding-agent): merge remote catalog models in linear time 2026-09-30 14:33:58 +02:00
resolve-config-value.ts fix(coding-agent): run legacy WSL bash commands via stdin 2026-06-19 15:08:25 +02:00
resource-loader.ts fix(extensions): show warning when replaceable builtin replaced (#10174) 2026-09-29 16:37:51 +02:00
runtime-credentials.ts fix(coding-agent): make model refresh cancellation caller-owned 2026-08-04 00:03:52 +02:00
sdk.ts feat(coding-agent): enable tools newly added to defaultTools on reload 2026-09-30 17:55:25 +02:00
session-cwd.ts
session-export.ts feat(coding-agent): add bug reporting 2026-09-19 17:55:49 +02:00
session-manager.ts fix(tui,coding-agent): reduce render cost of theme changes and streaming 2026-09-29 08:23:46 +02:00
settings-diagnostics.ts fix(coding-agent): report settings diagnostic paths 2026-08-19 13:07:53 +02:00
settings-manager.ts feat(coding-agent): shrink codemode prompt and guide scripts back from errors 2026-10-01 18:27:23 +02:00
skills.ts fix(coding-agent): keep skills available with bash-only tools (#8552) 2026-09-03 11:08:26 +02:00
slash-commands.ts feat(coding-agent): add bug reporting 2026-09-19 17:55:49 +02:00
source-info.ts refactor(coding-agent): resolve built-in extensions as builtin:<name> paths (#10159) 2026-09-29 10:51:01 +02:00
system-prompt.ts feat(coding-agent): shrink codemode prompt and guide scripts back from errors 2026-10-01 18:27:23 +02:00
telemetry.ts
timings.ts fix(coding-agent): preserve extension timing measurements 2026-06-25 02:07:32 -05:00
trust-manager.ts feat(coding-agent): codemode and MCP 2026-09-29 09:12:50 +02:00
usage-totals.ts feat(coding-agent): report codemode classifier and nested tool usage in session cost 2026-09-29 16:21:39 +02:00
virtual-models.ts fix(coding-agent): resolve branch model selection with one catalog lookup 2026-09-30 14:20:03 +02:00