updateMostRecentToolWithDuration updates the tool with maximum duration Since we can't perfectly correlate duration lines with specific tool calls in Codex logs, we approximate by updating any tool that doesn't have a duration yet, or updating the max
(toolCallMap map[string]*ToolCallInfo, duration time.Duration)
| 200 | // Since we can't perfectly correlate duration lines with specific tool calls in Codex logs, |
| 201 | // we approximate by updating any tool that doesn't have a duration yet, or updating the max |
| 202 | func (e *CodexEngine) updateMostRecentToolWithDuration(toolCallMap map[string]*ToolCallInfo, duration time.Duration) { |
| 203 | // Find a tool that either has no duration yet or can be updated with a larger duration |
| 204 | for _, toolInfo := range toolCallMap { |
| 205 | if toolInfo.MaxDuration == 0 || duration > toolInfo.MaxDuration { |
| 206 | toolInfo.MaxDuration = duration |
| 207 | // Only update one tool per duration line to avoid over-attribution |
| 208 | break |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | // extractOutputSizeFromResult extracts output size from success/failure result lines |
| 214 | // Returns the character count of the output content if found, 0 otherwise |
no outgoing calls
no test coverage detected