Skip to content

feat(core): allow transient session generation model overrides - #52437

Closed
rekram1-node wants to merge 1 commit into
devfrom
generate-model
Closed

rekram1-node wants to merge 1 commit into
devfrom
generate-model

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Issue for this PR

Addresses item 4 only in #49389.

Type of change

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

What does this PR do?

Adds optional model: Model.Ref to session.generate across Core, HTTP, and both generated clients. Plugins inherit the same input. The override is resolved before history preparation and request hooks, without changing the stored session model or history.

Omitting model preserves the existing session-model and cache-key behavior. Selecting another model generally cannot reuse the original model's prompt cache; the docs call out that tradeoff. This is not a mutable model hook or an automatic cheap-model policy.

How did you verify your code works?

  • 50 focused Core tests passed, including default model selection, per-call override, variant forwarding, provider-scoped hooks, unchanged durable state, and returning to the default model.
  • Extended the existing HTTP instance test and Promise client contract test; both passed.
  • Regenerated clients, Protocol OpenAPI, and website API output. The OpenAPI refresh also includes pre-existing generated-file drift from current source.
  • bun run check, website generated-file check, and website build.

Known baseline: the broader Promise client test file expects file methods without write, which the current API already exposes. That unrelated assertion was left unchanged. The touched session contract test was updated to the current resume interrupt parameter.

Screenshots / recordings

Not applicable; no UI changes.

Checklist

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

@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:25
@github-actions

github-actions Bot commented Nov 1, 2026

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.

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.

1 participant