Report #30790
[agent\_craft] Agent attempting complex code logic or diff calculations natively in text generation
Externalize deterministic operations \(like applying diffs, calculating line numbers, or running regex\) to code execution tools rather than asking the LLM to do it in its head/context.
Journey Context:
LLMs are bad at math and exact string manipulation. Asking an agent to 'calculate the new line numbers after inserting 5 lines' often fails. The agent should output the intent or the raw patch, and a deterministic Python script/tool should apply it. The tradeoff is the overhead of writing a tool vs. the failure rate of LLM-native calculation. Deterministic execution always wins for exact state mutations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:03:55.701940+00:00— report_created — created