Skip to content

Commit 7f04a4a

Browse files
committed
feat(codex): normalize items and emit subagent task events
- Normalize commandExecution, fileChange, webSearch, mcpToolCall, and dynamicToolCall items to Claude-compatible data shapes with toolName + input + extras - Map Codex collabAgentToolCall (spawnAgent/wait/closeAgent) to task.started/task.completed events for AgentGroupCard rendering - Track subagent lifecycle idempotently across reconnects using SubagentTaskTracker keyed by parentThreadId|subagentThreadId - Surface durationMs for tasks and tool calls - Sanitize MCP server/tool segment names (__ → _) while preserving originals for McpToolCallCard
1 parent f95a4d2 commit 7f04a4a

29 files changed

Lines changed: 2269 additions & 57 deletions

apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,6 +2781,7 @@ describe("ProviderRuntimeIngestion", () => {
27812781
taskId: "turn-task-1",
27822782
status: "completed",
27832783
summary: "<proposed_plan>\n# Plan title\n</proposed_plan>",
2784+
durationMs: 1234,
27842785
},
27852786
});
27862787
harness.emit({
@@ -2835,6 +2836,7 @@ describe("ProviderRuntimeIngestion", () => {
28352836
);
28362837
expect(completed?.kind).toBe("task.completed");
28372838
expect(completedPayload?.detail).toBe("<proposed_plan>\n# Plan title\n</proposed_plan>");
2839+
expect(completedPayload?.durationMs).toBe(1234);
28382840
expect(
28392841
thread.proposedPlans.find(
28402842
(entry: ProviderRuntimeTestProposedPlan) => entry.id === "plan:thread-1:turn:turn-task-1",

apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,9 @@ function runtimeEventToActivities(
441441
status: event.payload.status,
442442
...(event.payload.summary ? { detail: truncateDetail(event.payload.summary) } : {}),
443443
...(event.payload.usage !== undefined ? { usage: event.payload.usage } : {}),
444+
...(event.payload.durationMs !== undefined
445+
? { durationMs: event.payload.durationMs }
446+
: {}),
444447
},
445448
turnId: toTurnId(event.turnId) ?? null,
446449
...maybeSequence,

0 commit comments

Comments
 (0)