Skip to content

fix(plugin): preserve selected model across messages#2797

Merged
code-yeongyu merged 1 commit intodevfrom
fix/2353-model-selection-persistence
Mar 24, 2026
Merged

fix(plugin): preserve selected model across messages#2797
code-yeongyu merged 1 commit intodevfrom
fix/2353-model-selection-persistence

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented Mar 24, 2026

Summary

  • Reuse the current main session's selected model during config-time agent rebuilds when config.model is missing.
  • Keep explicit config.model precedence unchanged, so direct UI-provided model selections still win when present.
  • Add regressions proving primary-agent config loading falls back to persisted session model instead of snapping back to the default model.

Verification

  • bun test src/plugin-handlers/agent-config-handler.test.ts
  • bun test src/plugin-handlers/config-handler.test.ts src/plugin/chat-message.test.ts
  • bun run typecheck
  • bun run build

Context


Summary by cubic

Preserves the user's selected model across messages by reusing the main session model during agent rebuilds when config.model is missing, fixing #2353. Explicit config.model still takes precedence.

  • Bug Fixes
    • Added resolveCurrentModel to prefer config.model, else fall back to the main session model from getMainSessionID and getSessionModel.
    • Updated applyAgentConfig to use the resolved model so sessions don’t snap back to the default after each send.
    • Added tests to cover session model reuse and precedence over config.model.

Written for commit bad70f5. Summary will update on new commits.

Reuse the current session's selected model during config-time agent rebuilds when config.model is missing, so desktop sessions do not snap back to the default model after each send.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <[email protected]>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: The changes safely introduce a fallback to session-scoped model state when configuration is missing, maintaining explicit precedence for user config with verified test coverage.

@code-yeongyu code-yeongyu merged commit e691303 into dev Mar 24, 2026
8 checks passed
@code-yeongyu code-yeongyu deleted the fix/2353-model-selection-persistence branch March 24, 2026 08:54
code-yeongyu added a commit that referenced this pull request Mar 24, 2026
…ection-persistence"

This reverts commit e691303, reversing
changes made to d4aee20.
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.

[Bug]: Every time I send a message, the model always resets to "Claude Opus 4.6" in windows desktop

1 participant