MCPcopy Create free account
hub / github.com/Epic0522/Codex-Remote-Contact / parseCodexRateLimitsLog

Function parseCodexRateLimitsLog

src/server.js:1082–1096  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

1080}
1081
1082function 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
1098function parseCodexTokenUsageLog(body) {
1099 const text = String(body || "");

Callers 1

Calls 1

extractJsonObjectFunction · 0.85

Tested by

no test coverage detected