Skip to content

feat(llm): add OpenAI Responses provider with GPT-5.6 models - #587

Closed
aalhadxx wants to merge 5 commits into
alibaba:mainfrom
aalhadxx:feat-openai-responses-573
Closed

feat(llm): add OpenAI Responses provider with GPT-5.6 models#587
aalhadxx wants to merge 5 commits into
alibaba:mainfrom
aalhadxx:feat-openai-responses-573

Conversation

@aalhadxx

Copy link
Copy Markdown
Contributor

Problem

GPT-5.6 models (gpt-5.6-luna, gpt-5.6-terra, gpt-5.6-sol) require the OpenAI Responses API (/v1/responses). When these models are used with the standard openai provider (which uses /v1/chat/completions), the platform returns:

Function tools with reasoning_effort are not supported for gpt-5.6-terra in /v1/chat/completions.

Fix

Add a dedicated openai-responses preset provider that uses ProtocolOpenAIResponses and includes the GPT-5.6 model family. Users can now select this provider to use these models without manual protocol configuration.

Test

  • Updated TestListProviders_Order to include the new provider.
  • Added TestLookupProvider_OpenAIResponsesModels to verify the provider exists, uses the correct protocol, and lists the expected models.

Fixes #573
Closes #559

On Windows, npm is shipped as npm.cmd. Without shell: true, Node's
spawn fails to execute batch files, causing the VS Code extension to
falsely report 'npm not detected' even when it is installed.

The install() method already used this flag; apply the same fix to
probeCommand (environment detection) and runRaw (CLI execution).

Fixes alibaba#453
@CLAassistant

CLAassistant commented Jul 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 3 issue(s) in this PR.

  • ✅ Successfully posted inline: 3 comment(s)

Comment thread cmd/opencodereview/config_cmd.go Outdated
Comment thread cmd/opencodereview/config_cmd.go
Comment thread extensions/vscode/src/extension/services/CliService.ts
aalhadxx added 4 commits July 29, 2026 23:54
Reverts shell: true in runRaw to address security feedback:
runRaw args may include user-controlled values (opts.from, opts.to,
opts.customPrompt), and shell mode could interpret cmd.exe
metacharacters.

Keep shell: true only in probeCommand where args are known-safe
(--version). The original bug (alibaba#453) was specifically about
environment detection failing on Windows, so this targeted fix is
sufficient.
…ive provider

When a provider is active, llm.* settings are discarded at runtime because
the resolver checks cfg.Provider first and invokes tryProviderConfig,
leaving tryLegacyLlmConfig as the fallback path.

- runConfigSet: issue a stderr warning when llm.* values are written
  while a provider is present.
- runConfigUnset: enable unsetting the provider and model fields.

Fixes alibaba#583
GPT-5.6 models (luna, terra, sol) require the OpenAI Responses API
(/v1/responses) instead of the legacy Chat Completions endpoint. Using
these models with the standard openai provider causes 400 errors because
the Responses API is the only endpoint that supports reasoning_effort
with these models.

Add a dedicated openai-responses preset that uses ProtocolOpenAIResponses
so users can select these models without manual protocol configuration.

Fixes alibaba#573
Closes alibaba#559
- Improve warning wording: clarify that llm.* values are saved but
  will have no effect while a provider is active.
- Fix unset model: when a provider is active, clear the model from
  the provider entry (not just cfg.Model), matching the set logic.
- Add warning when unsetting provider also clears the model.
@aalhadxx
aalhadxx force-pushed the feat-openai-responses-573 branch from cb71a68 to e4eb1eb Compare July 29, 2026 18:27
@lizhengfeng101

Copy link
Copy Markdown
Collaborator

Hi @aalhadxx, thanks for adding the openai-responses provider — the core implementation looks clean and well-tested.

However, this PR bundles three unrelated changes together:

  1. openai-responses provider (the intended feature) ✅
  2. config set/unset improvements — these conflict with changes already merged on main (e.g., legacyLLMShadowWarning, unsetActiveProvider from fix(config): warn when active provider shadows llm settings #588). The inline warning in this PR is a simpler duplicate of what's already landed.
  3. VSCode CliService Windows shell fix — unrelated to the provider feature.

Suggestion: Could you please:

  1. Rebase onto latest main to pick up the already-merged config improvements.
  2. Keep only the core openai-responses provider changes (internal/llm/providers.go, internal/llm/providers_test.go).
  3. Remove the config and VSCode changes from this PR. If those fixes are still needed after rebasing, they'd be better as separate PRs.

This will make the PR much easier to review and merge. Thanks!

@aalhadxx

Copy link
Copy Markdown
Contributor Author

Closing this PR because upstream already merged OpenAI Responses API support in #363 (f58b0f2). The feature is now available in main. Thanks for the review feedback regardless!

@aalhadxx aalhadxx closed this Jul 31, 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

3 participants