codex_delegate
Delegate a coding task to Codex in an isolated git worktree and receive a reviewable diff without applying changes to your tree.
Instructions
Delegate a coding task to Codex (a different model) in an isolated git worktree, and get back a reviewable diff that is NOT applied to your tree.
Codex edits files with workspace-write, but only inside a throwaway worktree
seeded from your current tracked state. The returned diff is Codex's changes;
review it, then apply it yourself if you want it. Requires a git repo with at
least one commit. Pass workspace_root (absolute).
NO NETWORK: workspace-write blocks network egress for commands Codex RUNS in the
sandbox, so the task must be self-contained — it cannot git push/fetch, gh
anything, curl, publish, or install dependencies (those fail inside the sandbox
with a DNS/host-resolution error). Ask only for local code changes; do any network
step yourself afterward. This does NOT mean nothing leaves the machine: the Codex
model call still sends your task to OpenAI and lets Codex read tracked files in
the worktree and send their content. Your task is sent raw — secret redaction is
best-effort and does not cover it or files Codex reads itself.
Progress: this is a blocking call that returns only when Codex finishes; it does
not stream incremental notifications/progress, and a delegate can run ~20s+. If
you need live status or recoverability, use codex_delegate_async for a job_id
and poll codex_job_status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | The coding task for Codex to implement inside a throwaway git worktree; the resulting diff is returned for review, not applied to your tree. | |
| model | No | Override the Codex model slug for this call; defaults to the server/Codex default when unset. | |
| detail | No | Response verbosity: 'summary' (default) omits the raw model text; 'full' includes it. | summary |
| isolation | No | Codex config isolation: 'inherit' (default), 'ignore-config', or 'ignore-rules'. | |
| workspace_root | No | Absolute path to the target repository root. Pass it (or rely on an MCP root) so the call targets the intended repo; otherwise it falls back to the server's own cwd and meta.workspace_warning is set. | |
| timeout_seconds | No | Per-call wall-clock timeout in seconds, clamped to 10..600 (out-of-range values are coerced, not rejected). Defaults to the server's configured timeout. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes |