feat(provider): add @model and @small_model refs#22075
Open
thypon wants to merge 1 commit intoanomalyco:devfrom
Open
feat(provider): add @model and @small_model refs#22075thypon wants to merge 1 commit intoanomalyco:devfrom
thypon wants to merge 1 commit intoanomalyco:devfrom
Conversation
Allow config model fields to reference named models via @model and @small_model instead of hardcoding provider/id strings. Refs resolve lazily at runtime so the compaction agent (or any agent) can track the active default/small model per provider. - Add isModelRef(), resolveRef() to Provider service - Store unresolved refs as agent.modelRef, resolve at use site - Guard against circular refs in defaultModel/getSmallModel - Update all CLI and ACP call sites to handle @ prefixed strings
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Author
|
failures do not seem to be related to this patch |
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.
Issue for this PR
Refs #11930
Type of change
What does this PR do?
Config model fields (
model,small_model,agent.*.model,command.*.model,--modelCLI arg) now accept@modeland@small_modelreferences instead of hardcodingprovider/idstrings.These refs resolve lazily at runtime — so for example, setting
agent.compaction.model: "@small_model"means the compaction agent always uses whichever small model is active for the current provider, without needing to hardcode a specific model id.Circular-ref guards prevent
@small_modelinconfig.small_modelor@modelinconfig.modelfrom causing infinite loops.Key changes:
isModelRef()/resolveRef()added to Provider service —@small_modelresolves viagetSmallModel()(falls back todefaultModel()),@modelresolves viadefaultModel()modelRef(string), resolves at use site instead of at parse timecompaction.ts,prompt.ts, CLI commands, and ACP all handlemodelRefresolutionHow did you verify your code works?
isModelRef,resolveRef,getSmallModelcircular guard, agentmodelRefparsing, compactionmodelRefresolutionScreenshots / recordings
N/A — no UI changes
Checklist