mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-07 01:21:37 +00:00
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:
co-authored by
Claude Opus 5.5
parent
fe2fbb881d
commit
ffd950a220
@@ -3,7 +3,6 @@ import {
|
||||
AGENT_FLAVORS,
|
||||
AgentFlavorSchema,
|
||||
CREATABLE_AGENT_FLAVORS,
|
||||
getLaunchPermissionModesForFlavor,
|
||||
getPermissionModeLabel,
|
||||
getPermissionModeOptionsForFlavor,
|
||||
getPermissionModeTone,
|
||||
@@ -102,7 +101,7 @@ describe('isPermissionModeAllowedForFlavor', () => {
|
||||
})
|
||||
|
||||
test("codex offers autoReview at launch and mid-session", () => {
|
||||
expect(getLaunchPermissionModesForFlavor('codex')).toEqual(['default', 'read-only', 'autoReview', 'yolo'])
|
||||
expect(getPermissionModesForFlavor('codex')).toEqual(['default', 'read-only', 'autoReview', 'yolo'])
|
||||
expect(isPermissionModeAllowedForFlavor('autoReview', 'codex')).toBe(true)
|
||||
expect(isPermissionModeAllowedForFlavor('autoReview', 'gemini')).toBe(false)
|
||||
})
|
||||
|
||||
+1
-6
@@ -25,7 +25,7 @@ export type AgyPermissionMode = typeof AGY_PERMISSION_MODES[number]
|
||||
export const CLAUDE_PERMISSION_MODES = ['default', 'acceptEdits', 'auto', 'bypassPermissions', 'plan'] as const
|
||||
export type ClaudePermissionMode = typeof CLAUDE_PERMISSION_MODES[number]
|
||||
|
||||
export const CODEX_PERMISSION_MODES = ['default', 'read-only', 'safe-yolo', 'autoReview', 'yolo'] as const
|
||||
export const CODEX_PERMISSION_MODES = ['default', 'read-only', 'autoReview', 'yolo'] as const
|
||||
export type CodexPermissionMode = typeof CODEX_PERMISSION_MODES[number]
|
||||
|
||||
export const CODEX_COLLABORATION_MODES = ['default', 'plan'] as const
|
||||
@@ -177,11 +177,6 @@ export function isPermissionModeAllowedForFlavor(mode: PermissionMode, flavor?:
|
||||
return getPermissionModesForFlavor(flavor).includes(mode)
|
||||
}
|
||||
|
||||
/** New Codex sessions use the native shared runtime, without HAPI Safe Yolo. */
|
||||
export function getLaunchPermissionModesForFlavor(flavor?: string | null): readonly PermissionMode[] {
|
||||
return getPermissionModesForFlavor(flavor).filter(mode => flavor !== 'codex' || mode !== 'safe-yolo')
|
||||
}
|
||||
|
||||
export function getCodexCollaborationModeOptions(): CodexCollaborationModeOption[] {
|
||||
return CODEX_COLLABORATION_MODES.map((mode) => ({
|
||||
mode,
|
||||
|
||||
Reference in New Issue
Block a user