Skip to content

fix: replace echoed text with bytesWritten in writeTextFile#665

Merged
FL4TLiN3 merged 3 commits intomainfrom
fix/write-text-file-drop-echo
Mar 2, 2026
Merged

fix: replace echoed text with bytesWritten in writeTextFile#665
FL4TLiN3 merged 3 commits intomainfrom
fix/write-text-file-drop-echo

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Mar 2, 2026

Summary

  • writeTextFile was returning the written text (truncated to 30K chars) back to the LLM, wasting tokens on information the model already has
  • Replaced text field with bytesWritten in the tool result — the resolved path and byte count are sufficient confirmation
  • Added multi-byte character test, removed obsolete truncation test

Test plan

  • bun test apps/base/src/tools/write-text-file.test.ts — 6/6 pass

🤖 Generated with Claude Code

FL4TLiN3 and others added 3 commits March 2, 2026 12:58
The writeTextFile tool was returning the written text (truncated to 30K chars)
back to the LLM, which already knows what it wrote. Replace with bytesWritten
to save tokens while still confirming the write succeeded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All artifacts must be written in English per project conventions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 force-pushed the fix/write-text-file-drop-echo branch from 9691d17 to 3292e9e Compare March 2, 2026 12:58
@FL4TLiN3 FL4TLiN3 enabled auto-merge (squash) March 2, 2026 12:58
@FL4TLiN3 FL4TLiN3 merged commit fec3312 into main Mar 2, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 deleted the fix/write-text-file-drop-echo branch March 2, 2026 12:59
@FL4TLiN3 FL4TLiN3 mentioned this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant