feat: File based long tool return (#488)

This commit is contained in:
Kevin Lin
2026-01-08 06:15:51 +08:00
committed by GitHub
parent 4c59ca45ba
commit d0837e3536
12 changed files with 929 additions and 44 deletions

View File

@@ -29,11 +29,14 @@ export async function bash_output(
.join("\n");
}
const userCwd = process.env.USER_CWD || process.cwd();
// Apply character limit to prevent excessive token usage (same as Bash)
const { content: truncatedOutput } = truncateByChars(
text || "(no output yet)",
LIMITS.BASH_OUTPUT_CHARS,
"BashOutput",
{ workingDirectory: userCwd, toolName: "BashOutput" },
);
return { message: truncatedOutput };