Skip to content

feat: accumulate and report token usage - #6

Merged
melvincarvalho merged 1 commit into
gh-pagesfrom
issue-5-token-usage
Jun 11, 2026
Merged

melvincarvalho merged 1 commit into
gh-pagesfrom
issue-5-token-usage

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Fixes #5. Companion to jsclaw/jsclaw#39. Usage summed across agent-loop iterations, cache reads/writes counted as input; emitted as usage: {input_tokens, output_tokens} in ContainerOutput. Tests 18/18 (loop test asserts accumulation); verified live through the gateway: a tool-using turn reported 3220 in / 303 out.

Sum usage across loop iterations (cache read/creation count as
input) and emit it in the ContainerOutput JSON.
@melvincarvalho
melvincarvalho merged commit db6b0e8 into gh-pages Jun 11, 2026
@melvincarvalho
melvincarvalho deleted the issue-5-token-usage branch June 11, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report token usage in ContainerOutput

1 participant