فهرست منبع

tweak wording

Aiden Cline 3 ماه پیش
والد
کامیت
c39cebe971

+ 2 - 2
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}`

+ 2 - 2
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")
       },
     })
   })

+ 1 - 1
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()