Problem statement
Strip the OpenAI-only stream_options field from Copilot SDK BYOK requests whenever the resolved provider is type=anthropic. When the copilot-sdk driver runs in BYOK mode against an Anthropic-format endpoint (claude-sonnet-4.6 via api-proxy:10002), it sends a request containing stream_options, which the Anthropic Messages API does not accept. The upstream returns HTTP 400 stream_options: Extra inputs are not permitted, and the agent dies before emitting a single turn — a hard, deterministic failure.
Affected workflows and run IDs
- Daily Safe Output Integrator — §28614701337
- PR Triage Agent — §28613537448
- Both fail on all 4 retries with
agent_output.json = {"items":[],"errors":[]} (0 turns, 0 safe outputs). Because this is on the default Copilot engine + claude-sonnet-4.6 BYOK path, it likely explains additional reds in the same window.
Probable root cause
The copilot-sdk driver / api-proxy request builder unconditionally includes stream_options (an OpenAI Chat Completions streaming concept, e.g. stream_options.include_usage) when constructing the streaming request. For providers resolved as type=anthropic (see actions/setup/js/awf_reflect.cjs BYOK resolution → api-proxy:10002), the Anthropic Messages API rejects unknown top-level fields, yielding 400 stream_options: Extra inputs are not permitted. Retry logic does not reclassify it (isHTTP400ResponseError=false, isModelNotSupportedError=false), so all attempts fail identically.
Proposed remediation
- In the copilot-sdk BYOK request path, only attach
stream_options when the resolved provider type is an OpenAI-compatible endpoint; omit it for type=anthropic.
- Alternatively, have the
type=anthropic translation layer in the api-proxy (:10002) drop stream_options before forwarding upstream, mapping usage capture to Anthropic's native streaming usage events.
- Add a retry classifier for
isHTTP400ResponseError on stream_options / "Extra inputs are not permitted" so such config-shape errors surface a clear diagnostic instead of 4 silent identical retries.
Success criteria / verification
- Daily Safe Output Integrator and PR Triage Agent complete on the
claude-sonnet-4.6 BYOK path with ≥1 turn and non-empty agent_output.json.
- No
sdk-driver error: 400 ... stream_options lines in agent-stdio.log for type=anthropic providers.
- A regression test asserts the Copilot BYOK request builder omits
stream_options for type=anthropic providers.
Parent report: #43031
Analyzed runs: 28614701337, 28613537448
Generated by 🔍 [aw] Failure Investigator (6h) · 140.7 AIC · ⌖ 34.3 AIC · ⊞ 5.2K · ◷
Problem statement
Strip the OpenAI-only
stream_optionsfield from Copilot SDK BYOK requests whenever the resolved provider istype=anthropic. When the copilot-sdk driver runs in BYOK mode against an Anthropic-format endpoint (claude-sonnet-4.6viaapi-proxy:10002), it sends a request containingstream_options, which the Anthropic Messages API does not accept. The upstream returns HTTP 400stream_options: Extra inputs are not permitted, and the agent dies before emitting a single turn — a hard, deterministic failure.Affected workflows and run IDs
agent_output.json = {"items":[],"errors":[]}(0 turns, 0 safe outputs). Because this is on the default Copilot engine +claude-sonnet-4.6BYOK path, it likely explains additional reds in the same window.Probable root cause
The copilot-sdk driver / api-proxy request builder unconditionally includes
stream_options(an OpenAI Chat Completions streaming concept, e.g.stream_options.include_usage) when constructing the streaming request. For providers resolved astype=anthropic(seeactions/setup/js/awf_reflect.cjsBYOK resolution →api-proxy:10002), the Anthropic Messages API rejects unknown top-level fields, yielding400 stream_options: Extra inputs are not permitted. Retry logic does not reclassify it (isHTTP400ResponseError=false,isModelNotSupportedError=false), so all attempts fail identically.Proposed remediation
stream_optionswhen the resolved providertypeis an OpenAI-compatible endpoint; omit it fortype=anthropic.type=anthropictranslation layer in the api-proxy (:10002) dropstream_optionsbefore forwarding upstream, mapping usage capture to Anthropic's native streaming usage events.isHTTP400ResponseErroronstream_options/ "Extra inputs are not permitted" so such config-shape errors surface a clear diagnostic instead of 4 silent identical retries.Success criteria / verification
claude-sonnet-4.6BYOK path with ≥1 turn and non-emptyagent_output.json.sdk-driver error: 400 ... stream_optionslines inagent-stdio.logfortype=anthropicproviders.stream_optionsfortype=anthropicproviders.Parent report: #43031
Analyzed runs: 28614701337, 28613537448