feat(agents): Markdown toggle and token breakdown in Compare versions drawer - #353
Merged
Merged
Conversation
- Render agent responses as Markdown by default with a shared Markdown / Plain text toggle that applies to both columns and persists across version switches and resets. - Reorganize stats into two rows: Latency, Cost, Tool calls and Tokens, with Input / Output / Cache directly beneath Tokens. Container-query layout stacks the token group on narrow columns. - Show "—" for token values no answer reported, keeping reported zeros as 0; derive total from input + output when missing. - Extract the transcript Markdown renderer into a shared AgentMarkdown component and restore list markers stripped by Tailwind preflight. - Translate all drawer strings (en/tr). - Add unit tests for usage parsing, totals and translation keys. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The Compare versions drawer showed agent answers as raw text, so a structured answer (headings, lists, tables) was hard to read and compare. Its stats row showed only a total token count. This PR renders answers as Markdown by default, adds a toggle to switch to plain text, and adds an Input / Output / Cache token breakdown directly beneath the Tokens stat.
Changes
—with a "Not reported by the model" tooltip, while a reported zero still shows0. When an answer gives input and output but no total, the total is now calculated from them (before, the Tokens stat showed—). The Cache label's tooltip explains that cached tokens are already counted in Input.AgentMarkdowncomponent, so both views look the same. It also brings back list bullets and numbers, which Tailwind's CSS reset was removing. The transcript had the same missing-bullets problem, so this fixes it there too.agents.comparetranslation keys in English and Turkish.src/__tests__/unit/agent-compare-versions-stats.test.tscovers reading token usage from the response, "not reported" versus zero, the totals, the default display mode, and that Turkish has every English translation key.Validation
npm run lint: 0 errors. There are 208 warnings elsewhere in the repo; none are in the changed files.npx tsc --noEmitnpm run testwas not run.npm run buildnpm run docs:build: not run. No docs were changed.localhostagainst a real agent comparing v1 and v2: Markdown on and off, the stats layout, and the token breakdown.Release Notes