Skip to content

feat: surface cache token usage in exec usage footer - #296

Merged
Patel230 merged 1 commit into
mainfrom
feat/exec-cache-footer
Sep 7, 2026
Merged

feat: surface cache token usage in exec usage footer#296
Patel230 merged 1 commit into
mainfrom
feat/exec-cache-footer

Conversation

@Patel230

@Patel230 Patel230 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

exec's usage footer reported total in/out tokens but omitted cache read/write, unlike --print's footer which shows them.

Track CacheReadTokens/CacheWriteTokens in the streaming loop and include a cache N read · M write segment in the footer when nonzero, so cost-conscious exec users see prompt-caching savings. Footer still writes to stderr and honors --quiet. stream-json output is unchanged.

Verification

  • go build ./..., go vet ./cmd/, gofumpt -l clean.
  • go test ./... exit 0 (ran with -p 1 due to shared-machine process pressure).

exec's usage footer reported total in/out tokens but omitted cache read/write,
unlike --print's footer which shows them. Track CacheReadTokens/CacheWriteTokens
in the streaming loop and include a 'cache N read · M write' segment in the
footer when nonzero, so cost-conscious exec users see prompt-caching savings.
Footer still writes to stderr and honors --quiet. stream-json output is
unchanged.
@Patel230
Patel230 merged commit f82f3e1 into main Sep 7, 2026
25 of 26 checks passed
@Patel230
Patel230 deleted the feat/exec-cache-footer branch September 7, 2026 09:41
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.

1 participant