Skip to content

fix(chat): preserve session model selection - #30

Merged
chryzxc merged 1 commit into
mainfrom
fix/issue-25-session-model-selection
Aug 7, 2026
Merged

fix(chat): preserve session model selection#30
chryzxc merged 1 commit into
mainfrom
fix/issue-25-session-model-selection

Conversation

@chryzxc

@chryzxc chryzxc commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Fixes #25.\n\nSynchronizes ChatViewProvider prompt state after restoring per-session model and agent settings, so a prompt always uses the active session's selected model. Adds a regression test for the session-switch handoff.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c9eb1a17b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return this.modelAndAgentManager.applySessionSettings(sessionId);
await this.modelAndAgentManager.applySessionSettings(sessionId);
this.selectedModel = this.modelAndAgentManager.getSelectedModel();
this.selectedAgent = this.modelAndAgentManager.getSelectedAgent() ?? "build";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the manager's agent selection synchronized

When a user changes agents, the selectAgent handler updates ChatViewProvider.selectedAgent and persistence but never calls modelAndAgentManager.setSelectedAgent. If the next loaded session has no persisted agent—for example, a legacy session—ModelAndAgentManager.applySessionSettings intentionally retains its stale or undefined value, and this new assignment overwrites the user's latest selection with that value (often build), causing the next prompt to use the wrong agent. Synchronize the manager in the selection handler or avoid copying its agent state here.

Useful? React with 👍 / 👎.

@chryzxc
chryzxc merged commit 136a87a into main Aug 7, 2026
1 check passed
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.

Session-specific model selection is not preserved when switching sessions

1 participant