feat: add first-class --model option and agentModel config#156
Open
genevera wants to merge 1 commit into
Open
Conversation
…ent model selection
Adds a --model CLI flag and an agentModel config section that maps
agent names to model strings. Each agent handles the model string
in its native format: CLI agents receive --model as a spawn arg,
OpenCode receives it as { providerID, modelID } in the HTTP body,
and RovoDev receives it in the chat message body.
--model and -m are reserved args for OpenCode in agentArgsOverride
to steer users toward the first-class option instead.
Author
|
Fixes #83 |
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
Adds a
--modelCLI flag and anagentModelconfig section that maps agent names to model strings, implementing the first-class model option discussed in #83.What changed
Config (
config.ts)agentModel: Partial<Record<AgentName, string>>to theConfiginterfacenormalizeAgentModel()with validation (non-empty strings, valid agent names)serializeAgentModel()for YAML config persistence--model/-minisReservedAgentArg()for OpenCode (hard error: "Use --model CLI flag or agentModel config instead")Factory (
factory.ts)model?: stringtoCreateAgentOptionsmodelto every agent constructorAgents
--model <model>added to CLI spawn args{ providerID, modelID }fromprovider/modelstring, sent in theprompt_asyncHTTP request bodysetChatMessagerequest bodyCLI (
cli.ts)--model <model>flag--modelflag, falling back toconfig.agentModel[config.agent]Usage
Or via CLI:
gnhf --model anthropic/claude-sonnet-4-20250514 "refactor the auth module"Tests
All 659 tests pass. Lint, typecheck, and format are clean.