Add Codex MCP agent provider
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import type { Options as ClaudeAgentOptions } from "@anthropic-ai/claude-agent-sdk";
|
import type { Options as ClaudeAgentOptions } from "@anthropic-ai/claude-agent-sdk";
|
||||||
|
|
||||||
export type AgentProvider = "codex" | "claude";
|
export type AgentProvider = "codex" | "codex-mcp" | "claude";
|
||||||
|
|
||||||
export type AgentMode = {
|
export type AgentMode = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export async function fetchProviderModelCatalog(
|
|||||||
if (provider === "claude") {
|
if (provider === "claude") {
|
||||||
return fetchClaudeModelCatalog(options);
|
return fetchClaudeModelCatalog(options);
|
||||||
}
|
}
|
||||||
if (provider === "codex") {
|
if (provider === "codex" || provider === "codex-mcp") {
|
||||||
return fetchCodexModelCatalog();
|
return fetchCodexModelCatalog();
|
||||||
}
|
}
|
||||||
throw new Error(`Unsupported provider '${provider}'`);
|
throw new Error(`Unsupported provider '${provider}'`);
|
||||||
|
|||||||
@@ -68,6 +68,14 @@ export const AGENT_PROVIDER_DEFINITIONS: AgentProviderDefinition[] = [
|
|||||||
defaultModeId: "auto",
|
defaultModeId: "auto",
|
||||||
modes: CODEX_MODES,
|
modes: CODEX_MODES,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "codex-mcp",
|
||||||
|
label: "Codex MCP",
|
||||||
|
description:
|
||||||
|
"Codex workspace agent via MCP with streaming events and permission elicitation",
|
||||||
|
defaultModeId: "auto",
|
||||||
|
modes: CODEX_MODES,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export function getAgentProviderDefinition(provider: AgentProvider): AgentProviderDefinition {
|
export function getAgentProviderDefinition(provider: AgentProvider): AgentProviderDefinition {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -12,13 +12,14 @@ Build a new Codex MCP provider side‑by‑side with the existing Codex SDK prov
|
|||||||
- Ensure it fails before implementation.
|
- Ensure it fails before implementation.
|
||||||
- **Done (2025-12-24 17:57)**: Expanded Codex MCP e2e tests to cover basic response, permissions allow/deny, and abort flow; updated typings and helpers.
|
- **Done (2025-12-24 17:57)**: Expanded Codex MCP e2e tests to cover basic response, permissions allow/deny, and abort flow; updated typings and helpers.
|
||||||
|
|
||||||
- [ ] **Implement**: `codex-mcp-agent.ts` provider so tests pass.
|
- [x] **Implement**: `codex-mcp-agent.ts` provider so tests pass.
|
||||||
|
|
||||||
- MCP stdio client + session lifecycle.
|
- MCP stdio client + session lifecycle.
|
||||||
- `codex` / `codex-reply` calls.
|
- `codex` / `codex-reply` calls.
|
||||||
- `codex/event` mapping to AgentStreamEvent.
|
- `codex/event` mapping to AgentStreamEvent.
|
||||||
- Elicitation → permission requests + responses.
|
- Elicitation → permission requests + responses.
|
||||||
- Abort/close handling.
|
- Abort/close handling.
|
||||||
|
- **Done (2025-12-24 18:12)**: Added Codex MCP provider with stdio client, event mapping, permissions, persistence, and abort handling.
|
||||||
|
|
||||||
- [ ] **Test (E2E)**: Run tests and add follow-up tasks based on results.
|
- [ ] **Test (E2E)**: Run tests and add follow-up tasks based on results.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user