_delimit_agent_impl
Records and tracks agent task lifecycle actions: dispatch intent, check status, handoff to another model, or close tasks. Use for task planning and audit instead of direct execution.
Instructions
Manage the agent-task lifecycle — dispatches to one of four actions.
When to use: as the single MCP-registered agent surface (delimit_agent) when the caller wants to pick the lifecycle action by name in one call rather than choosing a specific delimit_agent_* alias. The lifecycle is dispatch (record intent) -> status (read) -> handoff (transfer to another model) -> complete (close). When NOT to use: from internal code paths — prefer the specific alias (delimit_agent_dispatch, delimit_agent_status, delimit_agent_complete, delimit_agent_handoff) so the action's docstring and arg schema show up at the right call site. Do NOT use action="dispatch" expecting a subagent to run — it RECORDS the dispatch, it does not execute it (see Side effects). The related delimit_agent_link / _policy / _check / _dashboard tools share the prefix but are SEPARATE tools, not actions here — passing their names as action= returns an "Unknown action" error.
Sibling contrast: delimit_agent_dispatch / _status / _complete / _handoff are thin aliases that call straight into this implementation with a fixed action; they exist so each action's docstring lives at the right name. This is the dispatch core for those four. Versus delimit_ledger_add: the ledger holds free-form work items; this surface carries engineering-dispatch schema (assignee, tools_needed, constraints) and a per-task audit trail.
Side effects: action="status" is READ-ONLY (loads the task store, no writes). action="dispatch" / "complete" / "handoff" WRITE to the agent task store and append to its audit log. CRITICAL: action="dispatch" records intent only — it persists a task plus a formatted agent_prompt and does NOT spawn or run a subagent. Per the operating model, actual execution is the caller's responsibility via the Agent tool (subagent_type=engineering); this is the planning + audit surface. Dispatch additionally enforces deterministic guards before writing: a kill switch (refuses if ~/.delimit/pause_dispatch exists), a dead- letter circuit breaker (auto-pauses once too many tasks remain un-acknowledged), a ghost-title reject, and a shipped-LED anti- duplicate gate (refuses + auto-closes a task whose LED is already merged to main). assignee="any" is resolved to a concrete model via the task-type router. Every return is wrapped via _with_next_steps. Errors are deterministic ({"error": ...}): an unknown action short- circuits before any backend call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Which lifecycle operation to perform. One of "dispatch", "status", "complete", "handoff". Default "status". Any other value returns a deterministic {"error": "Unknown action ..."}. | status |
| title | No | Task title (action="dispatch" only). Required — the backend rejects empty titles. | |
| description | No | Longer task description (action="dispatch" only). | |
| assignee | No | Target model "claude"/"codex"/"gemini"/"any" (action="dispatch" only). Default "any", resolved to a concrete model by the router. Invalid values are rejected. | any |
| priority | No | "P0"/"P1"/"P2" (action="dispatch" only). Default "P1"; invalid values are rejected. | P1 |
| tools_needed | No | Comma-separated MCP tools the work will need (action="dispatch" only). Coerced to a list. | |
| constraints | No | Comma-separated constraints, e.g. "no force push" (action="dispatch" only). Coerced to a list. | |
| context | No | Background to seed the executor (action="dispatch") OR notes for the next model (action="handoff"). Unused by status/complete. | |
| task_id | No | Task id, e.g. "AGT-A1B2C3D4". Used by status, complete, handoff. Optional for status (empty lists all active tasks); required and validated for complete/handoff. | |
| result | No | Summary of what was done (action="complete" only). | |
| files_changed | No | Comma-separated modified file paths (action="complete" only). Coerced to a list. | |
| to_model | No | Target model for the transfer (action="handoff" only). Required; validated against the allowed models. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||