Skip to content

fix(opencode): preserve response model metadata - #42433

Open
KarmCraft wants to merge 2 commits into
anomalyco:devfrom
KarmCraft:actual-model-metadata
Open

fix(opencode): preserve response model metadata#42433
KarmCraft wants to merge 2 commits into
anomalyco:devfrom
KarmCraft:actual-model-metadata

Conversation

@KarmCraft

@KarmCraft KarmCraft commented Aug 13, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #42420

Related to #26091, but intentionally narrower: this keeps the AI SDK's structured model ID instead of arbitrary response headers.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenCode currently discards response.modelId when adapting AI SDK stream events. This carries that value on the corresponding step-finish part and exposes it as optional modelID in the session schema and generated SDK type. Response headers are not retained.

How did you verify your code works?

  • 44 focused session tests
  • typechecks for packages/llm, packages/schema, and packages/opencode
  • SDK regeneration
  • git diff --check

The full Windows pre-push typecheck is blocked by the upstream packages/enterprise/src/custom-elements.d.ts symlink being checked out as plain text. The affected package checks pass; CI can exercise the symlink on Linux.

Screenshots / recordings

Not applicable; this is session metadata only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hey! Your PR title Preserve response model metadata on assistant steps doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@KarmCraft KarmCraft changed the title Preserve response model metadata on assistant steps fix(opencode): preserve response model metadata Aug 13, 2026
@github-actions github-actions Bot removed needs:title needs:compliance This means the issue will auto-close after 2 hours. labels Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI SDK response model ID is discarded from assistant turns

1 participant