nikivdev/code · error
unsupported codex open action: {}
Error message
unsupported codex open action: {} What it means
The codex open planner supports a fixed set of actions (resume/recover, new, recover-new, etc.). Any other action string reaching the dispatcher's `other =>` arm bails with the offending value. This is a defensive guard against unknown or future action variants.
Source
Thrown at src/ai.rs:11762
plan.runtime_state_path.as_deref(),
plan.trace.as_ref(),
)? {
Ok(())
} else {
bail!("failed to resume codex session {}", session_id);
}
}
"new" | "recover-new" => {
maybe_open_cursor_for_pr_feedback_check(plan);
new_session_for_target(
Provider::Codex,
plan.prompt.as_deref(),
Some(&launch_path),
plan.runtime_state_path.as_deref(),
plan.trace.as_ref(),
)
}
other => bail!("unsupported codex open action: {}", other),
}
}
fn maybe_open_cursor_for_pr_feedback_check(plan: &CodexOpenPlan) {
let Some(query) = plan
.query
.as_deref()
.map(str::trim)
.filter(|value| !value.is_empty())
else {
return;
};
if !looks_like_pr_feedback_query(query) {
return;
}
if env_flag_is_false("FLOW_OPEN_CURSOR_ON_PR_CHECK") {
return;
}View on GitHub (pinned to a747e741ae)
Solutions
- Use a supported action: `new`, `resume`, `recover-new`, or omit the action for the default
- Fix the typo or update the script to current action names
- Check `f codex open --help` for the accepted action list
Example fix
// before f codex open my-session --action resme // after f codex open my-session --action resume
Defensive patterns
Strategy: validation
Validate before calling
const VALID_ACTIONS: &[&str] = &["new", "resume", "recover-new"];
if !VALID_ACTIONS.contains(&action.as_str()) {
eprintln!("unsupported codex open action: {}", action);
std::process::exit(2);
} Type guard
fn is_valid_action(a: &str) -> bool {
matches!(a, "new" | "resume" | "recover-new")
} Prevention
- Whitelist action names in wrapper scripts
- Re-check `--help` after CLI upgrades before scripting actions
- Use enums/constants, not raw strings, when building plans programmatically
When it happens
Trigger: Invoking `f codex open` with an unrecognized action value — typically via a wrapper, script, or config that builds the plan programmatically with a typo'd or outdated action name.
Common situations: Typo like `--action resme`; scripts written against an older CLI whose action names changed; downstream tooling (call_ok_surfaces_remote_error, login, rank_branches callers) passing an unexpected action.
Related errors
- connect is only supported for Codex sessions; use `f codex c
- runtime helpers are only supported for Codex sessions; use `
- doctor is only supported for Codex sessions; use `f codex do
- eval is only supported for Codex sessions; use `f codex eval
- touch-launch is only supported for Codex sessions; use `f co
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/fe57748bdbd4be52.
Report an issue: GitHub.