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

Function parseCodexTokenUsageLog

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

Source from the content-addressed store, hash-verified

1096}
1097
1098function parseCodexTokenUsageLog(body) {
1099 const text = String(body || "");
1100 const usageMatch = text.match(/total_usage_tokens=(\d+)/);
1101 if (!usageMatch) return null;
1102 const limitMatch = text.match(/auto_compact_limit=(\d+)/);
1103 return {
1104 totalTokens: Number(usageMatch[1]),
1105 modelContextWindow: limitMatch ? Number(limitMatch[1]) : null
1106 };
1107}
1108
1109async function querySqliteRows(dbPath, query) {
1110 return new Promise((resolve, reject) => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected