The best way to control Claude Code, Codex and more from any computer or phone
fix(server): Codex permission requests for glob paths no longer show as command approvals (#24257)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
MarcoDotIO committed
Oct 31, 2026 at 04:41 UTC
5927111c607a8c40768e99a4d708b99a6c2d8de9
2 files changed
+68
-2
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
+61
@@ -8374,6 +8374,67 @@ describe("CodexAdapterV2 post-settle continuation", () => {
8374
),
8375
),
8376
);
8377
+
8378
+ it.effect("classifies permission requests that only list sandbox entries", () =>
8379
+ Effect.gen(function* () {
8380
+ const permissionRequest = (
8381
+ id: number,
8382
+ itemId: string,
8383
+ entries: CodexSchema.PermissionsRequestApprovalParams__AdditionalFileSystemPermissions["entries"],
8384
+ ): Array<CodexReplay.CodexAppServerReplayEntry> => [
8385
+ {
8386
+ type: "emit_inbound",
8387
+ label: `permissions ${itemId}`,
8388
+ frame: {
8389
+ id,
8390
+ method: "item/permissions/requestApproval",
8391
+ params: {
8392
+ threadId: nativeThreadId,
8393
+ turnId: nativeTurnId,
8394
+ itemId,
8395
+ cwd: "/w",
8396
+ startedAtMs: 2,
8397
+ permissions: { fileSystem: { entries } },
8398
+ },
8399
+ },
8400
+ },
8401
+ {
8402
+ type: "expect_outbound",
8403
+ label: `permissions ${itemId}`,
8404
+ frame: { id, result: { permissions: { fileSystem: { entries } }, scope: "turn" } },
8405
+ },
8406
+ ];
8407
+ const { harness, answerNext } = yield* startApprovalTurn("permission-entries", [
8408
+ ...permissionRequest(0, "write-glob", [
8409
+ { access: "read", path: { type: "path", path: "/w/src" } },
8410
+ { access: "write", path: { type: "glob_pattern", pattern: "/w/out/**" } },
8411
+ ]),
8412
+ ...permissionRequest(1, "read-glob", [
8413
+ { access: "read", path: { type: "glob_pattern", pattern: "/w/docs/**" } },
8414
+ ]),
8415
+ turnCompleted(nativeTurnId),
8416
+ ]);
8417
+ const write = yield* answerNext;
8418
+ const read = yield* answerNext;
8419
+ yield* harness.firstTerminal;
8420
+
8421
+ assert.deepEqual(
8422
+ [write, read].map((request) => [
8423
+ request.kind,
8424
+ approvalItem(harness.events, request)?.requestKind,
8425
+ ]),
8426
+ [
8427
+ ["file-change", "file-change"],
8428
+ ["file-read", "file-read"],
8429
+ ],
8430
+ );
8431
+ }).pipe(
8432
+ Effect.scoped,
8433
+ Effect.provide(
8434
+ Layer.mergeAll(IdAllocator.layer, McpProviderSessions.layer, NodeServices.layer),
8435
+ ),
8436
+ ),
8437
+ );
8438
});
8439
});
8440
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
+7
-2
@@ -587,10 +587,15 @@ function approvalDecisionToLegacyReviewDecision(
587
function providerRequestKindFromPermissions(
588
permissions: CodexSchema.PermissionsRequestApprovalParams["permissions"],
589
): ProviderRequestKind {
590
- if ((permissions.fileSystem?.write?.length ?? 0) > 0) {
590
+ // Codex leaves the legacy `read`/`write` lists out when a path is a glob or
591
+ // special path, and is replacing them with `entries`.
592
+ const requests = (access: "read" | "write") =>
593
+ (permissions.fileSystem?.[access]?.length ?? 0) > 0 ||
594
+ permissions.fileSystem?.entries?.some((entry) => entry.access === access);
595
+ if (requests("write")) {
596
return "file-change";
597
}
593
- if ((permissions.fileSystem?.read?.length ?? 0) > 0) {
598
+ if (requests("read")) {
599
return "file-read";
600
}
601
return "command";