diff options
| author | Dax Raad <[email protected]> | 2025-05-21 10:30:39 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-26 12:40:17 -0400 |
| commit | e01afb407c4b3eb50e85e7356b0be9489fb26eba (patch) | |
| tree | d2aef91ec1894376c4d5a99ea2d11f6ad32b68de /js/src/session | |
| parent | f0f55bc75ff2bbc6690ae61c771a46de7c2bb17d (diff) | |
| download | opencode-e01afb407c4b3eb50e85e7356b0be9489fb26eba.tar.gz opencode-e01afb407c4b3eb50e85e7356b0be9489fb26eba.zip | |
add tool tests
Diffstat (limited to 'js/src/session')
| -rw-r--r-- | js/src/session/session.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/js/src/session/session.ts b/js/src/session/session.ts index dfca22a3f..338c8dda9 100644 --- a/js/src/session/session.ts +++ b/js/src/session/session.ts @@ -14,9 +14,7 @@ import { type UIMessagePart, } from "ai"; import { z } from "zod"; -import { BashTool } from "../tool/bash"; -import { EditTool } from "../tool/edit"; -import { ViewTool } from "../tool/view"; +import * as tools from "../tool"; import ANTHROPIC_PROMPT from "./prompt/anthropic.txt"; import type { Tool } from "../tool/tool"; @@ -173,11 +171,7 @@ export namespace Session { maxSteps: 1000, messages: convertToModelMessages(msgs), temperature: 0, - tools: { - ...BashTool, - ...ViewTool, - ...EditTool, - }, + tools, model, }); const next: Message = { @@ -192,7 +186,7 @@ export namespace Session { tool: {}, }, }; - const metadata = next.metadata!; + msgs.push(next); let text: TextUIPart | undefined; const reader = result.toUIMessageStream().getReader(); |
