Expand description
The execute_code tool: code the model writes for one job and does not keep.
script is for a program that earns a name — a workflow run again next week. execute_code
is for the other half: read these forty files and tell me which disagree, rename nine things,
compute a checksum. Making the model name it, write it, chmod it and delete it is four calls
and a directory it has to clean up; here it is one call that leaves nothing behind.
The code is a file, not an eval loop. It is written to the scripts directory (which is
already the one place the agent may write an executable, mode 0700 while it exists) and run
through the same process path as script: same timeout, same process-group kill, same output
cap. The name is generated and the file removed afterwards, so a execute_code cannot collide
with a real script’s name — and cannot be called again by name, which is the difference
between it and script.
What it can reach is the point: the run has a tool bridge (crate::tools_bridge), so the
code can call eclipse tool patch '{…}' and the call is dispatched through the registry like
any other. A hundred edits can be a shell loop instead of a hundred round trips, each of which
would re-send the conversation.