startCodexCloudTask submits a coding task directly to a configured Codex cloud environment. Automate.ax dispatches the request; the Codex agent runs in OpenAI’s cloud container.
automations/start-codex-task.automation.ts
environmentId is the stable environment identifier returned by listCodexCloudEnvironments. branch is required so the headless dispatcher never guesses a ref from its own checkout. Set attempts from 1 to 4; it defaults to 1. mode defaults to code; use ask when you only want an answer and no repository changes. Optional second argument { account } defaults to the project binding.
The result contains the new task ID and its ChatGPT URL. Submission is asynchronous. Use runCodexCloudTask when downstream work should wait for completion, waitForCodexCloudTask when you already have a task ID or signal, or getCodexCloudTask for one immediate status check.