Delimit Agent Complete
delimit_agent_completeRecord a dispatched agent task's result and changed files to mark it completed, preventing it from staying in-flight in the ledger.
Instructions
Close a dispatched agent task by recording the outcome.
When to use: at the end of an engineering subagent's work, to record the result summary and the files touched on the dispatch record. This is the closing step of the dispatch lifecycle (delimit_agent_dispatch -> [subagent runs] -> this). Without calling this, the task remains "dispatched" in the ledger and dashboards will count it as in-flight. For tracked muse workers, call delimit_agent_poll first: completed outputs close here, and uncertain outputs (worker died mid-run) close here only with accept_uncertain=True. When NOT to use: to hand off ownership to a different model (use delimit_agent_handoff), to dispatch a fresh task (delimit_agent_dispatch), or to read task status without closing (delimit_agent_status). Also: do not call repeatedly on the same task_id — the backend treats a second complete as an error. Do not use on cancelled, still-running, or refused worker tasks — the backend rejects those.
Sibling contrast: delimit_agent_handoff transfers active ownership to another model (task stays open); this closes ownership entirely. delimit_agent_status is the read-only sibling. delimit_agent_poll observes a launched worker without closing; this accepts and closes.
Side effects: writes a completion record via
ai.agent_dispatch.complete_task — the task's status flips from
"dispatched" to "completed", result and files_changed are
persisted, and an audit log entry is appended. files_changed
is coerced from a comma string to a list. Tracked-launch tasks
may only close from "completed"/"uncertain" worker states. No
license gate on this lifecycle surface. No notification — pair
with delimit_notify if the operator needs to be told.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | Summary of what was done. | |
| task_id | Yes | Task id from delimit_agent_dispatch. Required. | |
| files_changed | No | Comma-separated paths of modified files. | |
| accept_uncertain | No | If True, close an "uncertain" worker task anyway. Default False. | |
| review_diff_path | No | Optional diff file path the transcript must bind to. | |
| review_diff_text | No | Optional inline diff text the transcript must bind to. | |
| review_transcript | No | Optional deliberation transcript path for review binding (LED-5321 M4). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||