The small agent loop exposes a bookkeeping detail I would make explicit: it appends toolResult messages, but never adds the assistant message containing the corresponding tool calls to messages first. That can leave the next model call with results whose request context is missing.
I would persist the assistant reply and its call IDs before execution, then append one result for each call, including denials. A transcript-level check could validate that pairing independently of whether the generated code passes tests. The harness would then preserve both the work and the conversation that explains it.
Ahmet Özel
AI Engineer. Computer Vision, RAG and LLM agents.
The small agent loop exposes a bookkeeping detail I would make explicit: it appends toolResult messages, but never adds the assistant message containing the corresponding tool calls to messages first. That can leave the next model call with results whose request context is missing.
I would persist the assistant reply and its call IDs before execution, then append one result for each call, including denials. A transcript-level check could validate that pairing independently of whether the generated code passes tests. The harness would then preserve both the work and the conversation that explains it.