codex_async
Launch a Codex task in the background and get a task ID for later retrieval. Isolate tasks in separate git worktrees to avoid conflicts when running in parallel.
Instructions
Start a Codex task in the background and return immediately with a task_id. Use codex_wait to collect results from one or more tasks, or codex_status to monitor progress. Set worktree=true to isolate each task in its own git worktree so parallel tasks don't conflict -- merge the branch back when done.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The initial user prompt for the Codex session. | |
| approval-policy | No | Approval policy for shell commands generated by the model. | |
| sandbox | No | Sandbox mode. | |
| cwd | No | Working directory for the session. If relative, resolved against the server's cwd. | |
| worktree | No | Create an isolated git worktree and branch for this task. Each task gets its own copy of the repo so parallel tasks never conflict. The response includes the branch name (codex-swarm/<task_id>) -- merge it back when done. | |
| model | No | Optional override for the model name (e.g. 'gpt-5.4'). | |
| profile | No | Configuration profile from config.toml. | |
| config | No | Config settings that override server defaults. | |
| base-instructions | No | Instructions to use instead of the defaults. | |
| developer-instructions | No | Developer instructions injected as developer role message. | |
| compact-prompt | No | Prompt used when compacting the conversation. |