anomalyco / anomalyco/opencode
AI SDK response model ID is discarded from assistant turns
@nexxeln is already working on this.
Since Aug 13, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
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
modelin the completion stream. - Inspect the assistant message events.
- The assistant reports
provider/auto; the response model ID is absent.
Screenshot and/or share link
https://github.com/pingdotgg/t3code/issues/6536
Operating System
Windows 11
Terminal
T3 Code / OpenCode SDK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.