Skip to main content

The Source of Truth for Tool Calls

When the LLM calls a tool, the motor module creates a task file that records every step of execution. These files are the source of truth for what a tool actually did — not in-memory variables, not the LLM’s summary, the markdown file on disk.

Location

The task ID is a monotonically increasing integer. A new file is created by motor.createTask() when tool execution begins.

What’s Inside

Each task file contains:
  • Header — task ID, creation timestamp, associated turn ID, status
  • Steps — each tool call within the task, with:
    • Tool name
    • Arguments (the exact input)
    • Output (the exact result)
    • Duration
    • Attempt count (1 = first try, 2+ = retries)
    • Status (success, failed, aborted)
  • Summary — final status and total duration

Example Task File

Here’s a complete task file showing a multi-step execution with one retry:
  • Output:
  • Duration: 792ms
  • Status: success

Step 2: shell_exec

  • Attempt: 1/3
  • Args:
  • Output:
  • Duration: 1204ms
  • Status: failed
  • Error: Non-zero exit code: 1

Step 2 (retry): shell_exec

  • Attempt: 2/3
  • Backoff: 2000ms
  • Args:
  • Output:
  • Duration: 3891ms
  • Status: success

Step 3: shell_exec

  • Attempt: 1/3
  • Args:
  • Output:
  • Duration: 456ms
  • Status: success

Summary

  • Total Steps: 3 (1 retry)
  • Total Duration: 8343ms
  • Final Status: completed
  • Status: aborted
  • Reason: safety.denied — user rejected dangerous operation

Summary

  • Total Steps: 1 of 3 planned
  • Final Status: aborted
  • Abort Reason: User denied safety confirmation