You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LLM response headers are discarded, preventing plugins from accessing proxy routing metadata #26091
When using a LiteLLM proxy with an auto router (complexity router, semantic router), the actual model selected by the router is returned in HTTP response headers like x-litellm-model-api-base and llm_provider-x-ms-deployment-name. The AI SDK captures these headers on the finish-step stream event (value.response.headers), but processor.ts only reads value.usage, value.providerMetadata, and value.finishReason — value.response is discarded entirely.
This means plugins cannot determine which model actually served a request when using proxy-based routing.
Expected behavior
Response headers from LLM provider HTTP responses should be available on the assistant message so plugins can access proxy routing metadata and other provider-specific response headers.
How to reproduce
Configure OpenCode with a LiteLLM proxy using a complexity/semantic router
Send a message through the router
Write a plugin listening for message.updated events
Observe that msg.responseHeaders does not exist — the plugin can only see the router alias in msg.modelID
OpenCode version
dev (latest)
Platform
macOS
Additional context
The APIError schema in the same file already has a responseHeaders field for error responses. This change extends the same pattern to successful responses.
The PR to add this functionality has been closed due to it being open for more than a month. I have requested that it be reopened. I belive as model usage cost increase the use of auto routers to hand simple tasks to cheaper models will increase and user will want to know which model is processing their prompt.
I belive as model usage cost increase the use of auto routers to hand simple tasks to cheaper models will increase and user will want to know which model is processing their prompt.
Also agreed! Please reopen; I want to know what the "smart routing" is actually up to (in this case, the header is x-bifrost-resolved-model), and I can't build a plugin to show me without access to the response headers.
Activity
jtbnz commentedon Jun 9, 2026
The PR to add this functionality has been closed due to it being open for more than a month. I have requested that it be reopened. I belive as model usage cost increase the use of auto routers to hand simple tasks to cheaper models will increase and user will want to know which model is processing their prompt.
piknockyou commentedon Jul 23, 2026
Agreed
antifun commentedon Aug 13, 2026
Also agreed! Please reopen; I want to know what the "smart routing" is actually up to (in this case, the header is
x-bifrost-resolved-model), and I can't build a plugin to show me without access to the response headers.bwebster commentedon Aug 13, 2026
This feature would be extremely useful when using an LLM gateway with smart router.
github-actions commentedon Oct 14, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.