Scripts with a wrong call are stopped before they change anything
A script the agent writes is checked before it runs: a wrong tool name or a missing field stops it before anything changes, and a read it repeats runs once.
When the agent does several steps at once, it writes a short script that calls its tools. That script is now read before it runs. If it calls a tool that is not turned on, or leaves out something a tool needs, such as the text to replace in an edit, it is stopped with the line to fix, and none of its steps have run. Before, the earlier steps could already have written files by the time the wrong call failed.
The check only stops what it is sure of. A script that looks a tool up first, or is ready for a call to fail, runs as written.
Inside one script, reading the same file or running the same search twice now reads it once, until the script changes something. Each run also records how much of what the tools returned stayed out of the conversation, so it is easy to see which scripts were worth writing.