feat(assistant): refine tool display and streaming behavior - #1390
Merged
Conversation
Add a generic tool labeler (`getToolText`/`getToolSuffix`/`getToolIcon`)
so any MCP server's tools render with clean labels, suffixes and icons
instead of falling back to raw tool names. Split the stable verb from
the dynamic detail and render it as a suffix.
Make tool output fully scrollable instead of truncating it, and parse
the standard MCP `{ content: [{ text }] }` envelope generically.
On the backend, replace the custom stop condition with `stepCountIs`,
force a final text answer on the last step via `prepareStep`, bump
`maxOutputTokens` to 8000, enable gateway caching and `smoothStream`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
HugoRCD
approved these changes
Jun 8, 2026
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
Ports the relevant improvements from nuxt/nuxt.com#2265 to the Docus assistant, adapted to the generic/configurable setup (any MCP server, configurable model).
Tool display (
layer/app/utils/assistantTools.ts)AssistantPanelandAssistantDemo:getToolTextderives a stable label from the tool name's verb prefix (list/search→ Searched,get/read→ Read, etc.)getToolSuffixpulls the dynamic detail from common input keys (search,query,path,slug,templateName,componentName, …) and renders it as aUChatToolsuffixgetToolIconmaps tool names to icons by keyword (component, template, composable, blog, changelog, deploy, page/doc, …)Searched search-documentation.Output rendering (
AssistantPanel.vue)getToolOutputnow parses the standard MCP{ content: [{ text }] }envelope generically (not justlist-pages/get-page).preblock is now scrollable (max-h-64 overflow-y-auto).chevron="leading"on reasoning + restyled output block.Styling
AssistantIndicator.vue:text-xs→text-sm, droppedfont-mono tracking-tight.pb-3.Backend (
search.ts)stopWhenResponseCompletewithstepCountIs(MAX_STEPS).prepareStepto force a final text answer on the last step (toolChoice: 'none'), fixing cases where the model exhausted all steps on tool calls and never replied.maxOutputTokensto 8000, enabled gatewaycaching: 'auto', addedsmoothStream().Test plan