test(codemode): drop leftover $codemode references (#36451)

This commit is contained in:
Aiden Cline 2026-07-11 14:15:11 -05:00 committed by GitHub
commit 75e8fd4da2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 23 deletions

View file

@ -761,11 +761,6 @@ describe("CodeMode public contract", () => {
"tools.thread.generateImage",
)
}
// The retired $codemode namespace is gone from the tools tree entirely.
const removed = await Effect.runPromise(runtime.execute(`return await tools.$codemode.search({ query: "file" })`))
expect(removed.ok).toBe(false)
if (!removed.ok) expect(removed.error.kind).toBe("UnknownTool")
})
test("search is a counted tool call: it burns maxToolCalls and fires the hooks", async () => {
@ -1195,11 +1190,4 @@ describe("CodeMode public contract", () => {
}
expect(elapsedMs).toBeLessThan(3_000)
})
test("a host $codemode namespace is an ordinary namespace now that search is a built-in", async () => {
const runtime = CodeMode.make({ tools: { $codemode: { lookup } } })
const result = await Effect.runPromise(runtime.execute(`return await tools.$codemode.lookup({ id: "order_1" })`))
expect(result.ok).toBe(true)
if (result.ok) expect(result.value).toStrictEqual({ id: "order_1", status: "open" })
})
})

View file

@ -52,10 +52,8 @@ describe("Object.keys over tool references", () => {
expect(await value(`return Object.keys(tools.github.list_issues)`)).toEqual([])
})
test("search is a global built-in function, not a tools namespace", async () => {
test("search is a global built-in function", async () => {
expect(await value(`return typeof search`)).toBe("function")
const failure = await error(`return Object.keys(tools.$codemode)`)
expect(failure.kind).toBe("UnknownTool")
})
test("an unknown namespace is an UnknownTool error pointing at the discovery idioms", async () => {