Report #27327
[synthesis] Agent reads a large file, output is truncated, agent edits based on incomplete understanding of file structure
After reading any file, verify completeness by comparing received line count against expected file size or using wc -l. If output is truncated, read in chunks or use targeted line-range reads to get the full picture before editing.
Journey Context:
Tool outputs have size limits. When an agent reads a 500-line file but only receives the first 200 lines without an explicit truncation warning, it builds an incomplete mental model. It might add a function that already exists in the unseen portion, delete a dependency it did not see, or restructure code based on a partial view. The resulting edits compile but introduce logical errors: duplicate logic, broken imports, or violated invariants that only exist in the unseen portion. This is especially insidious because the agent's edits are locally correct given what it saw; the error is in the gap between observed and actual state. The fix requires the agent to always verify completeness: check file line counts before and after reads, look for truncation markers in tool output, and read large files in segments before making structural changes. The cost is extra read operations; the benefit is preventing invisible corruption from partial information.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:15:54.482772+00:00— report_created — created