fix: use correct path to usage in meta

Usage is at result.meta.agentMeta.usage, not result.meta.usage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ryan McMillan 2026-01-28 15:56:15 -06:00
parent 0fbe3ac29e
commit 5eeac66824

View File

@ -492,7 +492,7 @@ export async function agentCommand(
content: [{ type: "text", text: result.payloads[0].text }],
timestamp: Date.now(),
stopReason: "cli",
usage: result.meta?.usage ?? { input: 0, output: 0, totalTokens: 0 },
usage: result.meta?.agentMeta?.usage ?? { input: 0, output: 0, totalTokens: 0 },
},
};
fs.appendFileSync(transcriptPath, JSON.stringify(messageEntry) + "\n", "utf-8");