You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Carved out of #9 (claude.print adapter) — see the scope decision recorded on that
issue. #9 ships the adapter and normalizes exit_status, stdout, stderr, structured_output, and artifacts, but deliberately does not plumb the Agent
CLI's reported token/cost usage, because doing so extends the vendor-neutral Adapter
contract (ADR 0006) and the persisted node output shape — a cross-cutting change worth
its own issue.
This issue adds usage as a first-class, vendor-neutral concept:
Add a neutral usage representation to AgentResult (e.g. input/output tokens and
a cost figure), populated by each real Adapter from the CLI's own usage report
(claude -p --output-format json exposes token counts and total_cost_usd; codex exec exposes its equivalent).
Surface usage where run results are shown. The dedicated Reporter is Reporters and caw report in four formats #12; until it
lands, the existing caw run / caw resume run summary is the surfacing point.
Update ADR 0006 to record the contract extension (the AgentResult.usage field and the
rule that usage rides inside the persisted output, not a new column).
Acceptance criteria
AgentResult carries a vendor-neutral usage value; the claude.print adapter
populates it from the CLI's JSON usage report
Usage is persisted in State within the node's normalized output (no new State column)
Parent
#1
What to build
Carved out of #9 (claude.print adapter) — see the scope decision recorded on that
issue. #9 ships the adapter and normalizes
exit_status,stdout,stderr,structured_output, andartifacts, but deliberately does not plumb the AgentCLI's reported token/cost usage, because doing so extends the vendor-neutral Adapter
contract (ADR 0006) and the persisted node output shape — a cross-cutting change worth
its own issue.
This issue adds usage as a first-class, vendor-neutral concept:
usagerepresentation toAgentResult(e.g. input/output tokens anda cost figure), populated by each real Adapter from the CLI's own usage report
(
claude -p --output-format jsonexposes token counts andtotal_cost_usd;codex execexposes its equivalent).usagethroughNodeResultinto State, persisted inside the node's existingnormalized_outputJSON payload (no new State column — avoids a schema migration ofthe kind Resume across schema versions: node.cause column has no migration #76 had to repair).
lands, the existing
caw run/caw resumerun summary is the surfacing point.AgentResult.usagefield and therule that usage rides inside the persisted output, not a new column).
Acceptance criteria
AgentResultcarries a vendor-neutralusagevalue; theclaude.printadapterpopulates it from the CLI's JSON usage report
caw reportonce Reporters and caw report in four formats #12 landsusagecontract extensioncodex.exec(codex.exec adapter with symmetric capabilities #11) populates the sameusagefield symmetrically (or this is trackedas codex.exec adapter with symmetric capabilities #11's own symmetry criterion)
the CLI is absent
Blocked by
Related