feat(web): wire up MCP task support — Tasks screen, Run-as-task, status toasts (#1422) (#1424)

Wires the ported Tasks screen + core task subsystem through App.tsx: sticky Clear Completed, cancel/refresh error toasts, core-side per-task progress correlation, Run-as-task on the Tools screen (gated on server support), per-server Task TTL, and live task-status toasts.
This commit is contained in:
Cliff Hall 2026-06-04 08:49:47 -04:00 • committed by GitHub
commit ed6eda7492
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,8 +10,11 @@ const meta: Meta<typeof ToolDetailPanel> = {
onFormChange: fn(),
onExecute: fn(),
onCancel: fn(),
onRunAsTaskChange: fn(),
formValues: {},
isExecuting: false,
serverSupportsTaskToolCalls: false,
runAsTask: false,
},
};
@ -142,3 +145,45 @@ export const WithProgress: Story = {
formValues: { batchSize: 100 },
},
};
const optionalTaskTool: Tool = {
name: "summarize_corpus",
description: "Summarizes a large corpus — can run as a background task",
execution: { taskSupport: "optional" },
inputSchema: {
type: "object",
properties: {
corpus: { type: "string", description: "Text to summarize" },
},
},
};
const requiredTaskTool: Tool = {
name: "train_model",
description: "Long-running training job — always runs as a task",
execution: { taskSupport: "required" },
inputSchema: {
type: "object",
properties: {
dataset: { type: "string", description: "Dataset id" },
},
},
};
// Server supports task tool calls + tool is `optional`: the toggle renders
// enabled and off by default.
export const RunAsTaskOptional: Story = {
args: {
tool: optionalTaskTool,
serverSupportsTaskToolCalls: true,
runAsTask: false,
},
};
// Tool is `required`: the toggle is forced on and disabled.
export const RunAsTaskRequired: Story = {
args: {
tool: requiredTaskTool,
serverSupportsTaskToolCalls: true,
},
};