mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-05 16:36:52 +00:00
feat: support configuring a default_agent across all API/user surfaces (#5843)
Co-authored-by: observerw <observerw@users.noreply.github.com>
This commit is contained in:
committed by
Aiden Cline
parent
da6e0e60c0
commit
8f6c8844d7
@@ -715,7 +715,7 @@ export namespace SessionPrompt {
|
||||
}
|
||||
|
||||
async function createUserMessage(input: PromptInput) {
|
||||
const agent = await Agent.get(input.agent ?? "build")
|
||||
const agent = await Agent.get(input.agent ?? (await Agent.defaultAgent()))
|
||||
const info: MessageV2.Info = {
|
||||
id: input.messageID ?? Identifier.ascending("message"),
|
||||
role: "user",
|
||||
@@ -1282,7 +1282,7 @@ export namespace SessionPrompt {
|
||||
export async function command(input: CommandInput) {
|
||||
log.info("command", input)
|
||||
const command = await Command.get(input.command)
|
||||
const agentName = command.agent ?? input.agent ?? "build"
|
||||
const agentName = command.agent ?? input.agent ?? (await Agent.defaultAgent())
|
||||
|
||||
const raw = input.arguments.match(argsRegex) ?? []
|
||||
const args = raw.map((arg) => arg.replace(quoteTrimRegex, ""))
|
||||
@@ -1425,7 +1425,7 @@ export namespace SessionPrompt {
|
||||
time: {
|
||||
created: Date.now(),
|
||||
},
|
||||
agent: input.message.info.role === "user" ? input.message.info.agent : "build",
|
||||
agent: input.message.info.role === "user" ? input.message.info.agent : await Agent.defaultAgent(),
|
||||
model: {
|
||||
providerID: input.providerID,
|
||||
modelID: input.modelID,
|
||||
|
||||
Reference in New Issue
Block a user