mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 01:08:32 +00:00
test(core): align unavailable tool scenario
This commit is contained in:
parent
8046b1066f
commit
489ac620a9
1 changed files with 3 additions and 5 deletions
|
|
@ -2785,7 +2785,7 @@ describe("SessionRunnerLLM", () => {
|
|||
}),
|
||||
)
|
||||
|
||||
scenarioIt("durably settles local tool failures before continuing", (scenario) =>
|
||||
scenarioIt("durably rejects tools unavailable for the request", (scenario) =>
|
||||
Effect.gen(function* () {
|
||||
yield* setup
|
||||
const session = yield* SessionV2.Service
|
||||
|
|
@ -2793,10 +2793,9 @@ describe("SessionRunnerLLM", () => {
|
|||
|
||||
yield* scenario.run(function* () {
|
||||
yield* (yield* scenario.llm.next()).respond.toolCall("missing", {}, { id: "call-missing" })
|
||||
yield* (yield* scenario.llm.next()).respond.text("Recovered", { id: "text-after-error" })
|
||||
})
|
||||
|
||||
expect(yield* scenario.llm.requests).toHaveLength(2)
|
||||
expect(yield* scenario.llm.requests).toHaveLength(1)
|
||||
expect(yield* session.context(sessionID)).toMatchObject([
|
||||
{ type: "user", text: "Call missing" },
|
||||
{
|
||||
|
|
@ -2805,11 +2804,10 @@ describe("SessionRunnerLLM", () => {
|
|||
{
|
||||
type: "tool",
|
||||
id: "call-missing",
|
||||
state: { status: "error", error: { message: "Unknown tool: missing" } },
|
||||
state: { status: "error", error: { message: "Tool is not available for this request: missing" } },
|
||||
},
|
||||
],
|
||||
},
|
||||
{ type: "assistant", finish: "stop", content: [{ type: "text", text: "Recovered" }] },
|
||||
])
|
||||
}),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue