Fix Codex provider to detect file edits from patch_apply_end events

Codex records file modifications as event_msg entries with type
patch_apply_end rather than function_call tool invocations. This fix
tracks those events and adds Edit to the tools list, enabling proper
calculation of edit turns, one-shot rates, and retry rates.

Fixes edit detection showing 0 edit turns despite actual file changes.
This commit is contained in:
AgentSeal 2026-04-24 19:59:13 +02:00
parent 8c2fc4ffe8
commit 396c8b542c

View file

@ -183,6 +183,11 @@ function createParser(source: SessionSource, seenKeys: Set<string>): SessionPars
continue
}
if (entry.type === 'event_msg' && entry.payload?.type === 'patch_apply_end') {
pendingTools.push('Edit')
continue
}
if (entry.type === 'response_item' && entry.payload?.type === 'message' && entry.payload?.role === 'user') {
const texts = (entry.payload.content ?? [])
.filter(c => c.type === 'input_text')