feat(mcp): add progress bar, throttling, and input validation for MCP tool progress (#19772)

This commit is contained in:
Jasmeet Bhatia
2026-02-24 09:13:51 -08:00
committed by GitHub
parent 4efdbe9089
commit c0b76af442
16 changed files with 647 additions and 46 deletions
@@ -92,6 +92,16 @@ exports[`<ToolMessage /> > renders DiffRenderer for diff results 1`] = `
"
`;
exports[`<ToolMessage /> > renders McpProgressIndicator with percentage and message for executing tools 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────╮
│ MockRespondingSpinnertest-tool A tool for testing │
│ │
│ ████████░░░░░░░░░░░░ 42% │
│ Working on it... │
│ Test result │
"
`;
exports[`<ToolMessage /> > renders basic tool information 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────╮
│ ✓ test-tool A tool for testing │
@@ -115,3 +125,21 @@ exports[`<ToolMessage /> > renders emphasis correctly 2`] = `
│ Test result │
"
`;
exports[`<ToolMessage /> > renders indeterminate progress when total is missing 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────╮
│ MockRespondingSpinnertest-tool A tool for testing │
│ │
│ ███████░░░░░░░░░░░░░ 7 │
│ Test result │
"
`;
exports[`<ToolMessage /> > renders only percentage when progressMessage is missing 1`] = `
"╭──────────────────────────────────────────────────────────────────────────────╮
│ MockRespondingSpinnertest-tool A tool for testing │
│ │
│ ███████████████░░░░░ 75% │
│ Test result │
"
`;
@@ -0,0 +1,22 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`McpProgressIndicator > renders complete progress at 100% 1`] = `
"████████████████████ 100%
"
`;
exports[`McpProgressIndicator > renders determinate progress at 50% 1`] = `
"██████████░░░░░░░░░░ 50%
"
`;
exports[`McpProgressIndicator > renders indeterminate progress with raw count 1`] = `
"███████░░░░░░░░░░░░░ 7
"
`;
exports[`McpProgressIndicator > renders progress with a message 1`] = `
"██████░░░░░░░░░░░░░░ 30%
Downloading...
"
`;