mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-13 15:44:56 +00:00
fix(task): limit small models to explore agents
This commit is contained in:
@@ -101,7 +101,7 @@ export const TaskTool = Tool.define(
|
||||
const msg = yield* Effect.sync(() => MessageV2.get({ sessionID: ctx.sessionID, messageID: ctx.messageID }))
|
||||
if (msg.info.role !== "assistant") return yield* Effect.fail(new Error("Not an assistant message"))
|
||||
|
||||
const smallModel = next.model ? undefined : yield* provider.getSmallModel(msg.info.providerID)
|
||||
const smallModel = !next.model && next.name === "explore" ? yield* provider.getSmallModel(msg.info.providerID) : undefined
|
||||
const model = next.model ?? {
|
||||
modelID: smallModel?.id ?? msg.info.modelID,
|
||||
providerID: smallModel?.providerID ?? msg.info.providerID,
|
||||
|
||||
@@ -276,7 +276,7 @@ describe("tool.task", () => {
|
||||
),
|
||||
)
|
||||
|
||||
it.live("execute defaults subagents to the provider small model", () =>
|
||||
it.live("execute defaults explore agents to the provider small model", () =>
|
||||
provideTmpdirInstance(
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
@@ -294,7 +294,7 @@ describe("tool.task", () => {
|
||||
{
|
||||
description: "inspect bug",
|
||||
prompt: "look into the cache key path",
|
||||
subagent_type: "general",
|
||||
subagent_type: "explore",
|
||||
},
|
||||
{
|
||||
sessionID: chat.id,
|
||||
|
||||
Reference in New Issue
Block a user