mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-31 20:03:37 +00:00
fix: centralize model prefix handling to prevent provider errors
Moves prefix stripping from individual providers to AgentService/IdeationService and adds validation to ensure providers receive bare model IDs. This prevents bugs like the Codex CLI receiving "codex-gpt-5.1-codex-max" instead of the expected "gpt-5.1-codex-max". - Add validateBareModelId() helper with fail-fast validation - Add originalModel field to ExecuteOptions for logging - Update all providers to validate model has no prefix - Centralize prefix stripping in service layer - Remove redundant prefix stripping from individual providers Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ import type {
|
||||
import {
|
||||
CODEX_MODEL_MAP,
|
||||
supportsReasoningEffort,
|
||||
validateBareModelId,
|
||||
type CodexApprovalPolicy,
|
||||
type CodexSandboxMode,
|
||||
type CodexAuthStatus,
|
||||
@@ -663,6 +664,10 @@ export class CodexProvider extends BaseProvider {
|
||||
}
|
||||
|
||||
async *executeQuery(options: ExecuteOptions): AsyncGenerator<ProviderMessage> {
|
||||
// Validate that model doesn't have a provider prefix
|
||||
// AgentService should strip prefixes before passing to providers
|
||||
validateBareModelId(options.model, 'CodexProvider');
|
||||
|
||||
try {
|
||||
const mcpServers = options.mcpServers ?? {};
|
||||
const hasMcpServers = Object.keys(mcpServers).length > 0;
|
||||
@@ -760,6 +765,7 @@ export class CodexProvider extends BaseProvider {
|
||||
}
|
||||
}
|
||||
|
||||
// Model is already bare (no prefix) - validated by executeQuery
|
||||
const args = [
|
||||
CODEX_EXEC_SUBCOMMAND,
|
||||
CODEX_YOLO_FLAG,
|
||||
|
||||
Reference in New Issue
Block a user