test(core): align tool contract expectations (#39172)

This commit is contained in:
Kit Langton 2026-07-27 20:48:29 -04:00 committed by GitHub
commit 470e360942
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 333 additions and 116 deletions

View file

@ -1,5 +1,7 @@
import { describe, expect } from "bun:test"
import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
import { Location } from "@opencode-ai/core/location"
import { AbsolutePath } from "@opencode-ai/core/schema"
import { Tool } from "@opencode-ai/core/tool"
import { Effect, Schema } from "effect"
import { it } from "./lib/effect"
@ -27,6 +29,13 @@ describe("CodeMode", () => {
signature: "tools.echo(input: {\n text: string,\n}): Promise<string>",
},
])
}).pipe(Effect.scoped, Effect.provide(AppNodeBuilder.build(Tool.node))),
}).pipe(
Effect.scoped,
Effect.provide(
AppNodeBuilder.build(Tool.node, [
[Location.node, Location.boundNode({ directory: AbsolutePath.make("/project") })],
]),
),
),
)
})