feat: auto-inject COPILOT_PROVIDER_WIRE_API=responses for GPT-5 models in sandboxed Copilot workflows#31249
Closed
Copilot wants to merge 3 commits into
Closed
feat: auto-inject COPILOT_PROVIDER_WIRE_API=responses for GPT-5 models in sandboxed Copilot workflows#31249Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…s in sandboxed Copilot workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix sandboxed workflows to set responses wire API for GPT-5
feat: auto-inject COPILOT_PROVIDER_WIRE_API=responses for GPT-5 models in sandboxed Copilot workflows
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Feature
Sandboxed
engine: copilotworkflows activate BYOK/offline mode via a dummyCOPILOT_API_KEY, which routes all Copilot CLI traffic through the AWF api-proxy sidecar. In BYOK mode the wire API defaults tocompletions, but GPT-5 family models requireresponses— so any sandboxed workflow targeting a GPT-5 model silently fails unless the user manually setsCOPILOT_PROVIDER_WIRE_APIor disables the sandbox (sacrificing safe-output threat detection).What does this feature do?
The compiler now automatically injects
COPILOT_PROVIDER_WIRE_API: responseswhen a GPT-5 family model is statically detected and the AWF sandbox is enabled. User-supplied values inengine.envalways take precedence.Implementation details
pkg/constants/engine_constants.go— AddedCopilotProviderWireAPI("COPILOT_PROVIDER_WIRE_API") andCopilotProviderWireAPIResponses("responses") constants alongside the existing BYOK constants.pkg/workflow/copilot_engine_execution.go— AddedcopilotModelRequiresResponsesAPI(model string) boolhelper that strips provider prefix and query params then matchesgpt-5*(case-insensitive). InGetExecutionSteps, inside theif sandboxEnabledblock, injects the wire API env var when the model is statically configured, GPT-5 family, and not already overridden by the user:Handles bare names (
gpt-5), provider-scoped names (copilot/gpt-5), and parameterized names (gpt-5?effort=high).pkg/workflow/copilot_engine_test.go— AddedTestCopilotModelRequiresResponsesAPI(14 cases covering GPT-5 variants, non-GPT-5 models, edge cases) andTestCopilotEngineSetsWireAPIForGPT5Models(7 cases covering injection, non-injection, and user-override scenarios).docs/src/content/docs/reference/engines.md— Updated the BYOK variable table to document automatic injection.