{"record":{"id":"fe57748bdbd4be52","repo":"nikivdev/code","slug":"unsupported-codex-open-action","errorCode":null,"errorMessage":"unsupported codex open action: {}","messagePattern":"unsupported codex open action: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ai.rs","lineNumber":11762,"sourceCode":"                plan.runtime_state_path.as_deref(),\n                plan.trace.as_ref(),\n            )? {\n                Ok(())\n            } else {\n                bail!(\"failed to resume codex session {}\", session_id);\n            }\n        }\n        \"new\" | \"recover-new\" => {\n            maybe_open_cursor_for_pr_feedback_check(plan);\n            new_session_for_target(\n                Provider::Codex,\n                plan.prompt.as_deref(),\n                Some(&launch_path),\n                plan.runtime_state_path.as_deref(),\n                plan.trace.as_ref(),\n            )\n        }\n        other => bail!(\"unsupported codex open action: {}\", other),\n    }\n}\n\nfn maybe_open_cursor_for_pr_feedback_check(plan: &CodexOpenPlan) {\n    let Some(query) = plan\n        .query\n        .as_deref()\n        .map(str::trim)\n        .filter(|value| !value.is_empty())\n    else {\n        return;\n    };\n    if !looks_like_pr_feedback_query(query) {\n        return;\n    }\n    if env_flag_is_false(\"FLOW_OPEN_CURSOR_ON_PR_CHECK\") {\n        return;\n    }","sourceCodeStart":11744,"sourceCodeEnd":11780,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/ai.rs#L11744-L11780","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nf codex open my-session --action resme\n// after\nf codex open my-session --action resume","handlingStrategy":"validation","validationCode":"const VALID_ACTIONS: &[&str] = &[\"new\", \"resume\", \"recover-new\"];\nif !VALID_ACTIONS.contains(&action.as_str()) {\n    eprintln!(\"unsupported codex open action: {}\", action);\n    std::process::exit(2);\n}","typeGuard":"fn is_valid_action(a: &str) -> bool {\n    matches!(a, \"new\" | \"resume\" | \"recover-new\")\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["codex","cli","invalid-action","argument-error"],"backgroundTag":"unsupported-option-value","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}