fix(app): apply agent model to new sessions by LLawliet444 · Pull Request #38372 · anomalyco/opencode · GitHub
Skip to content

fix(app): apply agent model to new sessions - #38372

Closed
LLawliet444 wants to merge 1 commit into
anomalyco:devfrom
LLawliet444:codex/fix-new-session-model
Closed

LLawliet444 wants to merge 1 commit into
anomalyco:devfrom
LLawliet444:codex/fix-new-session-model

Conversation

@LLawliet444

@LLawliet444 LLawliet444 commented Jul 22, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #38333

Type of change

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

What does this PR do?

Selecting an agent in a new session updated the Local draft model, but left the prompt composer's previously selected model unchanged. The prompt model has higher resolution priority, so the first submitted message could use the stale model rather than the selected agent's configured model.

This change synchronizes the prompt model after selecting an agent in a new session. If the selected agent has no configured model, it clears the stale prompt model so the normal fallback selection applies. A later explicit model selection still updates the prompt model normally.

How did you verify your code works?

  • Added regression tests for selecting an agent with a configured model and selecting one without a configured model.
  • Ran bun test --conditions=browser --preload ./happydom.ts src/pages/session/composer/session-composer-controls.test.ts.
  • Ran bun typecheck; the push hook also completed the workspace typecheck successfully.
  • Ran bun run test:unit: 627 tests passed; one existing Arabic i18n parity failure is unrelated to this change.

Screenshots / recordings

No visual layout change; this fixes the model selected for a new session.

Checklist

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

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.

New Session uses the wrong model when an agent is selected

1 participant