feat(agents): custom models for sub-agents (forge, sage, muse)#2705
Open
chengyixu wants to merge 2 commits intoantinomyhq:mainfrom
Open
feat(agents): custom models for sub-agents (forge, sage, muse)#2705chengyixu wants to merge 2 commits intoantinomyhq:mainfrom
chengyixu wants to merge 2 commits intoantinomyhq:mainfrom
Conversation
Add :config-forge-model, :config-sage-model, :config-muse-model commands to allow configuring different model+provider combinations for each built-in agent. This enables using expensive thinking models for forge while using faster/cheaper models for sage research tasks. Changes across the full stack: Domain (forge_domain): - New AgentModelConfig struct with provider and model fields - AppConfig gains agent_models HashMap for per-agent overrides - New AppConfigOperation variants: SetAgentModel, ClearAgentModel Config (forge_config): - ForgeConfig gains forge_model, sage_model, muse_model fields persisted to .forge.toml Repository (forge_repo): - forge_config_to_app_config maps per-agent TOML fields to domain - apply_op handles SetAgentModel and ClearAgentModel operations Services (forge_services): - AppConfigService gains get/set/clear_agent_model_config methods - AgentRegistryService applies per-agent overrides when loading agents API (forge_api): - API trait exposes get/set/clear_agent_model_config - Agent cache invalidated on per-agent model changes CLI (forge_main): - `forge config set agent-model <agent> <provider> <model>` - `forge config get agent-model <agent>` - :config list shows per-agent model overrides ZSH plugin: - :config-forge-model (alias :cfm) - :config-sage-model (alias :csgm) - :config-muse-model (alias :cmm) - Reuses _forge_pick_model helper for consistent UX Closes antinomyhq#2637
Author
|
recheck |
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.
Summary
Closes #2637
Adds per-agent model and provider configuration so users can assign different models to each built-in agent. For example, use an expensive thinking model like Opus for
forgewhile using a fast/cheap model like MiniMax via OpenRouter forsageresearch.New ZSH commands
:config-forge-model:cfm:config-sage-model:csgm:config-muse-model:cmmCLI commands
How it works
:forge,:sage,:muse), the prompt automatically shows the agent's configured model:modeland:config-modelremain scoped to the global default, as described in the issue:configlist now shows per-agent model overridesImplementation
Full-stack changes across 14 files:
forge_domain):AgentModelConfig { provider, model }struct,AppConfig.agent_modelsHashMap,SetAgentModel/ClearAgentModeloperationsforge_config):forge_model,sage_model,muse_modelfields persisted to.forge.tomlforge_repo): Bidirectional mapping between TOML config and domain typesforge_services):get/set/clear_agent_model_configmethods; agent registry applies overrides at load timeforge_api): Exposes per-agent config via the API trait; invalidates agent cache on changesforge_main):forge config set/get agent-modelsubcommands;:configlist shows overrides_forge_pick_modelfor consistent fzf UXConfig file example
After configuring,
.forge.tomlwill contain:Test plan
cargo checksucceeds:config-sage-modelopens fzf picker, selection persists to.forge.toml:config-forge-modeland:config-muse-modelwork identicallyforge config set agent-model sage open_router minimax/minimax-01worksforge config get agent-model sagereturns the configured values:configshows per-agent overrides in the configuration list🤖 Generated with Claude Code