ledger_log_dispatch
Record subagent dispatches for audit and retry tracking. Counts retries per task to enforce budget limits via task status.
Instructions
Record a subagent dispatch (e.g. via the Agent tool) for audit and retry tracking.
Call this every time a subagent is dispatched for a task, so retries of the same task can be counted and budget-limited via ledger_task_status.
Args: task (str): Stable identifier/description of the task being dispatched. Use the SAME string across retries of the same underlying task so retry counting works. agent_type (str): Subagent type used (e.g. "fork", "general-purpose"). model (str): Model used for the dispatch (e.g. "sonnet", "opus"). brief_summary (str): One-line summary of what the dispatch was asked to do.
Returns: dict: {"id": int, "retry_count": int} where retry_count is the number of PRIOR dispatches recorded under the same task (0 for the first).
Errors: Raises ValueError if any field is empty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | ||
| model | Yes | ||
| agent_type | Yes | ||
| brief_summary | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||