Repository navigation
Description
P2 · Reproduced locally at e3943c5f5c1e69c39309bb8f5b9cf5e63ce41672.
On Settings → AI providers and Settings → Connectors, a vendor filter can stay applied after its facet has gone. The page then shows its first-run empty state, "Connect your first AI provider" or "No connectors connected yet", over credentials that exist. The table offers no filter control and disables its search box, so nothing in the table can undo the filter.
Reproduction
- P1 (AI providers): hold one OpenRouter and one OpenAI credential; the proof creates them through the credentials door. In the UI, choose Filter → Provider → OpenAI, then delete the OpenAI credential from its row menu.
- P2: with only an OpenRouter credential, open
…/settings/providers?provider=openai. This is the documented deep link, and…/settings/providers/openairedirects to it (SET-B3, settings.md:753). - P3: with only a GitHub credential, open
…/settings/connectors?connector=slack. This is CONN-F9's deep link (connectors.md:149); that box assumes two connectors.
Expected: the table's own contract:
- "An active query or filter with zero rows uses the table's shared no-results copy instead" (data-table.md:47).
- Main has since added: "A query or filter that narrowed the rows to none keeps both usable so the reader can undo it" (data-table.md:62 on main).
- SET-B3 expects the filter to arrive pre-applied, and clearing it to clear the URL parameter.
Actual: the first-run empty state, no filter control, and a disabled search box, while the server still holds the other credential. On AI providers, the banner above the table says "This organization has an AI provider but no embedding model", while the table below says "Connect your first AI provider".
How it recovers:
- P1: the filter lives in the page's component state (providers-settings.tsx:68), so a reload, or leaving and coming back, clears it.
- P2 and P3: the URL parameter re-applies the filter after a reload.
Even the controls that work (?provider=openrouter, ?connector=github) show no filter control, so SET-B3's "clearing the filter clears the URL param" cannot be done while only one vendor holds credentials.
User impact
An administrator who has just deleted one key, or who followed a link, is told the organization has no AI provider or no connector at all. The natural next step is to add a duplicate credential, or to assume the other one was lost. Nothing on the page says that a filter is hiding rows.
Cause
CredentialTablefilters its rows byvendorFilterbeforeDataTablesees them (credential-table.tsx:122–138).- It passes the vendor facet to the table only when at least two vendors hold credentials, and the facet's options come from those credentials (L173–199).
- A filter naming a vendor that holds no credential therefore reaches
DataTableas no active filter at all. The table computeshasActiveFilters(data-table.tsx:486–493), then disables search and the Filter button (L498–509), and renders its initialemptyState(L527–550). ?provider=and?connector=seedvendorFilterunconditionally (providers-settings.tsx:80, connectors-settings.tsx:60).
Suggested acceptance test
CredentialTable component tests:
- (a) A
vendorFilternaming a vendor with no credentials, while another vendor has one, shows the no-results state, a visible way to clear the filter, and an enabled search box. - (b) Deleting the filtered vendor's last credential gives the same result.
- (c) A single-vendor table opened with
?provider=<other vendor>gives the same result, and clearing the filter removes the parameter.
Evidence: frozen output (proof-f4-vendor-filter.cjs, one fresh organization)
setup: org fHKRiQju6BWI3hm5OHrYkGBoJr5jMLMU | OpenRouter "Router key" -> 200 | OpenAI "OpenAI key" -> 200
P1 resting: table = "OpenAI key Default openai API key Router key Default openrouter API key" | Filter controls = 1 | search disabled = false
P1 Filter > Provider > OpenAI: table = "OpenAI key Default OpenAI API key" | Filter controls = 1 | search disabled = false
CONFIRMED P1 after deleting "OpenAI key": table = "Connect your first AI provider Add an API key and your team can start chatting with any of its models." | Filter controls = 0 | search disabled = true
P1 the banner on the same page reads: "Knowledge search is off — This organization has an AI provider but no embedding model, so documents cannot be indexed or searched."
P1 the server still holds: ["openrouter:Router key"]
CONTROL P1 after a reload: table = "Router key Default OpenRouter API key" | Filter controls = 0 | search disabled = false
CONFIRMED P2 ?provider=openai: table = "Connect your first AI provider Add an API key and your team can start chatting with any of its models." | Filter controls = 0 | search disabled = true
CONTROL P2 ?provider=openrouter: table = "Router key Default OpenRouter API key" | Filter controls = 0 | search disabled = false
P3 fixture GitHub credential -> 201
CONFIRMED P3 connectors ?connector=slack: table = "No connectors connected yet Connect a mailbox, repository, or chat workspace to use it in automations and chat." | Filter controls = 0 | search disabled = true
CONTROL P3 connectors ?connector=github: table = "GitHub bot Default GitHub Token" | Filter controls = 0 | search disabled = false
--- console/http log --- (none)
Controls in the same run:
- A reload recovers P1.
?provider=openrouterand?connector=githublist their rows.
Mocked boundary: none. Real SPA, backend and PostgreSQL; the fixture credentials hold fake secrets that nothing tests.
Not tested
A comment in connectors-settings.tsx (L32–34) says the OAuth round trip returns to ?connector=<slug>. A consent that stores no credential, in an organization holding other connectors, would therefore probably land on P3's state.
Deduplication
Searched all 1,072 issues, in every state, for vendor, provider or connector filters and facets combined with empty states, and for the ?provider= and ?connector= links. None covers this.
- bug(platform): connector lists stay stale across sessions and keep deleted rows actionable #3712 (stale lists across sessions) and bug(platform): deleting the default connector credential promises no default but promotes another #3713 (the default promoted on delete) are different behaviours.
- Open PR fix(platform): keep custom provider edits whole and version-checked #3778 also edits
credential-table.tsx. Its diff there moves the per-vendor count onto each row and leaves the facet code unchanged.
Found by the TALE-70 local audit. No production system, real provider, mailbox or external delivery was used.
Local stack (loopback only)
- Source: a detached worktree of
e3943c5f5c1e69c39309bb8f5b9cf5e63ce41672(origin/main on 2026-09-28) withbun install --frozen-lockfile. The code named in this issue is unchanged on maine71775a8b(9 commits later). Main changed three related files:data-table.mdadds the sentence quoted under Expected;filter-panel.tsxkeeps focus when a filter bar turns disabled, but the credentials table never hands the hidden facet to it; andsettings.mdchanged only its sandbox boxes. - Databases: PostgreSQL 16.14 (embedded-postgres binaries) with pgvector 0.8.6 on
127.0.0.1;tale_app, andtale_knowledgewithvector. No pg_search (not involved). - Backend, from
services/platform:node --experimental-transform-types --import ./backend/node-loader.mjs backend/main.tswithROLE=all PORT=3005 SITE_URL=http://localhost:3000 NODE_ENV=development, an emptyTALE_CONFIG_DIR,TALE_CONFIG_BUILTIN_DIR=configs/platform/custom,TALE_ALLOW_OPEN_SIGN_UP=true,TALE_DEV_SEED_USER=1, locally generatedBETTER_AUTH_SECRET/ENCRYPTION_SECRET_HEX/INSTANCE_SECRET, and no object store. Egress is blocked:NODE_USE_ENV_PROXY=1 HTTP_PROXY=HTTPS_PROXY=http://127.0.0.1:9 NO_PROXY=127.0.0.1,localhost,::1. - SPA:
bun --bun vite build, thenTALE_BACKEND_URL=http://127.0.0.1:3005 bunx --bun vite preview --port 3000(the production-build E2E serving path; the boot-shell prerender step was skipped). - Browser: Chromium 141.0.7390.37 headless, driven by the worktree's
playwright-core1.58.2 withserviceWorkers: 'block',en-US, 1280×900. - Fixtures: each proof signs up its own accounts and organization through
POST /api/auth/sign-up/emailandPOST /api/auth/organization/create. Credentials carry fake secrets that nothing tests; no provider, mailbox or other external service is reachable. - Replay:
T70_ROOT=<dir> node <proof>.cjs, where<dir>/taleis the worktree and<dir>/evidence/receives the log; adjust the Chromium path inlib.cjs.
probes/proof-f4-vendor-filter.cjs
// PROOF F4: a vendor filter the credentials table no longer offers stays applied, and the page shows its
// first-run empty state over credentials that exist.
// P1 AI providers with two vendors (fixture credentials created through the door): filter to OpenAI in the UI,
// then delete the OpenAI credential (that vendor's last) from its row menu.
// P2 AI providers holding only OpenRouter: open ...settings/providers?provider=openai.
// P3 Connectors holding only GitHub: open ...settings/connectors?connector=slack.
// Controls: a reload of P1; ?provider=openrouter and ?connector=github list their rows.
// Fixture credentials carry fake secrets; nothing ever tests them. Mocked boundary: none (real SPA, backend,
// Postgres); backend egress blocked.
const L = require('./lib.cjs');
const out = [];
const say = (...a) => { const s = a.map((x) => (typeof x === 'string' ? x : JSON.stringify(x))).join(' '); out.push(s); console.log(s); };
async function state(page, tag, verdict = '') {
const tbody = (await page.locator('tbody').first().innerText().catch(() => '')).replace(/\s+/g, ' ').trim().slice(0, 150);
const filterBtn = await page.getByRole('button', { name: /^Filter/ }).count();
const disabled = await page.getByPlaceholder(/search/i).first().isDisabled().catch(() => 'n/a');
say(`${verdict}${tag}: table = ${JSON.stringify(tbody)} | Filter controls = ${filterBtn} | search disabled = ${disabled}`);
}
(async () => {
const browser = await L.launch();
const log = [];
try {
const o = await L.freshOrg(browser, 'f4filter');
const mk = (providerSlug, name) => L.api(o.ctx, 'POST', `/api/app/provider-credentials?orgId=${o.orgId}`, { providerSlug, authMethod: 'api-key', name, secret: `fake-key-t70-${providerSlug}-not-a-real-secret` });
say('setup: org', o.orgId, '| OpenRouter "Router key" ->', (await mk('openrouter', 'Router key')).status, '| OpenAI "OpenAI key" ->', (await mk('openai', 'OpenAI key')).status);
const page = await o.ctx.newPage();
L.watch(page, log);
const url = `/dashboard/${o.orgId}/settings/providers`;
await L.goto(page, url, 2000);
await state(page, 'P1 resting');
await page.getByRole('button', { name: /^Filter/ }).first().click();
const panel = page.getByRole('dialog', { name: 'Filters' });
await panel.waitFor();
const box = panel.getByRole('checkbox', { name: /OpenAI/ });
if (!(await box.isVisible())) await panel.getByRole('button', { name: /Provider/ }).click();
await box.click();
await L.sleep(600);
await page.keyboard.press('Escape');
await L.sleep(500);
await state(page, 'P1 Filter > Provider > OpenAI');
await page.locator('tbody tr', { hasText: 'OpenAI key' }).getByRole('button', { name: /Actions for|open menu/i }).click();
await page.getByRole('menuitem', { name: /Delete/ }).click();
const dlg = page.getByRole('dialog');
await dlg.getByRole('button', { name: /^Delete/ }).click();
await dlg.waitFor({ state: 'detached', timeout: 10000 }).catch(() => say('dialog still open'));
await L.sleep(1500);
await state(page, 'P1 after deleting "OpenAI key"', 'CONFIRMED ');
const banner = await page.getByText(/Knowledge search is off/).first().locator('xpath=..').innerText().catch(() => '(no banner)');
say('P1 the banner on the same page reads:', JSON.stringify(banner.replace(/\s+/g, ' ').slice(0, 160)));
await L.shot(page, 'f4-p1-providers-after-delete');
const held = await L.api(o.ctx, 'GET', `/api/app/provider-credentials?orgId=${o.orgId}`);
say('P1 the server still holds:', (held.body.credentials ?? held.body).map((c) => `${c.providerSlug}:${c.name}`));
await L.goto(page, url, 2000);
await state(page, 'P1 after a reload', 'CONTROL ');
await L.goto(page, `${url}?provider=openai`, 2000);
await state(page, 'P2 ?provider=openai', 'CONFIRMED ');
await L.shot(page, 'f4-p2-providers-deeplink');
await L.goto(page, `${url}?provider=openrouter`, 2000);
await state(page, 'P2 ?provider=openrouter', 'CONTROL ');
const c = await L.api(o.ctx, 'POST', `/api/app/connector-credentials?orgId=${o.orgId}`, { connectorSlug: 'github', authMethod: 'bearer', name: 'GitHub bot', secret: { token: 'fake-token-t70-not-a-real-secret' } });
say('P3 fixture GitHub credential ->', c.status);
await L.goto(page, `/dashboard/${o.orgId}/settings/connectors?connector=slack`, 2000);
await state(page, 'P3 connectors ?connector=slack', 'CONFIRMED ');
await L.shot(page, 'f4-p3-connectors-deeplink');
await L.goto(page, `/dashboard/${o.orgId}/settings/connectors?connector=github`, 2000);
await state(page, 'P3 connectors ?connector=github', 'CONTROL ');
} finally {
say('--- console/http log ---', log.length ? '' : '(none)');
for (const l of log) say(l);
L.fs.writeFileSync(L.path.join(L.ROOT, 'evidence/proof-f4-vendor-filter.log'), out.join('\n') + '\n');
await browser.close();
}
})().catch((e) => { console.error(e); process.exit(1); });probes/lib.cjs
// TALE-70 local audit probe helpers. Local stack only: SPA http://localhost:3000 (vite preview of the
// production build, proxying /api, /events, /dav to the backend on 127.0.0.1:3005). Every probe mints its
// own synthetic organization and accounts through the local sign-up door; nothing else is touched.
const path = require('node:path');
const fs = require('node:fs');
const ROOT = process.env.T70_ROOT || path.join(process.env.HOME, '.cache/t70');
const { chromium } = require(path.join(ROOT, 'tale/node_modules/playwright-core'));
const BASE = 'http://localhost:3000';
const ORIGIN = { origin: BASE };
const PW = 'TaleAudit!Passw0rd';
const SHOTS = path.join(ROOT, 'evidence/shots');
async function launch() {
return chromium.launch({
executablePath: '/opt/ms-playwright/chromium-1194/chrome-linux/chrome',
headless: true,
args: ['--disable-dev-shm-usage'],
});
}
async function newContext(browser, opts = {}) {
return browser.newContext({
baseURL: BASE,
serviceWorkers: 'block',
viewport: opts.viewport ?? { width: 1280, height: 900 },
locale: opts.locale ?? 'en-US',
colorScheme: opts.colorScheme ?? 'light',
reducedMotion: 'reduce',
});
}
async function api(ctx, method, url, data) {
const r = await ctx.request.fetch(url, { method, data, headers: ORIGIN });
const text = await r.text();
let body = text;
try { body = JSON.parse(text); } catch { /* keep text */ }
return { status: r.status(), body };
}
function stamp(label) { return `${label}-${Date.now().toString(36)}`; }
/** A fresh owner with a fresh organization (sign-up + organization/create + set-active). */
async function freshOrg(browser, label, opts = {}) {
const s = stamp(label);
const email = `t70-${s}@tale.test`;
const ctx = await newContext(browser, opts);
const su = await api(ctx, 'POST', '/api/auth/sign-up/email', { email, password: PW, name: `Owner ${label}` });
if (su.status !== 200) throw new Error(`sign-up ${email}: ${su.status} ${JSON.stringify(su.body)}`);
const org = await api(ctx, 'POST', '/api/auth/organization/create', { name: `T70 ${s}`, slug: `t70-${s}` });
if (org.status !== 200) throw new Error(`org create: ${org.status} ${JSON.stringify(org.body)}`);
await api(ctx, 'POST', '/api/auth/organization/set-active', { organizationId: org.body.id });
return { ctx, orgId: org.body.id, email, userId: su.body.user.id, stamp: s, name: `Owner ${label}` };
}
/** A second account added to the owner's organization with `role`, in its own browser context. */
async function addMember(browser, owner, role, name, opts = {}) {
const email = `t70-${owner.stamp}-${name.toLowerCase().replace(/[^a-z0-9]+/g, '-')}@tale.test`;
const ctx = await newContext(browser, opts);
const su = await api(ctx, 'POST', '/api/auth/sign-up/email', { email, password: PW, name });
if (su.status !== 200) throw new Error(`sign-up ${email}: ${su.status} ${JSON.stringify(su.body)}`);
const add = await api(owner.ctx, 'POST', `/api/app/members?orgId=${owner.orgId}`, { userId: su.body.user.id, role });
if (add.status !== 200) throw new Error(`add member ${role}: ${add.status} ${JSON.stringify(add.body)}`);
await api(ctx, 'POST', '/api/auth/organization/set-active', { organizationId: owner.orgId });
return { ctx, email, name, userId: su.body.user.id, memberId: add.body.memberId };
}
function watch(page, sink, tag = '') {
page.on('console', (m) => { if (['error', 'warning'].includes(m.type()) && !BENIGN.some((b) => b.test(m.text()))) sink.push(`${tag}[console.${m.type()}] ${m.text().slice(0, 300)}`); });
page.on('pageerror', (e) => sink.push(`${tag}[pageerror] ${String(e).slice(0, 300)}`));
page.on('response', (r) => { if (r.status() >= 400 && r.url().includes('/api/')) sink.push(`${tag}[http ${r.status()}] ${r.request().method()} ${r.url().replace(BASE, '')}`); });
}
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
/** One-line description of document.activeElement. */
const focusedDesc = (page) => page.evaluate(() => {
const e = document.activeElement;
if (!e || e === document.body) return 'BODY';
const name = (e.getAttribute('aria-label') || e.innerText || e.getAttribute('placeholder') || e.value || '').trim().split('\n')[0].slice(0, 60);
const role = e.getAttribute('role');
return `${e.tagName.toLowerCase()}${role ? `[role=${role}]` : ''} "${name}"`;
});
async function shot(page, name, opts = {}) {
fs.mkdirSync(SHOTS, { recursive: true });
const p = path.join(SHOTS, `${name}.png`);
await page.screenshot({ path: p, fullPage: opts.fullPage ?? false });
return p;
}
/** Horizontal overflow of the document and of every element wider than the viewport. */
const overflow = (page) => page.evaluate(() => {
const vw = document.documentElement.clientWidth;
const doc = document.documentElement.scrollWidth;
const wide = [];
for (const el of document.querySelectorAll('body *')) {
const r = el.getBoundingClientRect();
if (r.width > 0 && (r.right > vw + 1) && getComputedStyle(el).position !== 'fixed') {
// skip descendants of a horizontally scrollable ancestor (a table frame that scrolls on purpose)
let p = el.parentElement, clipped = false;
while (p && p !== document.body) {
const cs = getComputedStyle(p);
if (/(auto|scroll|hidden|clip)/.test(cs.overflowX)) { clipped = true; break; }
p = p.parentElement;
}
if (!clipped) wide.push(`${el.tagName.toLowerCase()}.${String(el.className).slice(0, 60)} right=${Math.round(r.right)}`);
}
}
return { viewport: vw, scrollWidth: doc, docOverflows: doc > vw + 1, wide: wide.slice(0, 8) };
});
/** Visible toasts (sonner region). */
const toasts = async (page) => (await page.locator('[role="region"] li').allInnerTexts()).map((s) => s.replace(/\s*\n+\s*/g, ' ').trim()).filter(Boolean);
/** Every toast shown since the page loaded (a MutationObserver installed before any script runs). */
const TOAST_RECORDER = () => {
window.__toasts = [];
const seen = new WeakSet();
const scan = () => {
for (const li of document.querySelectorAll('[role="region"] li')) {
if (seen.has(li)) continue;
const text = (li.innerText || '').replace(/\s*\n+\s*/g, ' ').trim();
if (text) { seen.add(li); window.__toasts.push(text); }
}
};
new MutationObserver(scan).observe(document, { subtree: true, childList: true, characterData: true });
};
async function recordToasts(ctx) { await ctx.addInitScript(TOAST_RECORDER); }
const allToasts = (page) => page.evaluate(() => window.__toasts || []);
// The /events SSE stream keeps the network busy, so never wait for networkidle.
async function goto(page, url, settleMs = 1200) {
await page.goto(url, { waitUntil: 'domcontentloaded' });
await page.locator('main').first().waitFor({ timeout: 15000 }).catch(() => {});
await sleep(settleMs);
}
// Harness artefacts (serviceWorkers: 'block', font preload hints, the route prefetcher's miss note).
const BENIGN = [/Service Worker registration blocked by Playwright/, /Service worker registration failed TypeError: Cannot read properties of undefined \(reading 'waiting'\)/, /was preloaded using link preload but not used/, /\[prefetch\] no 0\.5 row/];
module.exports = { recordToasts, allToasts, launch, newContext, api, freshOrg, addMember, watch, sleep, focusedDesc, shot, overflow, toasts, goto, BASE, ORIGIN, PW, ROOT, SHOTS, fs, path };
/** With a menu open, move keyboard focus with ArrowDown until the focused item matches `re`. */
async function focusMenuItem(page, re) {
await page.getByRole('menu').waitFor();
await sleep(150);
for (let i = 0; i < 12; i++) {
const cur = await focusedDesc(page);
if (/menuitem/.test(cur) && re.test(cur)) return cur;
await page.keyboard.press('ArrowDown');
await sleep(120);
}
throw new Error(`menu item ${re} never took focus`);
}
/** Inside an open dialog, Tab until the focused element matches `re`. */
async function tabTo(page, re, max = 12) {
for (let i = 0; i < max; i++) {
const cur = await focusedDesc(page);
if (re.test(cur)) return cur;
await page.keyboard.press('Tab');
await sleep(80);
}
throw new Error(`Tab never reached ${re}; at ${await focusedDesc(page)}`);
}
Object.assign(module.exports, { focusMenuItem, tabTo });
Activity
fix(platform): keep active credential vendor filters reversible (#4281)