This commit is contained in:
LukeParkerDev
2026-04-24 08:23:18 +10:00
parent 7266b48ca0
commit 4f8ff6ab53
3 changed files with 20 additions and 6 deletions
+12 -1
View File
@@ -1,6 +1,6 @@
import { afterAll, beforeAll, beforeEach, describe, expect, test } from "bun:test"
import path from "path"
import { tool, type ModelMessage } from "ai"
import { tool, type ModelMessage, type Tool } from "ai"
import { Cause, Effect, Exit, Stream } from "effect"
import z from "zod"
import { makeRuntime } from "../../src/effect/run-service"
@@ -119,6 +119,17 @@ describe("session.llm.hasToolCalls", () => {
})
})
describe("session.llm.repairToolName", () => {
test("normalizes legacy bash alias to shell when available", () => {
expect(LLM.repairToolName("bash", { shell: {} as Tool })).toBe("shell")
expect(LLM.repairToolName("BASH", { shell: {} as Tool })).toBe("shell")
})
test("returns undefined when normalized tool is unavailable", () => {
expect(LLM.repairToolName("bash", { read: {} as Tool })).toBeUndefined()
})
})
type Capture = {
url: URL
headers: Headers