Repository navigation
feat(web): hide 'Run as task' on modern-era connections - #2687
Merged
Merged
Conversation
Under SEP-2663 task creation is server-directed: the server decides per request whether to return a task handle, so the client has no per-call choice to offer. The switch is now legacy-only, gated by a new pure offersRunAsTask(protocolEra, capabilities) helper, and the modernTasks prop is gone from ToolDetailPanel / ToolsScreen / InspectorView. No routing change is needed: on a modern connection InspectorClient.callTool already dispatches through the ext-tasks pipeline (preference "allow"), which declares the extension and follows a returned handle to completion with the same Tasks-screen events and progress as callToolStream; on v2 "allow" and "prefer" are identical on the wire and retentionMs is v1-only. mcpdo's --task flag cannot be hidden per era (its command tree is static), so its help text now says it applies to legacy servers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the issue requirements and retains focused coverage for the new visibility rule.
0 open findings
What changed in this PR
Hides the legacy-only Run as task control on modern connections while preserving automatic handling of server-directed tasks.
Changes:
- Adds and tests era-aware task-control visibility.
- Removes the obsolete
modernTasksprop and modern UI branches. - Clarifies modern task routing and
mcpdo --taskhelp.
| File | Description |
|---|---|
clients/web/src/utils/toolUtils.ts |
Adds the visibility helper. |
clients/web/src/utils/toolUtils.test.ts |
Tests legacy and modern behavior. |
clients/web/src/hooks/useServerCommands.tsx |
Documents existing modern routing. |
clients/web/src/components/views/InspectorView/types.ts |
Clarifies the task-support prop. |
clients/web/src/components/views/InspectorView/InspectorView.tsx |
Removes modernTasks forwarding. |
clients/web/src/components/screens/ToolsScreen/ToolsScreen.tsx |
Removes the obsolete prop. |
clients/web/src/components/groups/ToolDetailPanel/ToolDetailPanel.tsx |
Restores legacy-only toggle rules. |
clients/web/src/components/groups/ToolDetailPanel/ToolDetailPanel.test.tsx |
Removes obsolete modern-toggle tests. |
clients/web/src/App.tsx |
Applies era-aware visibility. |
clients/mcpdo/src/connection/mcp.ts |
Clarifies --task semantics. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
Copilot review loop closed: round 1 was clean (0 inline comments, approval recommended, no suppressed findings). |
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.
Closes #2674
What changed
Under SEP-2663, task creation on a modern (2026-07-28) connection is server-directed: the server decides per request whether to return a task handle, so the client has no per-call choice to offer. The Run as task switch is now legacy-only.
offersRunAsTask(protocolEra, capabilities)(clients/web/src/utils/toolUtils.ts): true only for a non-modern connection whose server advertisestasks.requests.tools.call. App.tsx feeds it intoserverSupportsTaskToolCalls. Living inutils/keeps it inside the coverage gate, unlike App.tsx.ToolDetailPanel: the modern branches are gone.showRunAsTask/effectiveRunAsTaskare back to the legacy rule:optional→ user choice,required→ forced on and disabled,forbidden→ hidden.modernTasksprop removed fromToolDetailPanel,ToolsScreenandInspectorView. Nothing else used it.ToolDetailPaneltests for the modern switch are removed.offersRunAsTaskgets its own cases, including a legacy capability on a modern connection, which still offers no choice.Routing: no change needed (the issue asked to check first)
On a modern connection,
InspectorClient.callToolalready dispatches through the ext-tasks pipeline (attemptToolCall→callTaskToolAndSettle(…, "allow")). That path declares the extension on the request and follows a returned handle to completion. It emits the sametoolCallTaskUpdated/requestorTaskUpdatedevents and progress ascallToolStream. In@modelcontextprotocol/ext-tasks0.2.2 on the v2 generation,"allow"and"prefer"are identical on the wire, andretentionMs(the TTL) only reaches the v1 wire. So without the switch, a modern call loses nothing, and it keepscallTool's cancel support. The existing integration testauto-polls an unsolicited task handle on the ordinary callTool path(inspectorClient-tasks-era.test.ts) already pins this, including therequestorTaskUpdatedevent. The routing comment inuseServerCommandsnow says so.Other clients
callTool, which already follows a modern task.--taskflag.--task. Its command tree is static, so the flag can't be hidden per era. On modern it changes nothing on the wire, so its help text now says it applies to legacy servers.Screenshots
tasks-modern(modern era, tasks extension), toolmodern_task. Before: the switch is offered. After: gone.After, executing
modern_taskwith no switch: the server returns a task, and it appears on the Tasks panel with liveworkingstatus, a Cancel control and the status toast. (Shot at 1680px with a 640px Monitor sidebar so the task card isn't clipped.)tasks-legacy(legacy era,tasks.requests.tools.call), toolsimple_task(taskSupport: required). Unchanged: forced on and disabled.npm run local:gatepasses.🤖 Generated with Claude Code