GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: show cache tokens on AI Gateway session page by ssncferreira · Pull Request #30511 · coder/coder

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Oct 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description

Shows cache read and cache write tokens on the AI Gateway session page, and removes the token usage from tool call blocks in the agentic loop.

A tool call block showed the token usage of the interception (model response) that made the call. When one response made several tool calls, every block repeated the same numbers, which read as per-tool usage and did not add up to the prompt total. Token usage cannot be attributed to a single tool call, so it is removed there and stays on the prompt panel.

Changes

  • Rename the "In / out tokens" row to "Tokens" in the session summary and the prompt panel, and show cache read / write tokens below input / output, using the existing cache_read_input_tokens and cache_write_input_tokens fields. The tooltip shows input / output, cache read / write and the token usage metadata.
  • Remove the "In / out tokens" row from tool call blocks.
  • TokenBadges takes optional cache tokens. The sessions list does not pass them, so it is unchanged.

Related to AIGOV-600

Screenshots 1-summary-and-prompt 2-summary-and-prompt-hover

Note

Generated by Coder Agents on behalf of @ssncferreira.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ssncferreira
ssncferreira added this pull request to stack #30513 October 8, 2026 16:37
@github-actions github-actions Bot assigned ssncferreira Oct 8, 2026
@linear-code

linear-code Bot commented Oct 8, 2026

Copy link
Copy Markdown

AIGOV-600

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 94f2327 to f4a7044 Compare October 21, 2026 16:14
@ssncferreira ssncferreira changed the title feat(site/src/pages/AIBridgePage): show cache tokens on AI Gateway session page feat: show cache tokens on AI Gateway session page Oct 21, 2026
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from f4a7044 to 74d4ef9 Compare October 22, 2026 09:40
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 74d4ef9 to b22577a Compare October 22, 2026 09:42
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from b22577a to 62edd51 Compare October 22, 2026 16:15
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 62edd51 to 4741a9f Compare October 22, 2026 16:19
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 4741a9f to 77055cb Compare October 22, 2026 16:20
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 77055cb to 208f6d3 Compare October 22, 2026 16:26
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 208f6d3 to 4c3891a Compare October 22, 2026 16:28
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 4c3891a to efd9374 Compare October 22, 2026 16:35
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from efd9374 to 532fbc6 Compare October 22, 2026 16:40
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 532fbc6 to 3723f73 Compare October 22, 2026 16:41
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 3723f73 to 0584179 Compare October 22, 2026 16:45
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 0584179 to d46546c Compare October 22, 2026 16:45
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from d46546c to 0190bd5 Compare October 22, 2026 16:46
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 0190bd5 to 0500454 Compare October 22, 2026 16:46
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 0500454 to 25609c3 Compare October 22, 2026 16:48
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch 3 times, most recently from 4cddec5 to fd7a437 Compare October 22, 2026 17:38
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from fd7a437 to 2e39017 Compare October 23, 2026 09:43
@ssncferreira
ssncferreira marked this pull request as ready for review October 23, 2026 09:45
@ssncferreira
ssncferreira requested a review from jeremyruppel October 23, 2026 09:45
@coderagents

coderagents Bot commented Oct 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/ai-gateway/audit.md (open) - The "Session detail" section says "Within a thread, each step shows token usage, tool call details...", but this PR removes the token usage row from tool call blocks in the agentic loop; token usage now only appears on the prompt panel and the session summary. Update the sentence so it does not say each step shows token usage.
  • docs/ai-coder/ai-gateway/audit.md (open) - The session summary "Tokens" row and prompt panel now also show cache read and cache write tokens. The "Session detail" section describes the summary card and its data but never mentions cache read/write tokens. Note that the token breakdown now includes cache read and cache write in addition to input and output.

Automated review via Coder Agents

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ssncferreira
ssncferreira requested a review from nickvigilante as a code owner October 23, 2026 10:16
@github-actions

github-actions Bot commented Oct 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

  • docs/ai-coder/ai-gateway/audit.md
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jeremyruppel
jeremyruppel reviewed Oct 23, 2026
View reviewed changes
Comment thread site/src/pages/AIBridgePage/TokenBadges.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

jeremyruppel
jeremyruppel approved these changes Oct 23, 2026
View reviewed changes
nickvigilante
nickvigilante reviewed Oct 24, 2026
View reviewed changes

@nickvigilante nickvigilante left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation Check

I checked the new and edited sentences in docs/ai-coder/ai-gateway/audit.md against the code at the head of this PR (session/thread token usage aggregation, the prompt panel, the session summary card, and the removal of token rows from tool call blocks). The new wording correctly describes what the UI now shows, and the sessions list is correctly left unchanged. No documentation changes are needed.

Related open PRs

  • #30512 will change the same two paragraphs in docs/ai-coder/ai-gateway/audit.md to add cost. No conflict with this review.

Generated by Coder Agents on behalf of @nickvigilante, using the proposed doc-check skill from #31193 on Solstice-1 Local. Reply in a thread if a finding is wrong.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nickvigilante nickvigilante mentioned this pull request Oct 24, 2026
feat: show cost and model prices on AI Gateway session page #30512
Merged
ssncferreira added 3 commits October 26, 2026 08:50
@ssncferreira
feat: show cache tokens on AI Gateway session page
bfaf264
@ssncferreira
docs: describe cache tokens in AI Gateway session detail
baa21b9
@ssncferreira
refactor: rename icon to Icon in TokenBadges
7b4ef63
@ssncferreira
ssncferreira force-pushed the ssncf/aibridge-session-cache-tokens branch from 58f4180 to 7b4ef63 Compare October 26, 2026 08:50
@ssncferreira
ssncferreira merged commit 9efe7a3 into main Oct 26, 2026
35 of 56 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ssncferreira
ssncferreira deleted the ssncf/aibridge-session-cache-tokens branch October 26, 2026 10:01
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@nickvigilante nickvigilante nickvigilante left review comments
@jeremyruppel jeremyruppel jeremyruppel approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ssncferreira ssncferreira

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ssncferreira @jeremyruppel @nickvigilante
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.