anomalyco / anomalyco/opencode

AI SDK response model ID is discarded from assistant turns

Open
#42,420 2 comments 0 reactions 1 assignee View on GitHub

@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
  1. Configure an OpenAI-compatible provider with an alias such as auto.
  2. Return a different model in the completion stream.
  3. Inspect the assistant message events.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.