feat(models): add live session model switching and /init skill#199
feat(models): add live session model switching and /init skill#199lavaman131 merged 2 commits intomainfrom
Conversation
…it skill Replace the static CLAUDE.md/AGENTS.md template files that were copied during `atomic init` with a new `/init` builtin skill that dynamically explores the codebase and generates populated project documentation. - Remove CLAUDE.md, AGENTS.md, MODULE_DOCUMENTATION.md, and .atomic/settings.json template files - Remove additional_files/preserve_files references from agent configs - Add `/init` builtin skill that uses sub-agents to discover project metadata and generate tailored CLAUDE.md/AGENTS.md - Reformat skill-commands.ts to consistent 4-space indentation Assistant-model: Claude Code
Enable runtime model switching without requiring a new session for Claude and Copilot agents by adding setActiveSessionModel to the SDK client interface. - Add setActiveSessionModel to CodingAgentClient interface - Implement for ClaudeAgentClient (persists on session config for future turns) and CopilotClient (rebinds session with updated model) - Update UnifiedModelOperations to prefer SDK model setter over pendingModel/requiresNewSession fallback - Pass reasoning effort to Copilot during model switch - Fix model preference persistence to use effective model from modelOps rather than raw selected ID - Normalize Claude model preferences to canonical aliases (opus, sonnet, haiku) stripping provider prefixes Assistant-model: Claude Code
PR Review: fix(models): live session model switching and init skill refactorSummaryThis PR makes two significant changes:
Code Quality & Best PracticesStrengths
Issues
Potential Bugs & Issues
Performance Considerations
Security Concerns
Test CoverageGood:
Missing:
Suggestions
Overall AssessmentThe core model-switching functionality is well-implemented with proper abstraction through the Recommendation: Consider splitting this into two PRs:
|
Summary
This PR introduces two major improvements:
/initskill: Replace static template files with an intelligent codebase exploration skill that generates tailored project documentationKey Changes
Model Switching
setActiveSessionModeltoCodingAgentClientinterface (src/sdk/types.ts:623)UnifiedModelOperationsto prefer SDK-level model switching overpendingModelfallbackopus,sonnet,haiku) by stripping provider prefixesmodelOpsinstead of raw config/init Skill Refactor
CLAUDE.md,AGENTS.md,MODULE_DOCUMENTATION.md, and.atomic/settings.json/initbuiltin skill that dynamically explores the codebase using sub-agents (src/ui/commands/skill-commands.ts:1106)additional_filesandpreserve_filesreferences from agent configsOther Improvements
skill-commands.tsto consistent 4-space indentationsetActiveSessionModelbehaviorBreaking Changes
None. The changes are backwards compatible.
Test Plan
/initskill on a fresh project and verify generatedCLAUDE.md/AGENTS.mdare populatedbun test) to check for regressions