fix: only inject matching model env vars for container agent type
When codex runs in container, skip CLAUDE_MODEL/EFFORT to prevent 'claude-opus-4-6 not supported with ChatGPT account' errors.
This commit is contained in:
@@ -322,7 +322,8 @@ export function buildReviewerMounts(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Codex OAuth: mount host's ~/.codex (read-only) so codex-runner can authenticate
|
// Codex OAuth: mount host's ~/.codex (read-only) so codex-runner can authenticate
|
||||||
const hostCodexHome = process.env.CODEX_HOME || path.join(os.homedir(), '.codex');
|
const hostCodexHome =
|
||||||
|
process.env.CODEX_HOME || path.join(os.homedir(), '.codex');
|
||||||
if (fs.existsSync(hostCodexHome)) {
|
if (fs.existsSync(hostCodexHome)) {
|
||||||
mounts.push({
|
mounts.push({
|
||||||
hostPath: hostCodexHome,
|
hostPath: hostCodexHome,
|
||||||
@@ -479,14 +480,11 @@ export async function runReviewerContainer(args: {
|
|||||||
'';
|
'';
|
||||||
execArgs.push('-e', `CLAUDE_CODE_OAUTH_TOKEN=${oauthToken}`);
|
execArgs.push('-e', `CLAUDE_CODE_OAUTH_TOKEN=${oauthToken}`);
|
||||||
}
|
}
|
||||||
// Inject model/effort overrides at exec-time so per-role config
|
const isCodexAgent = (group.agentType || 'claude-code') === 'codex';
|
||||||
// takes effect even with persistent containers.
|
// Inject model/effort overrides matching the active agent type.
|
||||||
const modelEnvKeys = [
|
const modelEnvKeys = isCodexAgent
|
||||||
'CLAUDE_MODEL',
|
? ['CODEX_MODEL', 'CODEX_EFFORT']
|
||||||
'CLAUDE_EFFORT',
|
: ['CLAUDE_MODEL', 'CLAUDE_EFFORT', 'CODEX_MODEL', 'CODEX_EFFORT'];
|
||||||
'CODEX_MODEL',
|
|
||||||
'CODEX_EFFORT',
|
|
||||||
];
|
|
||||||
if (envOverrides) {
|
if (envOverrides) {
|
||||||
for (const key of modelEnvKeys) {
|
for (const key of modelEnvKeys) {
|
||||||
if (envOverrides[key]) {
|
if (envOverrides[key]) {
|
||||||
@@ -494,7 +492,6 @@ export async function runReviewerContainer(args: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const isCodexAgent = (group.agentType || 'claude-code') === 'codex';
|
|
||||||
if (isCodexAgent) {
|
if (isCodexAgent) {
|
||||||
execArgs.push('-e', 'CODEX_HOME=/home/node/.codex');
|
execArgs.push('-e', 'CODEX_HOME=/home/node/.codex');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user