fix: skip role model override on failover handoffs
When forcedAgentType is set (failover), the role's configured model (e.g. claude-opus-4-6 for reviewer) was injected as CODEX_MODEL, causing codex SDK to reject it. Now model overrides are only injected for the primary agent type, not failover runs.
This commit is contained in:
@@ -494,7 +494,9 @@ export async function runReviewerContainer(args: {
|
||||
containerName,
|
||||
groupAgentType: group.agentType,
|
||||
isCodexAgent,
|
||||
runnerPath: isCodexAgent ? '/app/codex/dist/index.js' : '/app/agent/dist/index.js',
|
||||
runnerPath: isCodexAgent
|
||||
? '/app/codex/dist/index.js'
|
||||
: '/app/agent/dist/index.js',
|
||||
},
|
||||
'Container exec runner selection',
|
||||
);
|
||||
|
||||
@@ -194,8 +194,11 @@ export async function runAgentForGroup(
|
||||
roomRoleContext,
|
||||
hasHumanMessage: args.hasHumanMessage,
|
||||
});
|
||||
// Inject role-specific model overrides into envOverrides
|
||||
if (pairedExecutionContext) {
|
||||
// Inject role-specific model overrides into envOverrides.
|
||||
// When running a forced agent type (failover), skip the role's configured
|
||||
// model — it belongs to the primary agent type (e.g. claude-opus-4-6 for
|
||||
// a claude-code reviewer) and would be rejected by the fallback runtime.
|
||||
if (pairedExecutionContext && !args.forcedAgentType) {
|
||||
const roleConfig = getRoleModelConfig(activeRole);
|
||||
if (roleConfig.model) {
|
||||
const modelKey = isClaudeCodeAgent ? 'CLAUDE_MODEL' : 'CODEX_MODEL';
|
||||
|
||||
Reference in New Issue
Block a user