Skip to content

feat(site/src/pages/AgentsPage/components): show context sizes and full .mcp.json paths#26614

Merged
kylecarbs merged 1 commit into
mainfrom
fix/chat-context-ui-detail-and-sizes
Jun 23, 2026
Merged

feat(site/src/pages/AgentsPage/components): show context sizes and full .mcp.json paths#26614
kylecarbs merged 1 commit into
mainfrom
fix/chat-context-ui-detail-and-sizes

Conversation

@kylecarbs

Copy link
Copy Markdown
Member

What

Two self-contained improvements to the chat context popover (ContextUsageIndicator):

  1. Size per category — each top-level section header (Context files, Skills, MCP) now shows a dimmed (N.N KiB) total of the OK resources it contains, so the context cost of each category is visible at a glance.
  2. Disambiguate multiple .mcp.json — MCP config resources are listed by their full path instead of the bare .mcp.json basename, so ~/.mcp.json and ~/project/.mcp.json are no longer rendered as two identical rows.

Why

From an internal review of the chat context system:

  • The popover gave no signal of how much context each category costs ("Show size per category").
  • Multiple .mcp.json files were indistinguishable in the UI (".mcp.json UI lacks detail").

Both are frontend-only and ship independently of the deeper backend work.

How

  • sumResourceBytes(resources, kinds) totals size_bytes for OK resources of the given kinds; a small SectionSize renders the (N.N KiB) suffix (reusing the existing formatKiB helper), omitted when the total is 0.
  • The MCP section now splits config resources (file-backed, shown by full path with FileIcon) from server resources (keyed by name, with their tools), instead of mapping both to a basename.

Testing

  • pnpm exec biome check (format + lint) clean on the changed files.
  • tsc -p . clean.
  • vitest --project=storybook ContextUsageIndicator.stories.tsx — 5/5 pass, including a new MultipleMcpConfigs story and added size assertions in Clean.

Scope / follow-ups (not in this PR)

Grouping MCP servers under their originating .mcp.json, and surfacing per-server connection errors inline in the MCP section, need backend support (the agent does not currently link a server resource to its config path); tracked separately. Showing the configured (pre-symlink-resolution) path for skills/files likewise needs a backend field.

Related review findings

Addresses the UI portions of two issues from the chat-context system review: "show size per category" and ".mcp.json UI lacks detail". The remaining parts of the latter (server→config grouping, inline errors) are backend-blocked and intentionally deferred.


This PR was created by Coder Agents on behalf of @kylecarbs.

…ll .mcp.json paths

Adds a per-category size suffix (Context files / Skills / MCP) to the chat
context popover so the context cost of each category is visible, and lists
MCP config resources by their full path so multiple .mcp.json files (e.g.
~/.mcp.json and ~/project/.mcp.json) are no longer rendered as identical
.mcp.json rows.

Generated by Coder Agents on behalf of @kylecarbs.
@kylecarbs kylecarbs merged commit 44f2a77 into main Jun 23, 2026
51 of 54 checks passed
@kylecarbs kylecarbs deleted the fix/chat-context-ui-detail-and-sizes branch June 23, 2026 13:36
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants