Skip to content

fix: wrap copilot Responses-API models in CodexAuxiliaryClient for auxiliary tasks - #6953

Closed
hermes-agent-dhabibi wants to merge 3 commits into
NousResearch:mainfrom
hermes-agent-dhabibi:pr/copilot-responses-api-auxiliary
Closed

fix: wrap copilot Responses-API models in CodexAuxiliaryClient for auxiliary tasks#6953
hermes-agent-dhabibi wants to merge 3 commits into
NousResearch:mainfrom
hermes-agent-dhabibi:pr/copilot-responses-api-auxiliary

Conversation

@hermes-agent-dhabibi

Copy link
Copy Markdown
Contributor

Problem

GPT-5+ models (except gpt-5-mini) are only accessible via the Responses API on Copilot. When one of these models is configured as the auxiliary/compression summary_model with summary_provider: copilot, the plain OpenAI client sends the request to /chat/completions, which returns:

model "gpt-5.4-mini" is not accessible via the /chat/completions endpoint

Root Cause

resolve_provider_client() creates a plain OpenAI client for the copilot provider regardless of which model is requested. The CodexAuxiliaryClient adapter (which routes through responses.stream()) was only used for the openai-codex provider branch, not copilot.

Fix

After creating the OpenAI client in the copilot path, check _should_use_copilot_responses_api(model). If the model requires the Responses API, wrap the client in CodexAuxiliaryClient so call_llm() transparently routes through responses.stream().

Tests

  • test_copilot_responses_api_model_wrapped_in_codex_client — verifies gpt-5.4-mini gets wrapped in CodexAuxiliaryClient
  • test_copilot_chat_completions_model_not_wrapped — verifies gpt-4.1-mini stays as a plain OpenAI client

…xiliary tasks

GPT-5+ models (except gpt-5-mini) are only accessible via the Responses
API on Copilot. When these models were configured as the compression
summary_model (or any auxiliary task), the plain OpenAI client sent them
to /chat/completions which returned a 400 error:

    model "gpt-5.4-mini" is not accessible via the /chat/completions endpoint

resolve_provider_client() now checks _should_use_copilot_responses_api()
for the copilot provider and wraps the client in CodexAuxiliaryClient
when needed, routing calls through responses.stream() transparently.

Adds tests for both the wrapping (gpt-5.4-mini) and non-wrapping
(gpt-4.1-mini) paths.
@hermes-agent-dhabibi
hermes-agent-dhabibi force-pushed the pr/copilot-responses-api-auxiliary branch from 5e7e9b1 to f79fa17 Compare April 10, 2026 04:35
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #7541 with authorship preserved. Thanks for the contribution!

@teknium1 teknium1 closed this Apr 11, 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.

2 participants