Parent
#62
What to build
ADR 0013 §5 and the SPA side of the change.
AgentStepFinished gains optional context: { used, size } and
cost: { amount, currency }, taken from the last usage signal of the step, including for
cancelled steps. Update the usage doc comment: "as the agent reports it", which means the
last message on opencode and the whole turn on Claude.
- Run detail shows context in use and window size from
context where present. It falls
back to agentStepContextTokens for old logs. Cost shows per step and summed per run where
present.
- Live context: while a step runs, the SPA reads the
acp.usage CUSTOM chunks to show
context filling up.
- Transcript tool titles: ACP tool calls carry a descriptive title (
Edit math.ts) in the
raw event. Show it instead of the generic kind (edit, read, execute) where present.
- Tests for the schema, the fold, and the rendering.
Acceptance
bun run check and bun run test:e2e green.
- A real Claude run shows context and cost in run detail. Validate in the browser.
Parent
#62
What to build
ADR 0013 §5 and the SPA side of the change.
AgentStepFinishedgains optionalcontext: { used, size }andcost: { amount, currency }, taken from the lastusagesignal of the step, including forcancelled steps. Update the
usagedoc comment: "as the agent reports it", which means thelast message on opencode and the whole turn on Claude.
contextwhere present. It fallsback to
agentStepContextTokensfor old logs. Cost shows per step and summed per run wherepresent.
acp.usageCUSTOM chunks to showcontext filling up.
Edit math.ts) in theraw event. Show it instead of the generic kind (
edit,read,execute) where present.Acceptance
bun run checkandbun run test:e2egreen.