Repository navigation
Highlight generic tool output by content type - #333923
Merged
Merged
Conversation
Use tool result MIME types to select the generic output editor language, with Agent Host JSON classification for object-shaped text output. Preserve separate editors for adjacent outputs with different languages. (Written by Copilot) Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Valid MIME values containing optional whitespace can incorrectly fall back to plaintext.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.ts — Valid MIME values may contain optional whitespace around the media type or parameter delimiter.… |
What changed in this PR
Improves generic tool-output syntax highlighting using MIME metadata and Agent Host output classification.
Changes:
- Selects editor languages from MIME types, defaulting to plaintext.
- Separates adjacent output chunks with different languages.
- Adds coverage for MIME selection and Agent Host conversion.
| File | Description |
|---|---|
chatInputOutputMarkdownProgressPart.ts |
Resolves output languages from MIME metadata. |
chatToolOutputContentSubPart.ts |
Separates differently highlighted chunks. |
stateToProgressAdapter.ts |
Classifies object-shaped Agent Host output as JSON. |
chatToolInputOutputContentPart.test.ts |
Tests language selection and chunk grouping. |
stateToProgressAdapter.test.ts |
Tests Agent Host MIME classification. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Trim the normalized media-type token so valid MIME values with surrounding whitespace still select the expected editor language. Cover leading whitespace and whitespace before parameters. (Written by Copilot) Co-authored-by: Copilot <[email protected]>
roblourens
marked this pull request as ready for review
September 2, 2026 01:33
roblourens
marked this pull request as draft
September 2, 2026 01:34
roblourens
marked this pull request as ready for review
September 2, 2026 01:59
roblourens
enabled auto-merge (squash)
September 2, 2026 01:59
Bhavya U (bhavyaus)
approved these changes
Sep 2, 2026
Abdullah Atrash (abdullahatrash)
added a commit
to abdullahatrash/flowleap-agent-v2
that referenced
this pull request
Sep 20, 2026
* port(chat-ui): preserve #file reference when editing text before it (#394) Upstream d750fe2 (microsoft#333965), applied clean with its tests. Typing before an existing #file attachment silently deleted the attachment. Adds touchesReference and findReferenceRangeForNonOverlappingEdit. * port(chat-ui): highlight generic tool output by content type (#394) Upstream 63acf08 (microsoft#333923). chatInputOutputMarkdownProgressPart.ts applied clean; the chatToolOutputContentSubPart.ts hunk was hand-applied because the fork's adjacent-code-part loop predates upstream's refactor. The agentHost stateToProgressAdapter.ts hunk and its test are dropped (Agent Host only). Our patent tools return large JSON payloads into exactly this part. * port(chat-ui): fix IME handling in the chat find widget (#394) Upstream b9861ad (microsoft#332950), applied clean with its tests. Composition input (CJK) broke search in the transcript find widget. * port(chat-ui): fix transcript Find keybindings (#394) Upstream cefc831 (microsoft#333135). chatFindActions.ts, chatFindWidget.ts, chatListWidget.ts and the find tests applied clean; the chatListWidget.test.ts hunk was hand-applied because that test file is diverged. Enter/Escape/F3 inside the transcript find widget went to the generic tree find instead of chat Find. * port(chat-ui): configurable paste-to-attachment threshold and Insert in Prompt (#394) Upstream e1801a0 (microsoft#331978). chatPasteProviders.ts, chatCopyActions.ts, constants.ts, chatAccessibilityHelp.ts, the chat.shared.contribution.ts configuration registration and the paste tests all applied clean. The src/vs/sessions hunks are left out: the fork has no caller of createPastedTextArtifact there, and sessions files belong to the deferred wave W. * port(chat-ui): remove the line requirement for paste attachments (#394) Upstream 36053db (microsoft#335100), hand-applied: the fork's chatPasteProviders.ts lacks the GitHub-URL pattern that surrounds the hunk, and its chatAccessibilityHelp.ts and both test files are behind upstream's base. A short paste now becomes an attachment on character count alone, so pasting a single-line claim works like pasting a multi-line one. * port(chat-ui): reuse text buffers for checkpoint replay (#394) Upstream 903d0d0 (microsoft#336095), applied clean with its tests. Checkpoint restore rebuilt a text model per replayed edit. * port(chat-ui): constrain symbol tools to the active workspace (#394) Upstream d8cfdc7 (microsoft#333144), applied clean with its tests. renameTool and usagesTool no longer reach outside the active workspace folder.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Validation
npm run transpile-client./scripts/test.sh --runGlob '**/{stateToProgressAdapter,chatToolInputOutputContentPart}.test.js'(146 passing)\n- ESLint on the five changed files\n-git diff --check\n\n(Written by Copilot)