fix: clear CLAUDE_MODEL env on codex container exec

Container-level env has CLAUDE_MODEL baked in from creation.
Explicitly clear it on docker exec when running codex agent
to prevent 'model not supported with ChatGPT account' errors.
This commit is contained in:
Eyejoker
2026-04-01 05:20:55 +09:00
parent 7c9050ba9f
commit a648a08bf0

View File

@@ -481,17 +481,19 @@ export async function runReviewerContainer(args: {
execArgs.push('-e', `CLAUDE_CODE_OAUTH_TOKEN=${oauthToken}`);
}
const isCodexAgent = (group.agentType || 'claude-code') === 'codex';
// Inject model/effort overrides matching the active agent type.
const modelEnvKeys = isCodexAgent
? ['CODEX_MODEL', 'CODEX_EFFORT']
: ['CLAUDE_MODEL', 'CLAUDE_EFFORT', 'CODEX_MODEL', 'CODEX_EFFORT'];
if (envOverrides) {
const modelEnvKeys = ['CLAUDE_MODEL', 'CLAUDE_EFFORT', 'CODEX_MODEL', 'CODEX_EFFORT'];
for (const key of modelEnvKeys) {
if (envOverrides[key]) {
execArgs.push('-e', `${key}=${envOverrides[key]}`);
}
}
}
// Clear Claude model/effort for codex runs — container-level env may
// have CLAUDE_MODEL baked in from creation, which codex SDK rejects.
if (isCodexAgent) {
execArgs.push('-e', 'CLAUDE_MODEL=', '-e', 'CLAUDE_EFFORT=');
}
if (isCodexAgent) {
execArgs.push('-e', 'CODEX_HOME=/home/node/.codex');
}