The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(app): disable Test connection for a custom embeddings endpoint, with a reason\n\nThe control was enabled and clickable for a custom provider and did nothing at\nall — no request, no result, no error (#5909):\n\n onClick={() => { if (!isCustom) onTest(); }}\n disabled={setupTesting || setupSaving || (!isCustom && !setupKey.trim())}\n\nThe disabled predicate short-circuits on `!isCustom`, so custom never reaches\nit; the handler then guards the same condition and returns.\n\nDisabled rather than implemented, deliberately. `setupTest` calls\n`openhuman.embeddings_test_connection` with only\n`{ provider, model, dimensions }` (EmbeddingsPanel.tsx:260-265) and the client\nsignature has no endpoint parameter (embeddingsApi.ts:110-114). The custom\nendpoint, model and dims the user typed are never sent, and the handler now\nlives in the vendored memory engine rather than this repo, so making the test\nwork means changing an RPC contract outside this change's scope. A fake success\nwould be worse than the dead button; an honest explanation is better than both.\n\nThe `title` uses `t(key, fallback)` — an existing pattern (ThemeStudioPanel.tsx:126)\n— so no new key has to be threaded through fifteen locale files for a string\nthat should disappear when the endpoint parameter is added.\n\nSave is untouched and still reachable for a custom endpoint: that path works,\nand the tooltip points at it.\n\nTests: the spec that PINNED the dead control is replaced rather than deleted —\nit now asserts the button is disabled, that the reason is on the element, and\nthat Save stays enabled so the fix cannot silently take the working path with it.\n\nVerified by reading EmbeddingsSetupModal.tsx:70-92, EmbeddingsPanel.tsx:250-276\nand embeddingsApi.ts:110-120. NOT EXECUTED — local test runs are forbidden by\nstanding rule; CI is the check.\n
M3gA-Mindf973ab6e1c8f
diff --git a/app/src/components/settings/panels/EmbeddingsSetupModal.tsx b/app/src/components/settings/panels/EmbeddingsSetupModal.tsxindex c653fab30b..bf54d486a7 100644--- a/app/src/components/settings/panels/EmbeddingsSetupModal.tsx+++ b/app/src/components/settings/panels/EmbeddingsSetupModal.tsx@@ -68,13 +68,28 @@ const EmbeddingsSetupModal = ({contentClassName="px-5 py-4 space-y-4"footer={<div className="flex justify-between pt-1">+ {/* Disabled for a custom endpoint, deliberately, and with a reason+ the user can read. `setupTest` calls+ `openhuman.embeddings_test_connection` with only+ `{ provider, model, dimensions }` — there is no parameter for an+ endpoint URL — so a custom provider has nothing to test against.+ Previously the button stayed enabled and its handler opened with+ `if (!isCustom)`, so a click did nothing at all: no request, no+ result, no error. A dead control that looks live is worse than an+ absent one, and worse still than an honest explanation. */}<Buttonvariant="secondary"size="xs"- onClick={() => {- if (!isCustom) onTest();- }}- disabled={setupTesting || setupSaving || (!isCustom && !setupKey.trim())}>+ onClick={onTest}+ title={+ isCustom+ ? t(+ 'settings.embeddings.testUnavailableCustom',+ 'Testing a custom endpoint is not supported yet — save it and check the status on the Embeddings panel.'+ )+ : undefined+ }+ disabled={setupTesting || setupSaving || isCustom || !setupKey.trim()}>{setupTesting? t('settings.embeddings.testing'): t('settings.embeddings.testConnection')}diff --git a/app/src/components/settings/panels/__tests__/EmbeddingsSetupModal.test.tsx b/app/src/components/settings/panels/__tests__/EmbeddingsSetupModal.test.tsxindex 52553fc120..e518b689b3 100644--- a/app/src/components/settings/panels/__tests__/EmbeddingsSetupModal.test.tsx+++ b/app/src/components/settings/panels/__tests__/EmbeddingsSetupModal.test.tsx@@ -149,17 +149,35 @@ describe('EmbeddingsSetupModal — custom-endpoint branch', () => {expect(saveButton()).toBeEnabled();});- // The Test button is rendered enabled for a custom provider (the disabled- // predicate short-circuits on `!isCustom`), but its handler is wrapped in- // `if (!isCustom)`. So it looks actionable and does nothing. Pinned as the- // current behaviour — see the bug list; it is a UX defect, not a crash.- it('renders Test as enabled for a custom provider but does not call onTest', () => {+ // Was: "renders Test as enabled for a custom provider but does not call+ // onTest" — the button looked actionable and its handler opened with+ // `if (!isCustom)`, so a click produced no request, no result and no error+ // (#5909). It is now disabled instead, because `embeddings_test_connection`+ // takes only `{ provider, model, dimensions }` and cannot express a custom+ // endpoint, so there is genuinely nothing to test against.+ it('disables Test for a custom provider rather than rendering a dead control', () => {const { onTest } = renderModal({ setupProvider: custom, customEndpoint: 'https://host/v1' });- expect(testButton()).toBeEnabled();+ expect(testButton()).toBeDisabled();fireEvent.click(testButton());expect(onTest).not.toHaveBeenCalled();});++ it('explains on hover why Test is unavailable for a custom endpoint', () => {+ // A silently disabled control is only marginally better than a dead one;+ // the reason is what makes it honest.+ renderModal({ setupProvider: custom, customEndpoint: 'https://host/v1' });++ expect(testButton().getAttribute('title') ?? '').toContain('custom endpoint');+ });++ it('leaves Save reachable for a custom endpoint', () => {+ // Disabling Test must not disable the path that still works: a custom+ // endpoint is saved and then checked from the Embeddings panel.+ renderModal({ setupProvider: custom, customEndpoint: 'https://host/v1' });++ expect(saveButton()).toBeEnabled();+ });});describe('EmbeddingsSetupModal — feedback', () => {