Files
roboco/roboco
Renn F c20c9f6ea5 fix(usage): capture tokens by reading the agent transcript at finalize
Spawn sessions recorded 0 tokens in production despite the full capture chain
being deployed (hook in the image, settings registering it, /usage/sync, the
finalize fetch). The chain is inherently racy: token counts live in the SDK
server's in-memory state inside a short-lived agent container, and the
orchestrator races to fetch /usage/status before the container is torn down —
so for cold-respawned agents the fetch returns nothing (verified: parser and
transcripts are correct, every spawn-session row was still 0).

Read the durable source of truth instead. The host ~/.claude is already mounted
into the orchestrator, so at finalize, when the SDK fetch yields nothing, sum
the agent's newest Claude Code transcript directly (_usage_from_transcript +
the existing _sum_transcript_usage). Removes the race entirely — usage is
captured regardless of container timing.
2026-06-11 20:09:23 +02:00
..
2026-06-11 18:16:20 +02:00
2026-06-11 18:16:20 +02:00