tweak: add model flag support for agent create command

This commit is contained in:
Aiden Cline
2025-12-15 14:55:59 -06:00
parent c3b3b133b0
commit ca599ab8fc
2 changed files with 10 additions and 3 deletions

View File

@@ -256,9 +256,9 @@ export namespace Agent {
return state().then((x) => Object.values(x))
}
export async function generate(input: { description: string }) {
export async function generate(input: { description: string; model?: { providerID: string; modelID: string } }) {
const cfg = await Config.get()
const defaultModel = await Provider.defaultModel()
const defaultModel = input.model ?? (await Provider.defaultModel())
const model = await Provider.getModel(defaultModel.providerID, defaultModel.modelID)
const language = await Provider.getLanguage(model)
const system = SystemPrompt.header(defaultModel.providerID)