BYOK provider with openai wireApi "responses" — maxOutputTokens not applied
Summary
When using a BYOK ProviderConfig with type: "openai" and wireApi: "responses", the maxOutputTokens field set on the provider is not forwarded to the OpenAI Responses API request body. Output gets truncated at the OpenAI default (~1024 tokens).
SDK version
@github/copilot-sdk@1.0.0
Reproduction
const provider: ProviderConfig = {
type: "openai",
baseUrl: "...",
apiKey: "...",
maxOutputTokens: 64000,
maxPromptTokens: 936000,
wireApi: "responses",
};
const sessionConfig: SessionConfig = {
provider,
model: "<openai-model>",
modelCapabilities: {
limits: {
max_context_window_tokens: 1_000_000,
max_prompt_tokens: 936_000,
// Note: ModelCapabilitiesOverride.limits has no max_output_tokens field
},
},
// ...
};
Expected
OpenAI Responses request body should include max_output_tokens: 64000 (or the user-supplied value).
Actual
max_output_tokens is absent / undefined in the outbound request
- Response is truncated at ~1024 tokens (OpenAI default)
- No way to override:
ModelCapabilitiesOverride.limits does not expose max_output_tokens, and ProviderConfig.maxOutputTokens is ignored on the responses wire path
Works correctly
- Anthropic provider —
Provider.maxOutputTokens is honored
- OpenAI with
wireApi: "chat" (untested — please confirm)
Impact
BYOK users on OpenAI Responses cannot configure output length. Long-output scenarios (code generation, reports) are silently truncated.
Possible fixes
- Forward
ProviderConfig.maxOutputTokens to the Responses API request body
- Or add
max_output_tokens to ModelCapabilitiesOverride.limits
BYOK provider with openai wireApi "responses" — maxOutputTokens not applied
Summary
When using a BYOK
ProviderConfigwithtype: "openai"andwireApi: "responses", themaxOutputTokensfield set on the provider is not forwarded to the OpenAI Responses API request body. Output gets truncated at the OpenAI default (~1024 tokens).SDK version
@github/copilot-sdk@1.0.0Reproduction
Expected
OpenAI Responses request body should include
max_output_tokens: 64000(or the user-supplied value).Actual
max_output_tokensis absent / undefined in the outbound requestModelCapabilitiesOverride.limitsdoes not exposemax_output_tokens, andProviderConfig.maxOutputTokensis ignored on theresponseswire pathWorks correctly
Provider.maxOutputTokensis honoredwireApi: "chat"(untested — please confirm)Impact
BYOK users on OpenAI Responses cannot configure output length. Long-output scenarios (code generation, reports) are silently truncated.
Possible fixes
ProviderConfig.maxOutputTokensto the Responses API request bodymax_output_tokenstoModelCapabilitiesOverride.limits