Description
OpenCode's AI SDK adapter receives the provider's normalized response.modelId on every finish-step, but drops it before the assistant turn is persisted. Clients therefore see only the requested alias (provider/auto), not the response model.
Preserve response.modelId as optional step-finish metadata so clients can report the model used for that turn. This does not persist response headers.
Related to #26091, which asks to expose raw response headers. This issue is the narrower structured-model path and blocks pingdotgg/t3code#6536.
Plugins
None
OpenCode version
1.15.13
Steps to reproduce
- Configure an OpenAI-compatible provider with an alias such as
auto.
- Return a different
model in the completion stream.
- Inspect the assistant message events.
- The assistant reports
provider/auto; the response model ID is absent.
Screenshot and/or share link
pingdotgg/t3code#6536
Operating System
Windows 11
Terminal
T3 Code / OpenCode SDK
Description
OpenCode's AI SDK adapter receives the provider's normalized
response.modelIdon everyfinish-step, but drops it before the assistant turn is persisted. Clients therefore see only the requested alias (provider/auto), not the response model.Preserve
response.modelIdas optional step-finish metadata so clients can report the model used for that turn. This does not persist response headers.Related to #26091, which asks to expose raw response headers. This issue is the narrower structured-model path and blocks pingdotgg/t3code#6536.
Plugins
None
OpenCode version
1.15.13
Steps to reproduce
auto.modelin the completion stream.provider/auto; the response model ID is absent.Screenshot and/or share link
pingdotgg/t3code#6536
Operating System
Windows 11
Terminal
T3 Code / OpenCode SDK