{"record":{"id":"73fa6f4b9744ed4e","repo":"openai/codex","slug":"approval-mode-must-be-one-of-supported","errorCode":null,"errorMessage":"approval_mode must be one of: {supported}","messagePattern":"approval_mode must be one of: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdk/python/src/openai_codex/_approval_mode.py","lineNumber":26,"sourceCode":"    AskForApproval,\n    AskForApprovalValue,\n)\n\n\nclass ApprovalMode(str, Enum):\n    \"\"\"High-level approval behavior for escalated permission requests.\"\"\"\n\n    deny_all = \"deny_all\"\n    auto_review = \"auto_review\"\n\n\ndef _approval_mode_settings(\n    approval_mode: ApprovalMode,\n) -> tuple[AskForApproval, ApprovalsReviewer | None]:\n    \"\"\"Map the public approval mode to generated app-server start params.\"\"\"\n    if not isinstance(approval_mode, ApprovalMode):\n        supported = \", \".join(mode.value for mode in ApprovalMode)\n        raise ValueError(f\"approval_mode must be one of: {supported}\")\n\n    match approval_mode:\n        case ApprovalMode.auto_review:\n            return (\n                AskForApproval(root=AskForApprovalValue.on_request),\n                ApprovalsReviewer.auto_review,\n            )\n        case ApprovalMode.deny_all:\n            return AskForApproval(root=AskForApprovalValue.never), None\n        case _:\n            return _assert_never_approval_mode(approval_mode)\n\n\ndef _assert_never_approval_mode(approval_mode: NoReturn) -> NoReturn:\n    \"\"\"Make approval mode mapping exhaustive for static type checkers.\"\"\"\n    raise AssertionError(f\"Unhandled approval mode: {approval_mode!r}\")\n\n","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/python/src/openai_codex/_approval_mode.py#L8-L44","documentation":"Error \"approval_mode must be one of: {supported}\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/python/src/openai_codex/_approval_mode.py:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass one of the supported approval_mode values listed in the message."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}