Remove default model from Codex MCP config
This commit is contained in:
@@ -504,7 +504,6 @@ describe("CodexMcpAgentClient (MCP integration)", () => {
|
|||||||
provider: "codex-mcp",
|
provider: "codex-mcp",
|
||||||
cwd,
|
cwd,
|
||||||
modeId: "full-access",
|
modeId: "full-access",
|
||||||
model: "gpt-5.1-codex",
|
|
||||||
} as AgentSessionConfig;
|
} as AgentSessionConfig;
|
||||||
|
|
||||||
let session: AgentSession | null = null;
|
let session: AgentSession | null = null;
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ const CODEX_MODES: AgentMode[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const DEFAULT_CODEX_MODE_ID = "auto";
|
const DEFAULT_CODEX_MODE_ID = "auto";
|
||||||
const DEFAULT_CODEX_MODEL_ID = "gpt-5.1-codex";
|
|
||||||
|
|
||||||
const MODE_PRESETS: Record<
|
const MODE_PRESETS: Record<
|
||||||
string,
|
string,
|
||||||
@@ -219,14 +218,17 @@ function buildCodexMcpConfig(
|
|||||||
const sandbox = config.sandboxMode ?? preset.sandbox;
|
const sandbox = config.sandboxMode ?? preset.sandbox;
|
||||||
const extra = config.extra?.codex ?? undefined;
|
const extra = config.extra?.codex ?? undefined;
|
||||||
|
|
||||||
return {
|
const configPayload: Record<string, unknown> = {
|
||||||
prompt,
|
prompt,
|
||||||
cwd: config.cwd,
|
cwd: config.cwd,
|
||||||
model: config.model ?? DEFAULT_CODEX_MODEL_ID,
|
|
||||||
"approval-policy": approvalPolicy,
|
"approval-policy": approvalPolicy,
|
||||||
sandbox,
|
sandbox,
|
||||||
config: extra,
|
config: extra,
|
||||||
};
|
};
|
||||||
|
if (typeof config.model === "string" && config.model.length > 0) {
|
||||||
|
configPayload.model = config.model;
|
||||||
|
}
|
||||||
|
return configPayload;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isUnsupportedChatGptModelError(error: unknown): boolean {
|
function isUnsupportedChatGptModelError(error: unknown): boolean {
|
||||||
@@ -715,10 +717,6 @@ class CodexMcpAgentSession implements AgentSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.updateIdentifiersFromResponse(response);
|
this.updateIdentifiersFromResponse(response);
|
||||||
if (this.modelRejected && !this.runtimeModel) {
|
|
||||||
this.runtimeModel = DEFAULT_CODEX_MODEL_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!turnState.sawAssistant) {
|
if (!turnState.sawAssistant) {
|
||||||
const text = extractTextContent(response);
|
const text = extractTextContent(response);
|
||||||
if (text) {
|
if (text) {
|
||||||
|
|||||||
@@ -74,12 +74,13 @@ Build a new Codex MCP provider side‑by‑side with the existing Codex SDK prov
|
|||||||
- Update tests and provider to use a valid default model.
|
- Update tests and provider to use a valid default model.
|
||||||
- **Done (2025-12-24 18:58)**: Updated Codex MCP default model to gpt-5.1-codex and switched runtime info test to use the valid model id.
|
- **Done (2025-12-24 18:58)**: Updated Codex MCP default model to gpt-5.1-codex and switched runtime info test to use the valid model id.
|
||||||
|
|
||||||
- [ ] **Fix**: Remove hardcoded default model - passthrough user choice.
|
- [x] **Fix**: Remove hardcoded default model - passthrough user choice.
|
||||||
|
|
||||||
- Pass `config.model` if user specifies one.
|
- Pass `config.model` if user specifies one.
|
||||||
- If user doesn't specify, omit `model` field - let Codex CLI pick its default.
|
- If user doesn't specify, omit `model` field - let Codex CLI pick its default.
|
||||||
- Do NOT hardcode any fallback model in the provider.
|
- Do NOT hardcode any fallback model in the provider.
|
||||||
- Tests should not specify a model unless testing model passthrough.
|
- Tests should not specify a model unless testing model passthrough.
|
||||||
|
- **Done (2025-12-24 19:14)**: Dropped the default model constant, omitted `model` from MCP config when unset, and removed the hardcoded fallback in runtime info; adjusted Codex MCP runtime test to avoid specifying a model.
|
||||||
|
|
||||||
- [ ] **Review**: Flag ALL workarounds/hacks in `codex-mcp-agent.ts` - they are NOT acceptable.
|
- [ ] **Review**: Flag ALL workarounds/hacks in `codex-mcp-agent.ts` - they are NOT acceptable.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user