Skip to content

Commit 86387e9

Browse files
authored
test(opencode): fix session tools test typecheck and runtime (anomalyco#46677)
1 parent c10d676 commit 86387e9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/opencode/test/session/tools.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { Tool } from "@/tool/tool"
1414
import { ToolRegistry } from "@/tool/registry"
1515
import { Truncate } from "@/tool/truncate"
1616
import { Plugin } from "@/plugin"
17+
import { RuntimeFlags } from "@/effect/runtime-flags"
1718
import { Effect, Layer, Schema } from "effect"
1819
import { testEffect } from "../lib/effect"
1920

@@ -37,6 +38,7 @@ const model = {
3738
function fakeMcp() {
3839
return MCP.Service.of({
3940
tools: () => Effect.succeed({}),
41+
clients: () => Effect.succeed({}),
4042
} as Partial<MCP.Interface> as MCP.Interface)
4143
}
4244

@@ -64,6 +66,7 @@ const layer = Layer.mergeAll(
6466
Layer.succeed(Permission.Service, fakePermission),
6567
Layer.succeed(MCP.Service, fakeMcp()),
6668
Layer.succeed(Truncate.Service, fakeTruncate),
69+
RuntimeFlags.layer(),
6770
Layer.succeed(
6871
ToolRegistry.Service,
6972
ToolRegistry.Service.of({
@@ -135,7 +138,7 @@ it.effect("preserves running tool start time across metadata updates", () =>
135138
const tools = yield* SessionTools.resolve({
136139
agent,
137140
model,
138-
session: { id: sessionID, permission: [] } as Session.Info,
141+
session: { id: sessionID, permission: [] } as unknown as Session.Info,
139142
processor,
140143
bypassAgentCheck: false,
141144
messages: [],
@@ -150,6 +153,7 @@ it.effect("preserves running tool start time across metadata updates", () =>
150153
{
151154
toolCallId: callID,
152155
abortSignal: new AbortController().signal,
156+
messages: [],
153157
},
154158
),
155159
)

0 commit comments

Comments
 (0)