Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(settings): handle missing provider in LLM connections panel

Steven Enamakel54176d4a9b58
diff --git a/app/src/components/settings/panels/LlmConnectionsPanel.tsx b/app/src/components/settings/panels/LlmConnectionsPanel.tsx
index 378027bd13..b37c30c7cd 100644
--- a/app/src/components/settings/panels/LlmConnectionsPanel.tsx
+++ b/app/src/components/settings/panels/LlmConnectionsPanel.tsx
@@ -1,71 +1,32 @@
-import { useLocation, useNavigate } from 'react-router-dom';
-
import { useT } from '../../../lib/i18n/I18nContext';
-import ChipTabs from '../../layout/ChipTabs';
import PageSectionHeader from '../../layout/PageSectionHeader';
-import AgentChatPanel from './AgentChatPanel';
import AIPanel from './AIPanel';
-import LocalModelDebugPanel from './LocalModelDebugPanel';
-
-type LlmChip = 'api-keys' | 'local-model' | 'agent-chat';
-
-const LLM_CHIPS: readonly LlmChip[] = ['api-keys', 'local-model', 'agent-chat'];
/**
- * The Connections → LLM surface as a three-chip page:
- * - **API keys** — the main AI provider / model configuration (AIPanel).
- * - **Local Model Debug** — local runtime status + per-capability testers.
- * - **Agent Chat Debug** — the raw agent-chat tester.
+ * The Connections → LLM surface: provider credentials and workload routing.
*
- * Local Model Debug and Agent Chat used to be standalone Developer Options
- * pages; they're folded in here so everything LLM-related lives on one page.
- * The active chip is hash-backed so legacy diagnostics deep links select the
- * intended surface and chip selection remains shareable.
+ * This was a three-chip page — API keys plus two developer diagnostics, Local
+ * Model Debug and Agent Chat Debug, which had been folded in here when they
+ * were retired as standalone Developer Options pages. Both are gone now, so
+ * there is one surface and nothing to switch between: `ChipTabs` over a single
+ * item is a control that cannot do anything, and the hash it was backed by
+ * addressed panels that no longer exist. `AIPanel` renders directly.
*
- * Each chip renders its underlying panel unembedded so it keeps the same
- * PanelPage chrome + `p-4` padding as the sibling Connections tabs (Voice,
- * Embeddings, …); the two-pane shell hides the redundant back button.
+ * It renders unembedded, so it keeps the same PanelPage chrome and `p-4`
+ * padding as the sibling Connections tabs (Voice, Embeddings, …); the two-pane
+ * shell hides the redundant back button.
*/
const LlmConnectionsPanel = () => {
const { t } = useT();
- const location = useLocation();
- const navigate = useNavigate();
- const requestedChip = location.hash.slice(1);
- const chip: LlmChip = LLM_CHIPS.includes(requestedChip as LlmChip)
- ? (requestedChip as LlmChip)
- : 'api-keys';
-
- const setChip = (next: LlmChip) => {
- navigate(
- { pathname: location.pathname, search: location.search, hash: `#${next}` },
- { replace: true }
- );
- };
return (
<div className="flex h-full flex-col gap-4">
<PageSectionHeader
title={t('pages.settings.ai.llm')}
description={t('connections.header.llm')}
- tabs={
- <ChipTabs<LlmChip>
- ariaLabel={t('pages.settings.ai.llm')}
- testIdPrefix="llm-chip"
- className="inline-flex flex-wrap items-center gap-1.5"
- value={chip}
- onChange={setChip}
- items={[
- { id: 'api-keys', label: t('connections.llm.apiKeys') },
- { id: 'local-model', label: t('settings.developerMenu.localModelDebug.title') },
- { id: 'agent-chat', label: t('settings.developerMenu.agentChat.title') },
- ]}
- />
- }
/>
<div className="min-h-0 flex-1 overflow-hidden rounded-2xl border border-line bg-surface shadow-subtle">
- {chip === 'api-keys' && <AIPanel />}
- {chip === 'local-model' && <LocalModelDebugPanel />}
- {chip === 'agent-chat' && <AgentChatPanel />}
+ <AIPanel />
</div>
</div>
);
diff --git a/app/src/components/settings/panels/__tests__/LlmConnectionsPanel.test.tsx b/app/src/components/settings/panels/__tests__/LlmConnectionsPanel.test.tsx
index b88348b8c2..d67360bbba 100644
--- a/app/src/components/settings/panels/__tests__/LlmConnectionsPanel.test.tsx
+++ b/app/src/components/settings/panels/__tests__/LlmConnectionsPanel.test.tsx
@@ -1,4 +1,4 @@
-import { fireEvent, screen } from '@testing-library/react';
+import { screen } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';
import { renderWithProviders } from '../../../../test/test-utils';
@@ -7,35 +7,31 @@ import LlmConnectionsPanel from '../LlmConnectionsPanel';
vi.mock('../../../../lib/i18n/I18nContext', () => ({ useT: () => ({ t: (key: string) => key }) }));
vi.mock('../AIPanel', () => ({ default: () => <div data-testid="api-keys-panel" /> }));
-vi.mock('../LocalModelDebugPanel', () => ({
- default: () => <div data-testid="local-model-panel" />,
-}));
-vi.mock('../AgentChatPanel', () => ({ default: () => <div data-testid="agent-chat-panel" /> }));
describe('LlmConnectionsPanel', () => {
- it.each([
- ['#local-model', 'local-model-panel'],
- ['#agent-chat', 'agent-chat-panel'],
- ])('selects the legacy diagnostic surface from %s', (hash, testId) => {
- renderWithProviders(<LlmConnectionsPanel />, {
- initialEntries: [`/connections?tab=llm${hash}`],
- });
-
- expect(screen.getByTestId(testId)).toBeInTheDocument();
- });
-
- it('defaults unknown hashes to API keys', () => {
- renderWithProviders(<LlmConnectionsPanel />, {
- initialEntries: ['/connections?tab=llm#unknown'],
- });
+ it('renders the AI settings panel', () => {
+ renderWithProviders(<LlmConnectionsPanel />, { initialEntries: ['/connections?tab=llm'] });
expect(screen.getByTestId('api-keys-panel')).toBeInTheDocument();
});
- it('updates the rendered panel when a chip is selected', () => {
+ // The page used to be chip-backed, with `#local-model` / `#agent-chat`
+ // selecting a developer diagnostic. Those panels are deleted; a stale deep
+ // link must land on the surviving surface rather than render nothing.
+ it.each(['#local-model', '#agent-chat', '#unknown'])(
+ 'ignores the retired %s hash and still renders AI settings',
+ hash => {
+ renderWithProviders(<LlmConnectionsPanel />, {
+ initialEntries: [`/connections?tab=llm${hash}`],
+ });
+
+ expect(screen.getByTestId('api-keys-panel')).toBeInTheDocument();
+ }
+ );
+
+ it('renders no chip tablist, since there is only one surface', () => {
renderWithProviders(<LlmConnectionsPanel />, { initialEntries: ['/connections?tab=llm'] });
- fireEvent.click(screen.getByTestId('llm-chip-agent-chat'));
- expect(screen.getByTestId('agent-chat-panel')).toBeInTheDocument();
+ expect(screen.queryByRole('tablist')).not.toBeInTheDocument();
});
});