feat(providers): honor Azure reasoning profiles#199
Conversation
Greptile SummaryThis PR wires Azure reasoning configurations end-to-end through the Azure v1 Responses API rather than Chat Completions, preserving reasoning effort, deployment alias, and usage identity across every call path. The changes also add per-provider tagging of reasoning snapshots so Azure and OpenAI Responses encrypted state cannot be replayed across provider boundaries.
Confidence Score: 5/5Safe to merge — all reasoning call paths are well-tested, the trusted-endpoint credential boundary is preserved for both the Chat Completions and Responses clients, and the snapshot isolation between Azure and OpenAI providers is correctly enforced. Every new code path (text-only reasoning via Responses, structured tool calls, receipt building, cross-provider snapshot rejection, and structured-tool verify) is covered by unit and transport-level tests. The credential security model for untrusted config-controlled endpoints is correctly carried forward to the new Responses client. No logic gaps or unguarded failure modes were found. No files require special attention. The most complex file, azure_openai.py, has matching transport-level httpx tests that exercise the exact URL, header, and credential behaviour. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["complete() / complete_chat()"] --> B{"reasoning_effort set?"}
B -- "No" --> C["_get_client() → AzureOpenAI\nChat Completions endpoint"]
B -- "Yes" --> D["_get_responses_client() → OpenAI\nbase_url = endpoint/openai/v1/\napi-version=v1"]
C --> E["_openai_common.complete/complete_chat()"]
D --> F["_responses_common.complete_chat()\nsnapshot_provider=azure\nallow_sampling=False\nreceipt_provider=azure"]
F --> G["responses_request()\nreasoning={effort}\nmax_output_tokens"]
F --> H["with_raw_response.create()\ncaptures apim-request-id"]
H --> I["responses_response()\npreserves id, system_fingerprint\ntags snapshot with azure"]
I --> J["build_chat_provider_receipt()\nmax_tokens_field=max_output_tokens"]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["complete() / complete_chat()"] --> B{"reasoning_effort set?"}
B -- "No" --> C["_get_client() → AzureOpenAI\nChat Completions endpoint"]
B -- "Yes" --> D["_get_responses_client() → OpenAI\nbase_url = endpoint/openai/v1/\napi-version=v1"]
C --> E["_openai_common.complete/complete_chat()"]
D --> F["_responses_common.complete_chat()\nsnapshot_provider=azure\nallow_sampling=False\nreceipt_provider=azure"]
F --> G["responses_request()\nreasoning={effort}\nmax_output_tokens"]
F --> H["with_raw_response.create()\ncaptures apim-request-id"]
H --> I["responses_response()\npreserves id, system_fingerprint\ntags snapshot with azure"]
I --> J["build_chat_provider_receipt()\nmax_tokens_field=max_output_tokens"]
Reviews (5): Last reviewed commit: "fix(providers): reject Azure usage alias..." | Re-trigger Greptile |
|
Closing because this branch is superseded and is not intended for merge. Exact head preserved: 4e2786f. No branch was deleted. |
Scope
This branch explored reusable Azure reasoning support:
Disposition
The branch is stacked on superseded work and is closed without merge. The focused provider changes will be rebuilt on current main.