Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Environment - Codex Desktop on Windows 11, CLI version 0.151.0-alpha.7.2 - Provider config: model_provider = "openrouter", base_url = "https://openrouter.ai/api/v1", wire_api = "responses" - Models tested: z-ai/glm-5.3-flash, moonshotai/kimi-k3 — both fail identically
What subscription do you have?
openrouter
What platform is your computer?
No response
What issue are you seeing?
Symptom
All scheduled automations (2 cron + 1 heartbeat) trigger on time but every run terminates within ~4 seconds, before any business logic executes. The task_complete event carries:
{"error":{"code":"invalid_prompt","message":"Invalid Responses API request"}}This has failed on every scheduled run since at least 2026-09-02 (multiple CLI versions). Changing the automation's model does NOT help — the same failure occurs on every OpenRouter-backed model.
Root cause (from session logs)
The Zod validation error is at input item index 2:
branch 0: Invalid input: expected string, received array
branch 1: input[2]: Invalid input | input[13]: Invalid input | ...
Item 2 in the automation's initial context is a function_call_output injected by Codex itself, for the codex_app/automation_update tool:
{"type":"function_call_output","id":"fco_...","name":"automation_update","namespace":"codex_app","output":"..."}This item fails OpenRouter's Responses API schema validation. The same models work fine in normal interactive sessions (which don't contain this injected item), so the issue is specifically the automation-context serialization vs. OpenRouter's Responses validation.
Expected behavior
Automations should run on OpenRouter-backed models, or the injected automation_update function_call_output should be serialized in a shape that passes Responses validation (or omitted from the request).
Reproduction
- Configure Codex with OpenRouter as model provider (
wire_api = "responses"). - Create any automation (cron or heartbeat).
- Wait for a scheduled run — it fails immediately with
invalid_prompt.
Logs
Happy to attach full rollout JSONL from ~/.codex/sessions/ on request.
What steps can reproduce the bug?
Configure Codex with OpenRouter as model provider (wire_api = "responses").
Create any automation (cron or heartbeat).
Wait for a scheduled run — it fails immediately with invalid_prompt.
What is the expected behavior?
No response
Additional information
No response
Activity
github-actions commentedon Sep 8, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action