diff --git a/packages/opencode/src/tool/truncation.ts b/packages/opencode/src/tool/truncation.ts index c662f7cc2e..48b002b736 100644 --- a/packages/opencode/src/tool/truncation.ts +++ b/packages/opencode/src/tool/truncation.ts @@ -90,8 +90,8 @@ export namespace Truncate { await Bun.write(Bun.file(filepath), text) const hint = hasTaskTool(agent) - ? `Full output written to: ${filepath} (read-only)\nIMPORTANT: Use the Task tool to have a subagent process this file with Grep and Read (with offset/limit). Do NOT read the full file yourself - delegate to save context.` - : `Full output written to: ${filepath} (read-only)\nUse Grep to search the full content or Read with offset/limit to read specific sections.` + ? `The tool output was too large, the full output was written to the following file: ${filepath}\nIMPORTANT: Use the Task tool to have a subagent process this file with Grep and Read (with offset/limit). Do NOT read the full file yourself - delegate to save context.` + : `The tool output was too large, the full output was written to the following file: ${filepath}\nUse Grep to search the full content or Read with offset/limit to read specific sections.` const message = direction === "head" ? `${preview}\n\n...${removed} ${unit} truncated...\n\n${hint}` diff --git a/packages/opencode/test/tool/bash.test.ts b/packages/opencode/test/tool/bash.test.ts index 71c61572be..67306f640a 100644 --- a/packages/opencode/test/tool/bash.test.ts +++ b/packages/opencode/test/tool/bash.test.ts @@ -248,7 +248,7 @@ describe("tool.bash truncation", () => { ) expect((result.metadata as any).truncated).toBe(true) expect(result.output).toContain("truncated") - expect(result.output).toContain("Full output written to:") + expect(result.output).toContain("The tool output was too large") }, }) }) @@ -268,7 +268,7 @@ describe("tool.bash truncation", () => { ) expect((result.metadata as any).truncated).toBe(true) expect(result.output).toContain("truncated") - expect(result.output).toContain("Full output written to:") + expect(result.output).toContain("The tool output was too large") }, }) }) diff --git a/packages/opencode/test/tool/truncation.test.ts b/packages/opencode/test/tool/truncation.test.ts index 8227fdc255..fc95f4271b 100644 --- a/packages/opencode/test/tool/truncation.test.ts +++ b/packages/opencode/test/tool/truncation.test.ts @@ -84,7 +84,7 @@ describe("Truncate", () => { expect(result.truncated).toBe(true) expect(result.outputPath).toBeDefined() expect(result.outputPath).toContain("tool_") - expect(result.content).toContain("Full output written to:") + expect(result.content).toContain("The tool output was too large") expect(result.content).toContain("Grep") const written = await Bun.file(result.outputPath!).text()