Skip to content

fix(provider): route Azure GPT models through Chat Completions - #3818

Merged
kojiwakayama merged 1 commit into
mainfrom
fix/issue-548-gpt-chat
Aug 17, 2026
Merged

fix(provider): route Azure GPT models through Chat Completions#3818
kojiwakayama merged 1 commit into
mainfrom
fix/issue-548-gpt-chat

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route Veryfront Cloud gpt-5.4 and gpt-5.5 through Chat Completions because their Azure-backed gateway deployments do not expose the Responses API
  • keep Responses routing unchanged for gpt-5.2, gpt-5.4-mini, gpt-5.4-nano, and direct OpenAI models
  • preserve default reasoning by sending reasoning_effort: "medium" on the Chat Completions path
  • keep the routing exception in the existing model transport-capability catalog
  • reject OpenAI hosted tools before any request on a Chat Completions-only model, because those tools require Responses

Fixes veryfront/veryfront-issue-inbox#548.

RED-GREEN TDD

RED: the public Veryfront Cloud model path sent both affected models to /responses; an Azure Chat Completions stream then failed in the Responses parser with event type was missing.

GREEN: both models now use /chat/completions, accept the Azure prompt_filter_results preamble handled by #3817, stream text successfully, and retain medium reasoning effort.

A review RED then showed that forcing Chat Completions could silently omit openai.web_search. GREEN rejects the unsupported hosted tool for both generate and stream before any network request.

Verification

  • DENO_TESTING=1 deno test --preload=src/testing/preload.ts --no-check --allow-all src/provider/veryfront-cloud/provider.test.ts src/provider/veryfront-cloud/model-catalog.test.ts extensions/ext-llm-openai/src/openai-provider.test.ts (103 steps passed)
  • deno task --quiet typecheck
  • deno task --quiet lint
  • deno task docs:api-reference:check
  • deno fmt --check on changed TypeScript files
  • git diff --check

@kojiwakayama

kojiwakayama commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

@codex review exact head 62ece99

@github-actions

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 325 1937 KiB ✅ 0

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 83e277e0-31fa-4636-afe1-0d311a8c4906

📥 Commits

Reviewing files that changed from the base of the PR and between adbffa3 and cd7fae8.

📒 Files selected for processing (6)
  • extensions/ext-llm-openai/src/openai-provider.ts
  • src/provider/veryfront-cloud/model-catalog.test.ts
  • src/provider/veryfront-cloud/model-catalog.ts
  • src/provider/veryfront-cloud/openai.ts
  • src/provider/veryfront-cloud/provider.test.ts
  • src/provider/veryfront-cloud/provider.ts

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

OpenAI model creation now supports explicit Chat Completions and Responses transports, plus automatic routing. Veryfront Cloud resolves transport overrides from the model catalog and forwards them to OpenAI models. Tests cover GPT-5.4 and GPT-5.5 routing.

Changes

OpenAI transport selection

Layer / File(s) Summary
Runtime selection and validation
extensions/ext-llm-openai/src/openai-provider.ts
Validates transport values and constructs both runtimes. Explicit settings select the requested runtime. Automatic mode retains reasoning-model routing and adaptive fallback behavior.
Veryfront Cloud transport wiring
src/provider/veryfront-cloud/model-catalog.ts, src/provider/veryfront-cloud/openai.ts, src/provider/veryfront-cloud/provider.ts
Adds catalog transport metadata and resolution for GPT-5.4 and GPT-5.5. Forwards resolved transport settings to registry and fallback OpenAI models.
Transport routing validation
src/provider/veryfront-cloud/model-catalog.test.ts, src/provider/veryfront-cloud/provider.test.ts
Tests catalog resolution for direct and hosted model IDs. Tests Azure-backed GPT-5.4 and GPT-5.5 Chat Completions requests, generated text, endpoint selection, and medium reasoning effort.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to cd7fa

The change routes two Azure-backed models through Chat Completions while preserving existing routing and reasoning behavior; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant VeryfrontCloudProvider
  participant ModelCatalog
  participant OpenAIModelFactory
  participant ChatCompletionsRuntime
  VeryfrontCloudProvider->>ModelCatalog: resolve model transport
  ModelCatalog-->>VeryfrontCloudProvider: return override or undefined
  VeryfrontCloudProvider->>OpenAIModelFactory: create OpenAI model with transport
  OpenAIModelFactory->>ChatCompletionsRuntime: select Chat Completions when configured
  ChatCompletionsRuntime-->>VeryfrontCloudProvider: return generated response
Loading

Suggested reviewers: kwakayama

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: routing Azure GPT models through Chat Completions.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-548-gpt-chat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd7fae88b0

ℹ️ 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".

Comment thread extensions/ext-llm-openai/src/openai-provider.ts Outdated
@kojiwakayama
kojiwakayama force-pushed the fix/issue-548-gpt-chat branch from cd7fae8 to e3ade06 Compare August 17, 2026 12:13
@kojiwakayama
kojiwakayama force-pushed the fix/issue-548-gpt-chat branch from e3ade06 to 62ece99 Compare August 17, 2026 12:16
@kojiwakayama

Copy link
Copy Markdown
Contributor Author

Addressing the CodeRabbit docstring warning: the only new exported resolver, resolveVeryfrontCloudOpenAITransport, has public JSDoc, and the generated provider reference is committed. The repository's authoritative docs:api-reference:check passes with public-source coverage unchanged at 4,321/4,878. The remaining new helpers are private transport guards with explicit names, so no additional public reference copy is required.

@kojiwakayama

Copy link
Copy Markdown
Contributor Author

@codex review exact head 62ece99

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 62ece99dc0

ℹ️ 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".

@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit 5887da1 Aug 17, 2026
34 checks passed
@kojiwakayama
kojiwakayama deleted the fix/issue-548-gpt-chat branch August 17, 2026 12:38
This was referenced Aug 17, 2026
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