Skip to content

Commit 7411fc8

Browse files
cliffhallclaude
andcommitted
web: address rollup review #1 — deep-link reconnect on restored activeServerId
Gate the deep-link connect phase on 'not already connected' rather than on activeServerId identity: if a prior session restored activeServerId to the 'deep-link' id while disconnected, the old guard marked the ref consumed and never connected, so reloading the same deep-link URL silently didn't auto- connect. onToggleConnection only disconnects when the id is active AND status is connected, so the new condition also avoids toggling a live connection off. Also documents (rollup review #3) that pre-selecting a deep-linked app deliberately bypasses AppsScreen.handleSelect's no-input auto-launch — a URL must not fire a tool call without the token-gated autoOpen. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01BrihGWcrM9JGRyu41nzZYw
1 parent c6980f8 commit 7411fc8

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎clients/web/src/App.tsx‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2569,7 +2569,16 @@ function App() {
25692569

25702570
if (deepLinkConnectRef.current) return;
25712571
deepLinkConnectRef.current = true;
2572-
if (activeServerId !== deepLink.serverId) {
2572+
// Connect unless we're already *connected* to the deep-link server. Gating
2573+
// on `activeServerId` identity alone would skip the connect when a prior
2574+
// session restored `activeServerId` to the `deep-link` id while the socket
2575+
// is disconnected — a reload of the same deep-link URL would then silently
2576+
// never connect. `onToggleConnection` only disconnects when the id is the
2577+
// active one AND the status is connected, so this condition also avoids
2578+
// toggling a live connection off.
2579+
const alreadyConnected =
2580+
activeServerId === deepLink.serverId && connectionStatus === "connected";
2581+
if (!alreadyConnected) {
25732582
void onToggleConnection(deepLink.serverId).catch((err) => {
25742583
// The toast fires from inside `onToggleConnection` for the common
25752584
// cases; this catch covers the rest (surfaced on `data-error-message`).
@@ -2581,6 +2590,7 @@ function App() {
25812590
deepLink,
25822591
servers,
25832592
activeServerId,
2593+
connectionStatus,
25842594
addServer,
25852595
updateServer,
25862596
onToggleConnection,

‎clients/web/src/components/views/InspectorView/InspectorView.tsx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,13 @@ export function InspectorView({
892892
...collectSchemaDefaults(target.inputSchema),
893893
...deepLink.appArgs,
894894
};
895+
// Seed the selection directly rather than routing through
896+
// AppsScreen.handleSelect. This deliberately bypasses handleSelect's
897+
// no-input-app auto-launch: a deep link must never invoke a tool against
898+
// the target server unless the token-gated `autoOpen` is set — even a
899+
// no-input app waits for that explicit signal (or a manual "Open App"
900+
// click), matching the security stance that a crafted URL alone can't fire
901+
// a tool call.
895902
onActiveTabChange("Apps");
896903
onAppsUiChange({
897904
...appsUi,

0 commit comments

Comments
 (0)