From 6e81bdc21544dbedf5e93a4c842b924b536203d4 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Wed, 1 Apr 2026 05:01:44 +0900 Subject: [PATCH] fix: mount codex OAuth credentials into reviewer container Mount host's ~/.codex (read-only) into container so codex-runner can authenticate via ChatGPT OAuth. Set CODEX_HOME env on exec. --- src/container-runner.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/container-runner.ts b/src/container-runner.ts index 500c297..5884e68 100644 --- a/src/container-runner.ts +++ b/src/container-runner.ts @@ -321,6 +321,16 @@ export function buildReviewerMounts( readonly: false, }); + // Codex OAuth: mount host's ~/.codex (read-only) so codex-runner can authenticate + const hostCodexHome = process.env.CODEX_HOME || path.join(os.homedir(), '.codex'); + if (fs.existsSync(hostCodexHome)) { + mounts.push({ + hostPath: hostCodexHome, + containerPath: '/home/node/.codex', + readonly: true, + }); + } + return mounts; } @@ -485,6 +495,9 @@ export async function runReviewerContainer(args: { } } const isCodexAgent = (group.agentType || 'claude-code') === 'codex'; + if (isCodexAgent) { + execArgs.push('-e', 'CODEX_HOME=/home/node/.codex'); + } const runnerPath = isCodexAgent ? '/app/codex/dist/index.js' : '/app/agent/dist/index.js';