* Extract the model name from Codex log header lines. * Codex logs include a line like "model: o4-mini" near the top. * @param {string} logContent - The raw log content * @returns {string|null} The model name, or null if not found
(logContent)
| 280 | * @returns {string|null} The model name, or null if not found |
| 281 | */ |
| 282 | function extractCodexModel(logContent) { |
| 283 | const match = logContent.match(/^model:\s*(.+)$/m); |
| 284 | if (match) { |
| 285 | return match[1].trim(); |
| 286 | } |
| 287 | // Fallback for the experimental JSONL format, which has no "model:" header line. |
| 288 | // The codex harness logs the resolved spawn command, e.g. |
| 289 | // [codex-harness] ... spawning: codex exec --model gpt-5.4 -c ... |
| 290 | const spawnMatch = logContent.match(/spawning:\s*codex\s+exec\s+--model\s+(\S+)/); |
| 291 | if (spawnMatch) { |
| 292 | return spawnMatch[1].trim(); |
| 293 | } |
| 294 | return null; |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * Detects whether the log is in the Codex experimental JSONL event format. |
no outgoing calls
no test coverage detected