fix(opencode): avoid deferred MCP search near step limit
This commit is contained in:
parent
0ebbdd71be
commit
15bc8ab920
4 changed files with 17 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ const belowThresholdIt = makeIt({
|
|||
queryDescription: "Natural language analytics query",
|
||||
})
|
||||
|
||||
function resolveTools() {
|
||||
function resolveTools(input: { remainingSteps?: number } = {}) {
|
||||
return SessionTools.resolve({
|
||||
agent,
|
||||
model,
|
||||
|
|
@ -128,6 +128,7 @@ function resolveTools() {
|
|||
bypassAgentCheck: false,
|
||||
messages: [],
|
||||
promptOps,
|
||||
remainingSteps: input.remainingSteps,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -172,4 +173,12 @@ describe("session.tools", () => {
|
|||
expect(Object.keys(tools).sort()).toEqual(["posthog_feature_flags", "posthog_query_trends"])
|
||||
}),
|
||||
)
|
||||
|
||||
deferredIt.instance("keeps MCP tools direct when the remaining step budget is too small", () =>
|
||||
Effect.gen(function* () {
|
||||
const tools = yield* resolveTools({ remainingSteps: 2 })
|
||||
|
||||
expect(Object.keys(tools).sort()).toEqual(["posthog_feature_flags", "posthog_query_trends"])
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue