-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Background
The Copilot SDK v0.1.30 (released March 3, 2026) introduces session.setModel() for mid-session model switching, implemented by Patrick Nikoletich in commit bd98e3a.
This new API allows changing the model mid-conversation without destroying the session, preserving conversation history while taking advantage of different model capabilities.
Proposal
Implement dynamic model selection during the Execute phase to optimize cost and performance:
-
Add model configuration to Task schema - Allow users to specify which model to use per task (e.g.,
gpt-4.1for complex planning,gpt-5-minifor simple file operations) -
Implement model switching in executor.ts - Before dispatching each task, call
session.setModel(task.model)to switch to the appropriate model for that specific task -
Add UI controls in Refine screen - Allow users to assign models to tasks during the refinement phase (similar to how dependencies are edited)
-
Smart defaults - Automatically suggest models based on task complexity:
- Complex tasks (with many dependencies, long descriptions) →
gpt-4.1orclaude-sonnet-4 - Simple tasks (single file edits, basic operations) →
gpt-5-mini - Parallel batch optimization → use faster models for independent simple tasks
- Complex tasks (with many dependencies, long descriptions) →
Benefit
- Cost optimization: Use cheaper/faster models for simple tasks, reserve expensive models for complex planning
- Performance improvement: Faster model = quicker execution for straightforward tasks
- Flexibility: Users can fine-tune the model selection strategy for their specific workload
- Session preservation: No need to recreate sessions when switching models, maintains conversation context
Acceptance Criteria
-
Taskmodel insrc/models/plan.tsincludes optionalmodel?: stringfield -
src/services/executor.tscallssession.setModel()before dispatching tasks with custom models - Task editor in
src/screens/refine.tsxallows selecting model from dropdown - Default model selection logic suggests appropriate models based on task complexity heuristics
- Session events display model_change events in the Execute screen
- Tests verify model switching behavior in
src/services/executor.test.ts - Documentation in README explains model selection strategy
AI generated by Weekly Enhancement Suggestions