Fix Codex MCP thread item event normalization
This commit is contained in:
@@ -910,12 +910,6 @@ class CodexMcpAgentSession implements AgentSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleMcpEvent(event: unknown): void {
|
private handleMcpEvent(event: unknown): void {
|
||||||
this.emitEvent({
|
|
||||||
type: "provider_event",
|
|
||||||
provider: "codex-mcp",
|
|
||||||
raw: event,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!event || typeof event !== "object") {
|
if (!event || typeof event !== "object") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -933,8 +927,19 @@ class CodexMcpAgentSession implements AgentSession {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const normalizedType = normalizeThreadEventType(type);
|
||||||
|
const providerRaw =
|
||||||
|
normalizedType !== type ? { ...eventRecord, type: normalizedType } : eventRecord;
|
||||||
|
|
||||||
|
this.emitEvent({
|
||||||
|
type: "provider_event",
|
||||||
|
provider: "codex-mcp",
|
||||||
|
raw: providerRaw,
|
||||||
|
});
|
||||||
|
|
||||||
|
type = normalizedType;
|
||||||
if (type.includes(".") || type.startsWith("turn.") || type.startsWith("thread.") || type.startsWith("item.")) {
|
if (type.includes(".") || type.startsWith("turn.") || type.startsWith("thread.") || type.startsWith("item.")) {
|
||||||
this.handleThreadEvent(eventRecord);
|
this.handleThreadEvent(providerRaw);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -265,7 +265,8 @@ Build a new Codex MCP provider side‑by‑side with the existing Codex SDK prov
|
|||||||
- [x] **Fix**: Codex MCP command output should include exit codes for command tool calls (missing in timeline mapping).
|
- [x] **Fix**: Codex MCP command output should include exit codes for command tool calls (missing in timeline mapping).
|
||||||
- **Done (2025-12-24 20:33)**: Normalized exit code parsing so numeric strings are captured in timeline output.
|
- **Done (2025-12-24 20:33)**: Normalized exit code parsing so numeric strings are captured in timeline output.
|
||||||
|
|
||||||
- [ ] **Fix**: Codex MCP thread/item event mapping for file_change, mcp_tool_call, web_search, and todo_list still failing.
|
- [x] **Fix**: Codex MCP thread/item event mapping for file_change, mcp_tool_call, web_search, and todo_list still failing.
|
||||||
|
- **Done (2025-12-24 20:38)**: Normalized MCP provider event payloads to surface item events and thread/item types consistently for timeline mapping.
|
||||||
|
|
||||||
- [ ] **Fix**: Codex MCP should emit error timeline items for failed turns (currently none).
|
- [ ] **Fix**: Codex MCP should emit error timeline items for failed turns (currently none).
|
||||||
|
|
||||||
@@ -287,9 +288,7 @@ Build a new Codex MCP provider side‑by‑side with the existing Codex SDK prov
|
|||||||
- Interrupt completes in < 1 second
|
- Interrupt completes in < 1 second
|
||||||
- No zombie processes left running
|
- No zombie processes left running
|
||||||
- Session state is clean (can start new session)
|
- Session state is clean (can start new session)
|
||||||
- Test BOTH:
|
- Test Codex MCP provider interruption only (SDK is deprecated)
|
||||||
- Codex MCP provider interruption
|
|
||||||
- Codex SDK provider interruption (if applicable)
|
|
||||||
- This is critical for user experience - users expect immediate response to cancel
|
- This is critical for user experience - users expect immediate response to cancel
|
||||||
|
|
||||||
- [ ] **Test (E2E)**: Permission flow parity - test both Codex MCP and Claude providers.
|
- [ ] **Test (E2E)**: Permission flow parity - test both Codex MCP and Claude providers.
|
||||||
|
|||||||
Reference in New Issue
Block a user