update
This commit is contained in:
1 parent
09971cabc2
commit
9145572422
163 files changed
+3348
-2874
No files matched your search
@@ -4,6 +4,7 @@ export function parseCodexJsonl(stdout: string) {
|
||||
let sessionId: string | null = null;
|
||||
const messages: string[] = [];
|
||||
let errorMessage: string | null = null;
|
||||
let costUsd: number | null = null;
|
||||
const usage = {
|
||||
inputTokens: 0,
|
||||
cachedInputTokens: 0,
|
||||
@@ -43,6 +44,8 @@ export function parseCodexJsonl(stdout: string) {
|
||||
usage.inputTokens = asNumber(usageObj.input_tokens, usage.inputTokens);
|
||||
usage.cachedInputTokens = asNumber(usageObj.cached_input_tokens, usage.cachedInputTokens);
|
||||
usage.outputTokens = asNumber(usageObj.output_tokens, usage.outputTokens);
|
||||
const rawCost = event.total_cost_usd;
|
||||
if (typeof rawCost === "number" && Number.isFinite(rawCost)) costUsd = rawCost;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -50,6 +53,8 @@ export function parseCodexJsonl(stdout: string) {
|
||||
const err = parseObject(event.error);
|
||||
const msg = asString(err.message, "").trim();
|
||||
if (msg) errorMessage = msg;
|
||||
const rawCost = event.total_cost_usd;
|
||||
if (typeof rawCost === "number" && Number.isFinite(rawCost)) costUsd = rawCost;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +62,7 @@ export function parseCodexJsonl(stdout: string) {
|
||||
sessionId,
|
||||
summary: messages.join("\n\n").trim(),
|
||||
usage,
|
||||
costUsd,
|
||||
errorMessage,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user