codex_job_cancel
Cancel a running background Codex job gracefully, with force-kill fallback. Idempotent and free; returns cleanup warnings for leftover worktrees.
Instructions
Cancel a running background Codex job.
Asks the worker to shut down gracefully so it tears down its throwaway worktree,
then force-kills it if it overstays, and marks the job cancelled (cancelled jobs
cannot be resumed). If the worktree could not be removed, cleanup_warnings
names the leftover path. Already-terminal jobs are returned unchanged, so cancel
is idempotent — a retry after a lost response is safe. Free — no model call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | The job_id returned by an *_async call (codex_*_async); recover lost ids with codex_job_list. | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes |