(body)
| 1080 | } |
| 1081 | |
| 1082 | function parseCodexRateLimitsLog(body) { |
| 1083 | const text = String(body || ""); |
| 1084 | const marker = 'websocket event: {"type":"codex.rate_limits"'; |
| 1085 | const start = text.indexOf(marker); |
| 1086 | if (start === -1) return null; |
| 1087 | const jsonStart = text.indexOf("{", start); |
| 1088 | if (jsonStart === -1) return null; |
| 1089 | const jsonPayload = extractJsonObject(text, jsonStart); |
| 1090 | if (!jsonPayload) return null; |
| 1091 | try { |
| 1092 | return JSON.parse(jsonPayload); |
| 1093 | } catch { |
| 1094 | return null; |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | function parseCodexTokenUsageLog(body) { |
| 1099 | const text = String(body || ""); |
no test coverage detected