Skip to content

The agent that grows with you

fix(desktop): capability pills follow the server active row

Tekniumc5fad5feda8b
diff --git a/apps/desktop/src/app/settings/toolset-config-panel.test.tsx b/apps/desktop/src/app/settings/toolset-config-panel.test.tsx
index a7fadda4df0..7ba9c02a88c 100644
--- a/apps/desktop/src/app/settings/toolset-config-panel.test.tsx
+++ b/apps/desktop/src/app/settings/toolset-config-panel.test.tsx
@@ -899,7 +899,7 @@ describe('ToolsetConfigPanel', () => {
env_vars: [],
post_setup: null,
requires_nous_auth: false,
- is_active: false,
+ is_active: true,
status: 'ready',
web_backend: 'firecrawl',
capabilities: ['search', 'extract']
@@ -970,5 +970,30 @@ describe('ToolsetConfigPanel', () => {
expect(within(byokRow).getByText('Extract backend')).toBeTruthy()
expect(within(byokRow).queryByText('Search backend')).toBeNull()
})
+
+ it('marks only the configured row of two sharing one backend name', async () => {
+ // Cloud and self-hosted Firecrawl share web_backend 'firecrawl'; the server's is_active says which
+ // one's credential is set, and only that row carries the capability pills.
+ const selfHosted = {
+ ...webConfig().providers[1],
+ name: 'Firecrawl Self-Hosted',
+ badge: 'free · self-hosted',
+ is_active: false,
+ status: 'needs_keys' as const
+ }
+
+ getToolsetConfig.mockResolvedValue(
+ webConfig({ active_search_backend: 'firecrawl', providers: [selfHosted, webConfig().providers[1]] })
+ )
+
+ render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="web" />)
+
+ const cloudRow = await screen.findByRole('button', { name: /^Firecrawl(?! Self)/ })
+ const selfRow = screen.getByRole('button', { name: /^Firecrawl Self-Hosted/ })
+ expect(within(cloudRow).getByText('Search backend')).toBeTruthy()
+ expect(within(cloudRow).getByText('Extract backend')).toBeTruthy()
+ expect(within(selfRow).queryByText('Search backend')).toBeNull()
+ expect(within(selfRow).queryByText('Extract backend')).toBeNull()
+ })
})
})
diff --git a/apps/desktop/src/app/settings/toolset-config-panel.tsx b/apps/desktop/src/app/settings/toolset-config-panel.tsx
index 300cc496d99..f85c3f26a0d 100644
--- a/apps/desktop/src/app/settings/toolset-config-panel.tsx
+++ b/apps/desktop/src/app/settings/toolset-config-panel.tsx
@@ -109,7 +109,9 @@ function capabilityServedBy(provider: ToolProvider, backend: null | string | und
return Boolean(viaNous)
}
- return Boolean(provider.web_backend && backend === provider.web_backend && !viaNous)
+ // Rows sharing a backend name (cloud vs self-hosted Firecrawl) are told apart by the server's
+ // is_active, which knows which one's credential is set.
+ return Boolean(provider.web_backend && backend === provider.web_backend && !viaNous && provider.is_active)
}
interface EnvVarFieldProps {