Skip to content

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

Closed
KarmCraft wants to merge 1 commit into
anomalyco:devfrom
KarmCraft:actual-model-metadata
Closed

KarmCraft wants to merge 1 commit 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?

  • 47 focused session tests
  • typechecks for packages/llm, packages/schema, and packages/opencode
  • SDK regeneration
  • full pre-push Turbo typecheck: 30 packages
  • formatting and git diff --check

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. 👍

@KarmCraft
KarmCraft force-pushed the actual-model-metadata branch from 444f174 to 17707ea Compare September 11, 2026 15:04
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@KarmCraft

Copy link
Copy Markdown
Author

This contribution is still actively maintained and remains the prerequisite for pingdotgg/t3code#10726. I rebased it onto the current dev branch and force-pushed the exact-lease update at 3def0580e.

Current validation passes: 47 focused tests, the repository pre-push typecheck across all 30 participating packages, the four directly affected package typechecks, targeted oxlint with 0 errors, Prettier, and git diff --check.

The closure was the automated age/reaction cleanup rather than a code or review failure. Could a maintainer please reopen the PR for review?

@KarmCraft

Copy link
Copy Markdown
Author

Replacement PR: #49317. The implementation was rebased onto current dev and republished because this PR could not be reopened by the contributor account.

@KarmCraft

Copy link
Copy Markdown
Author

The current replacement for this contribution is #49571. It uses the same validated implementation head and supersedes automation-closed #49317.

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

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