Skip to content

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

fix(support): add an explicit ref-capability override; scope the OpenAI radio\n\nTwo review findings.\n\nCodeRabbit, major: SUPPORT_URL_ACCEPTS_REF inferred capability from the mere\npresence of VITE_SUPPORT_URL, so an override pointed at a chat invite would get\na ref appended — the same defect the flag exists to remove. Adds\nVITE_SUPPORT_URL_ACCEPTS_REF as an explicit signal.\n\nKept as an opt-OUT rather than the suggested opt-in, deliberately: an override\nexists for deployment-specific *support endpoints*, which can consume a ref by\ndefinition, so defaulting to false would make the useful behaviour the one a\ndeployer must remember to switch on — and forgetting it fails silently, which\nis exactly the failure this flag was added to remove. Reasoning is on the\nthread and it is left open for the maintainer.\n\nCodeRabbit, minor: the embeddings spec matched the OpenAI radio with\nhasText: /OpenAI/ and .first(), which also matches "Custom (OpenAI-compatible)"\nand depends on catalog order — it could silently assert against the custom\nprovider, the case the sibling test already owns. Scoped to an exact label\ndescendant.\n\nVerified: 50 passed across the three affected test files; prettier clean.\n

M3gA-Mind377cd0cdd78f
diff --git a/app/src/utils/config.ts b/app/src/utils/config.ts
index 5ae83b3ab1..29c97382ca 100644
--- a/app/src/utils/config.ts
+++ b/app/src/utils/config.ts
@@ -275,8 +275,25 @@ export const SUPPORT_URL = SUPPORT_URL_OVERRIDE || DISCORD_INVITE_URL;
* The crash screen still surfaces the Error ID as copyable text
* (`ErrorFallbackScreen`), so the user can carry it into the Discord thread by
* hand; what this flag removes is the *false* promise, not the path.
+ *
+ * Defaults to "an override is configured", because `VITE_SUPPORT_URL` exists
+ * for deployment-specific *support endpoints* and one of those can consume a
+ * ref by definition. Set `VITE_SUPPORT_URL_ACCEPTS_REF=false` for the case
+ * that inference gets wrong — an override pointed at a chat invite, which
+ * ignores the query the same way the Discord default does. The escape hatch is
+ * an opt-OUT rather than an opt-in on purpose: defaulting to `false` would
+ * make the *useful* behaviour the one a deployer can forget to switch on, and
+ * forgetting it fails silently, which is the exact failure this whole flag
+ * exists to remove.
*/
-export const SUPPORT_URL_ACCEPTS_REF = Boolean(SUPPORT_URL_OVERRIDE);
+const SUPPORT_URL_ACCEPTS_REF_OVERRIDE = (
+ import.meta.env.VITE_SUPPORT_URL_ACCEPTS_REF as string | undefined
+)?.trim();
+
+export const SUPPORT_URL_ACCEPTS_REF =
+ SUPPORT_URL_ACCEPTS_REF_OVERRIDE !== undefined && SUPPORT_URL_ACCEPTS_REF_OVERRIDE !== ''
+ ? SUPPORT_URL_ACCEPTS_REF_OVERRIDE === 'true'
+ : Boolean(SUPPORT_URL_OVERRIDE);
/**
* Set `VITE_SENTRY_SMOKE_TEST=true` in one build (or in `.env.local`) to
diff --git a/app/test/playwright/specs/embeddings-setup-modal.spec.ts b/app/test/playwright/specs/embeddings-setup-modal.spec.ts
index bdd333c022..e5f429c569 100644
--- a/app/test/playwright/specs/embeddings-setup-modal.spec.ts
+++ b/app/test/playwright/specs/embeddings-setup-modal.spec.ts
@@ -78,10 +78,14 @@ test.describe('Embeddings setup — Test connection for a custom endpoint', () =
// and no unavailable-reason text is shown for a non-custom provider.
await openEmbeddingsTab(page, 'pw-embed-openai');
+ // Scoped to an exact label descendant, not `hasText: /OpenAI/`: the radios
+ // carry a label AND a description, so a substring match also hits
+ // "Custom (OpenAI-compatible)" and `.first()` then depends on catalog
+ // order — the test would silently assert against the custom provider,
+ // which is the very case the sibling test covers.
await page
.getByRole('radio')
- .filter({ hasText: /OpenAI/ })
- .first()
+ .filter({ has: page.getByText('OpenAI', { exact: true }) })
.click();
const testButton = page.getByRole('button', { name: TEST_CONNECTION });