Skip to content

The agent that grows with you

fix(desktop): installing a plugin from the setup chat's card stays in the chat

alt-glitchc582c96b0e75
diff --git a/apps/desktop/src/app/settings/plugin-install-modal.tsx b/apps/desktop/src/app/settings/plugin-install-modal.tsx
index 74408842c14..2411c2a0740 100644
--- a/apps/desktop/src/app/settings/plugin-install-modal.tsx
+++ b/apps/desktop/src/app/settings/plugin-install-modal.tsx
@@ -352,9 +352,11 @@ export function PluginInstallModal() {
}
closePluginInstallRequest()
- // Land on the inventory (Capabilities → Plugins) — Git installs too;
- // `/settings?tab=plugins` is the plugin settings pages now.
- navigate('/capabilities?tab=plugins')
+
+ // Land on the inventory (Capabilities → Plugins), unless the caller keeps the user in place.
+ if (!request.stayAfterInstall) {
+ navigate('/capabilities?tab=plugins')
+ }
return
}
diff --git a/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx b/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx
index c81e7c76bce..631817846c1 100644
--- a/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx
+++ b/apps/desktop/src/components/assistant-ui/setup-beat/plugins-card.tsx
@@ -37,7 +37,8 @@ async function openInstall(name: string, profile: string): Promise<void> {
const lookup = await lookupPluginCatalogEntry(name)
if (lookup.ok) {
- openCatalogPluginInstall(lookup.entry, profile)
+ // The card stays in the chat and flips the row to Installed when the plugin list reloads.
+ openCatalogPluginInstall(lookup.entry, profile, { stayAfterInstall: true })
}
}
diff --git a/apps/desktop/src/store/plugin-catalog-install.test.ts b/apps/desktop/src/store/plugin-catalog-install.test.ts
index 7c93786b137..2b5f773b54f 100644
--- a/apps/desktop/src/store/plugin-catalog-install.test.ts
+++ b/apps/desktop/src/store/plugin-catalog-install.test.ts
@@ -108,4 +108,14 @@ describe('openCatalogPluginInstall', () => {
expect($pluginInstallRequest.get()).toBeNull()
expect($notifications.get()[0]).toMatchObject({ kind: 'success' })
})
+
+ it("carries the caller's stay-in-place choice to the install dialog", () => {
+ $agentPlugins.set([])
+
+ openCatalogPluginInstall({ name: 'weather', repo: 'https://github.com/x/weather' }, 'workbot', {
+ stayAfterInstall: true
+ })
+
+ expect($pluginInstallRequest.get()).toMatchObject({ catalogName: 'weather', stayAfterInstall: true })
+ })
})
diff --git a/apps/desktop/src/store/plugin-catalog-install.ts b/apps/desktop/src/store/plugin-catalog-install.ts
index edcfd3d392f..7a998f98669 100644
--- a/apps/desktop/src/store/plugin-catalog-install.ts
+++ b/apps/desktop/src/store/plugin-catalog-install.ts
@@ -3,7 +3,7 @@ import { lookupPluginCatalogEntry, type PluginCatalogEntry, type PluginCatalogLo
import { $agentPlugins } from './agent-plugins'
import { notify } from './notifications'
-import { openPluginInstallRequest } from './plugin-install-request'
+import { openPluginInstallRequest, type PluginInstallRequest } from './plugin-install-request'
/**
* THE way a curated-catalog pick reaches the Install Plugin dialog. The
@@ -12,7 +12,11 @@ import { openPluginInstallRequest } from './plugin-install-request'
* dialog an in-app pick does: `catalogName` makes the backend resolve the
* pinned SHA and record provenance; `repo#subdir` is what the dialog inspects.
*/
-export function openCatalogPluginInstall(entry: PluginCatalogEntry, profile: null | string): void {
+export function openCatalogPluginInstall(
+ entry: PluginCatalogEntry,
+ profile: null | string,
+ options: Pick<PluginInstallRequest, 'stayAfterInstall'> = {}
+): void {
const existing = $agentPlugins.get().find(row => row.catalog_name === entry.name || row.name === entry.name)
if (existing && !existing.update_available) {
@@ -25,7 +29,8 @@ export function openCatalogPluginInstall(entry: PluginCatalogEntry, profile: nul
catalogName: entry.name,
profile,
repo: entry.subdir ? `${entry.repo}#${entry.subdir}` : entry.repo,
- sha: entry.sha
+ sha: entry.sha,
+ ...options
})
}
diff --git a/apps/desktop/src/store/plugin-install-request.ts b/apps/desktop/src/store/plugin-install-request.ts
index 5fee721b0df..1c51edf04b9 100644
--- a/apps/desktop/src/store/plugin-install-request.ts
+++ b/apps/desktop/src/store/plugin-install-request.ts
@@ -18,6 +18,8 @@ export interface PluginInstallRequest {
/** Capabilities profile scope the pick was made under; the agent half
* installs into THIS profile (null/undefined = active profile). */
profile?: string | null
+ /** The caller keeps the user where they are after a successful install (the setup chat's plugins card). */
+ stayAfterInstall?: boolean
}
export const $pluginInstallRequest = atom<PluginInstallRequest | null>(null)