Enable model switching for active sessions#100
Merged
Conversation
Add ChangeModelAsync to CopilotService that switches the model of a running session by disposing the current SDK connection and resuming with a new ResumeSessionConfig.Model. The session ID and history are preserved server-side — only the backend model changes. - Enable the model dropdown for active sessions (was previously disabled when history > 0). Now only disabled while processing. - Update SetExpandedModel in Dashboard to call ChangeModelAsync for sessions with history. - ChangeModelAsync guards: no-op if already on the requested model, blocks during processing, normalizes model slug.
Show display names (e.g. 'Claude Opus 4.5') instead of raw slugs in the inline model selector and info panel, matching the ModelSelector component used in the sidebar.
- PrettifyModel now replaces all remaining hyphens with spaces (except GPT- prefix) - Added tests for prettify output, no-duplicate-hyphens, round-trip with NormalizeToSlug - Fixed in both ExpandedSessionView.razor and ModelSelector.razor
PureWeen
added a commit
that referenced
this pull request
Mar 25, 2026
) ## Problem The orchestrator dispatch prompt led with **"Assign ALL workers that have relevant work"** which caused models to invent micro-tasks to fill all 5 workers even for single-item requests. For example, a single PR re-review would get split into: - Worker-1: check commits - Worker-2: do 5-model dispatch - Worker-3: grep one file - Worker-4: build and test - Worker-5: grep another file This wastes resources and makes sessions appear stuck (all 5 workers busy for 10+ minutes on what should be a single-worker job). ## Fix Flip the emphasis so the **default is ONE worker** and fan-out is the exception: - `Assign the MINIMUM number of workers needed` - `Do NOT split a single task into micro-tasks across workers` - Only fan out for genuinely independent tasks (e.g., "review PR #100 and PR #200") ## History - **Mar 10** (`a79f9f40`): Introduced aggressive fan-out with retry loop - **Mar 12** (`9c58ebf0`): Removed retry loop, added "only relevant" caveat - **This PR**: Flips the default from "assign all" to "assign minimum" --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
arisng
pushed a commit
to arisng/PolyPilot
that referenced
this pull request
Apr 4, 2026
…ureWeen#429) ## Problem The orchestrator dispatch prompt led with **"Assign ALL workers that have relevant work"** which caused models to invent micro-tasks to fill all 5 workers even for single-item requests. For example, a single PR re-review would get split into: - Worker-1: check commits - Worker-2: do 5-model dispatch - Worker-3: grep one file - Worker-4: build and test - Worker-5: grep another file This wastes resources and makes sessions appear stuck (all 5 workers busy for 10+ minutes on what should be a single-worker job). ## Fix Flip the emphasis so the **default is ONE worker** and fan-out is the exception: - `Assign the MINIMUM number of workers needed` - `Do NOT split a single task into micro-tasks across workers` - Only fan out for genuinely independent tasks (e.g., "review PR PureWeen#100 and PR PureWeen#200") ## History - **Mar 10** (`a79f9f40`): Introduced aggressive fan-out with retry loop - **Mar 12** (`9c58ebf0`): Removed retry loop, added "only relevant" caveat - **This PR**: Flips the default from "assign all" to "assign minimum" --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature
Enables switching the model on active sessions that already have conversation history. Previously the model dropdown was disabled once any messages were sent.
How it works
ChangeModelAsyncdisposes the current SDKCopilotSessionconnection and resumes the same session ID with a newResumeSessionConfig { Model = newModel }. The session history is preserved server-side — only the backend model changes. This is the same mechanism the Copilot CLI uses internally via its/modelslash command.Changes
CopilotService.ChangeModelAsync— new method that reconnects with a different modelExpandedSessionView.razor— dropdown now only disabled while processing (was disabled when history > 0)Dashboard.razor—SetExpandedModelcallsChangeModelAsyncfor active sessionsGuards
IsProcessing)OnErrorTesting
Built and tested: 191 tests pass. Manual testing needed to verify the backend honors the model change on resume.