refactor(core): resolve default agent info (#27125)

This commit is contained in:
Shoubhit Dash
2026-05-13 01:08:30 +05:30
committed by GitHub
parent e540daabc4
commit 45de4975de
6 changed files with 30 additions and 13 deletions

View File

@@ -638,6 +638,14 @@ it.instance("defaultAgent returns build when no default_agent config", () =>
}),
)
it.instance("defaultInfo returns resolved build agent when no default_agent config", () =>
Effect.gen(function* () {
const agent = yield* load((svc) => svc.defaultInfo())
expect(agent.name).toBe("build")
expect(agent.mode).toBe("primary")
}),
)
it.instance(
"defaultAgent respects default_agent config set to plan",
() =>

View File

@@ -180,7 +180,7 @@ describe("tool.registry", () => {
const promptTools = yield* registry.tools({
providerID: ProviderID.opencode,
modelID: ModelID.make("test"),
agent: yield* agents.get(yield* agents.defaultAgent()),
agent: yield* agents.defaultInfo(),
})
const promptTool = promptTools.find((tool) => tool.id === "sql")
if (!promptTool) throw new Error("custom sql tool was not returned for prompts")