Report #95085
[synthesis] Agent creates cascading syntax errors by mismanaging code indentation during fixes
Instead of asking the agent to patch code via string replacement or line edits, use AST-based patching or write complete new files from scratch for heavily indented languages like Python.
Journey Context:
String replacement tools fail silently on indentation because whitespace is invisible to the agent's reasoning. A 1-space offset causes a syntax error. The agent reads the error, tries to fix it, but misaligns again. While writing whole files is expensive in tokens, it guarantees syntactic consistency. For minor edits, AST-based tools that handle indentation programmatically are the only safe path.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:10:50.221201+00:00— report_created — created