Fix codex approve policy

This commit is contained in:
weishu
2026-03-16 13:00:09 +08:00
parent bfc9ad9f0c
commit 1f02bb7de1
12 changed files with 461 additions and 49 deletions
+6 -1
View File
@@ -176,7 +176,12 @@ class CodexRemoteLauncher extends RemoteLauncherBase {
}
};
const permissionHandler = new CodexPermissionHandler(session.client, {
const permissionHandler = new CodexPermissionHandler(session.client, () => {
const mode = session.getPermissionMode();
return mode === 'default' || mode === 'read-only' || mode === 'safe-yolo' || mode === 'yolo'
? mode
: undefined;
}, {
onRequest: ({ id, toolName, input }) => {
const inputRecord = input && typeof input === 'object' ? input as Record<string, unknown> : {};
const message = typeof inputRecord.message === 'string' ? inputRecord.message : undefined;