codex_run
Run a local OpenAI Codex CLI task synchronously with configurable model, sandbox, and cwd, returning final response, session ID, modified files, executed commands, and token usage.
Instructions
Run a task synchronously with local OpenAI Codex CLI (codex exec) using the model, reasoning effort, and sandbox configured in the Codex Bridge UI panel (unless explicitly overridden). Returns final response, session_id, modified files, executed commands, and token usage.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "codex_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute path to the working directory where Codex should operate. Defaults to the active goal cwd or current workspace directory. | |
| model | No | Optional model override for Codex. Omit to use the model selected in the Codex Bridge UI panel or ~/.codex/config.toml. | |
| config | No | Optional Codex config overrides in 'key=value' TOML format (passed as -c). | |
| images | No | Optional image file paths to attach to the prompt. | |
| prompt | Yes | Clear, detailed task instructions for Codex (supports multiline text and Chinese/English). | |
| goal_id | No | Optional persistent goal_id to associate this Codex execution with (auto-links session_id and iteration count). | |
| profile | No | Optional Codex config profile name (-p <profile>). | |
| sandbox | No | Sandbox policy for Codex shell commands. Omit to use the active Codex Bridge UI panel setting. | |
| add_dirs | No | Additional directories that should be writable alongside cwd. | |
| worktree | No | If true, run the session inside a managed Git worktree. | |
| ephemeral | No | If true, do not persist the Codex session to disk. | |
| milestone_id | No | Optional milestone_id (e.g. 'm1') inside goal_id that this execution is working on. | |
| output_schema | No | Optional path to a JSON Schema file constraining Codex's final response shape. | |
| timeout_seconds | No | Maximum seconds to wait before aborting (default 600). | |
| reasoning_effort | No | Optional reasoning effort override for Codex. Omit to use the level selected in the Codex Bridge UI panel or Codex default. | |
| skip_git_repo_check | No | Allow Codex to run outside a Git repository (defaults to UI panel setting / true). |