Ask Codex (new session)
codex_askSubmit a prompt to OpenAI Codex for coding tasks or reasoning. Returns the agent's final message as text.
Instructions
Ask OpenAI Codex (codex exec) a question or task in a NEW session.
Uses your existing Codex login (ChatGPT or API key — see codex login status).
Returns the agent's final message as text, read from codex's
--output-last-message file (no stdout scraping). Codex is a capable coding
agent, so this suits heavier reasoning and real code work, not just cheap
tool-calling. Point workspace at a real project dir for context-aware answers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Optional model override (`-m`); omit to use codex's configured default. | |
| watch | No | If true, open a live "watch" view in your browser that streams codex's steps (reasoning, the commands it runs, file changes) from its `--json` event stream. codex still runs headless; the same final text is returned. Best-effort — if the browser can't open, the run completes normally. Default false. | |
| prompt | Yes | Question or instruction for Codex. | |
| sandbox | No | Filesystem policy — "read-only" (default: reads and answers but writes nothing), "workspace-write" (may edit files under the workspace), or "danger-full-access" (no sandbox — avoid). `codex exec` has no interactive approval gate, so this is the real safety boundary; opt into write access deliberately. | read-only |
| timeout_s | No | Max seconds to wait for codex to complete. Default 180. | |
| workspace | No | Working root for the session (`-C`). Defaults to the server cwd. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |