The open source coding agent.
TypeScript
fix: ensure @-ing a dir uses the read tool instead of dead list tool (#13428)
Aiden Cline98aeb60a7f0e
diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.tsindex 99d44cd850f..be813e823fb 100644--- a/packages/opencode/src/session/prompt.ts+++ b/packages/opencode/src/session/prompt.ts@@ -26,7 +26,6 @@ import { ToolRegistry } from "../tool/registry"import { MCP } from "../mcp"import { LSP } from "../lsp"import { ReadTool } from "../tool/read"-import { ListTool } from "../tool/ls"import { FileTime } from "../file/time"import { Flag } from "../flag/flag"import { ulid } from "ulid"@@ -1198,7 +1197,7 @@ export namespace SessionPrompt {}if (part.mime === "application/x-directory") {- const args = { path: filepath }+ const args = { filePath: filepath }const listCtx: Tool.Context = {sessionID: input.sessionID,abort: new AbortController().signal,@@ -1209,7 +1208,7 @@ export namespace SessionPrompt {metadata: async () => {},ask: async () => {},}- const result = await ListTool.init().then((t) => t.execute(args, listCtx))+ const result = await ReadTool.init().then((t) => t.execute(args, listCtx))return [{id: Identifier.ascending("part"),@@ -1217,7 +1216,7 @@ export namespace SessionPrompt {sessionID: input.sessionID,type: "text",synthetic: true,- text: `Called the list tool with the following input: ${JSON.stringify(args)}`,+ text: `Called the Read tool with the following input: ${JSON.stringify(args)}`,},{id: Identifier.ascending("part"),