I understand the reasoning, but at that point wouldn't the LLM be better off creating `sed` commands and executing those? I mean, if it's already executing Python, it can literally do anything to the environment, so using `sed` is at least as safe, with a bonus that it (or a subagent, or a human) can double-check the intention with the sed script and flag incorrect or missing changes.
Ask me how I know. Or don't. I have a standing rule for all agents warning about that failure mode (and related, doing `ls` in `/tmp` and few other directories that like to accumulate files by the hundreds..)
Or something, I don't remember...
You can do a gazillion edits with it in one shot.
Of course, LLM edit tools are probably small bits of their custom code, I just find it funny. I wonder if it's a desire for certain technical characteristics that require custom code or just a lack of info on basic tools. Heck, if it's about platform availability, using an LLM to port ed to Windows (for example) should be trivial[1].
* * *
[1] And there are probably a million existing ports. Also, sed, ex, vi, whatever.
LLMs sometimes like to execute one-off Python scripts to make edits to files rather than just calling the edit tool directly. Both are tool calls so saying that you should have it write code instead of doing tool calls makes no sense because writing code is a tool call for it...
How dared I to imply that some LLM output is more deterministic than the other, your LLM majesty. Shame on me and my entire family! For generations to come!
So sorry I implied that the code that doesn't work and has to be fixed later is deterministic in its execution and can be reused later instead of being re-generated from scratch!
Will I ever wash it off my name, your grace?
I wonder, is it easier to modify a script that agent wrote before to satisfy your prompt, or is it easier to write a new one from scratch each time a retry happens?
Are input tokens more expensive than output tokens?
Or, maybe your prompts are not good enough. And it's not my problem to fix, as you claim you are very experienced.