fix(codex): drop safe-yolo from Codex permission modes (#2183)

* fix(codex): drop safe-yolo from Codex permission modes

Every Codex session runs on the native shared runtime (runCodex is
runSharedCodex), which rejects safe-yolo. The mode stayed in
CODEX_PERMISSION_MODES and six filters hid it again in the web picker,
composer, hub permission-mode route, hapi set-mode and both native
apps. API callers that validate against the flavor catalog (e.g. a
spawn with permissionMode: 'safe-yolo') still passed it through and
only failed inside the runner.

Remove it from the Codex catalog (shared, iOS, Android, fixture) and
delete the filters. autoReview is the native replacement. Safe Yolo
stays for Gemini, Kimi and Copilot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(ios): Codex option list now has four modes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SSU-WEI HUANG
2026-10-28 12:12:55 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent fe2fbb881d
commit ffd950a220
41 changed files with 44 additions and 161 deletions
@@ -57,7 +57,7 @@ object PermissionModes {
/** `CODEX_PERMISSION_MODES`. */
val CODEX = listOf(
PermissionMode.Default, PermissionMode.ReadOnly,
PermissionMode.SafeYolo, PermissionMode.AutoReview, PermissionMode.Yolo,
PermissionMode.AutoReview, PermissionMode.Yolo,
)
/** `GEMINI_PERMISSION_MODES` (kimi/copilot share the same list). */
@@ -103,10 +103,6 @@ object PermissionModes {
/** `isPermissionModeAllowedForFlavor`. */
fun isAllowedForFlavor(mode: PermissionMode, flavor: String?): Boolean =
mode in forFlavor(flavor)
/** New Codex sessions use the shared runtime, without HAPI Safe Yolo. */
fun forLaunch(flavor: String?): List<PermissionMode> =
forFlavor(flavor).filter { flavor != "codex" || it != PermissionMode.SafeYolo }
}
/** `CODEX_COLLABORATION_MODES` + labels. */
@@ -50,7 +50,7 @@ class CatalogTest {
PermissionModes.forFlavor("claude").map { it.wireId }
)
assertEquals(
listOf("default", "read-only", "safe-yolo", "autoReview", "yolo"),
listOf("default", "read-only", "autoReview", "yolo"),
PermissionModes.forFlavor("codex").map { it.wireId }
)
assertEquals(