codex_fork_session
Fork an existing Codex session into a new branch and run a prompt against it, preserving the original session unchanged.
Instructions
Fork an existing Codex session into a new branch (codex fork <ID|--last>) and run a prompt against the fork without mutating the original.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model name or alias (e.g. gpt-5.5, latest) | |
| prompt | Yes | Prompt text for the forked Codex session | |
| forkLast | No | Fork from the most recent Codex session. Mutually exclusive with `sessionId`. | |
| sessionId | No | Codex session UUID to fork from. Mutually exclusive with `forkLast`. | |
| workspace | No | Registered workspace alias for remote HTTP/OAuth provider calls. Do not use this field, workspace_list, or workspace_register_existing_repo as a fallback for stdio/local provider path access; pass workingDir/addDir/includeDirs directly instead. | |
| sandboxMode | No | Codex --sandbox. Omit = Codex exec built-in default (read-only; cannot write files). Pass workspace-write to let Codex edit files in the working dir, or danger-full-access for unrestricted access. | |
| correlationId | No | Request trace ID (auto if omitted) | |
| idleTimeoutMs | No | Idle timeout in ms (min 30s, max 1h, omit=CLI default) | |
| askForApproval | No | DEPRECATED compatibility input: accepted but ignored because current Codex no longer accepts --ask-for-approval. |