Skip to content

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

test(app): address review on #5884 — observe the thread id, harden the drift guard\n\nYellowSnnowmann, AppRoutesIOS.pairing.test.tsx: correct. "opens a specific\nthread at /chat/:threadId" observed nothing about the thread id — the Accounts\nstub discarded route params, so /chat/thread-abc, /chat/anything and a route\nthat dropped the segment entirely all produced identical DOM and all passed.\nThe stub now renders the param back out, per the technique already used in\nAppRoutes.connections-flows.test.tsx. Proven: changing the route to /chat/*\nnow fails with "chat:" against expected "chat:thread-abc"; before this it\npassed.\n\nchatgpt-codex, AppRoutes.redirects.test.tsx: correct. The drift guard's\nsingle-line regex missed any <Route> Prettier wraps across lines — the redirect\nwould be absent from the list while the test still claimed full coverage. Now\nslices each route's body and searches it for <Navigate>, matching the\nclassifier in AppRoutes.guards.test.tsx. Proven: a multi-line redirect added to\nthe table now fails the guard by name; the old regex ignored it.\n\nchatgpt-codex, MemorySourceRow.pipelineWarning.test.tsx: correct, and it is a\nproduct bug rather than a test gap. `settled = !progress && !result`, and the\nregistry clears `result` only when the NEXT sync starts (:213, :358) — so after\nany completed sync the "stored without vectors" warning is suppressed\nindefinitely. That is the incident this file exists for. The describe no longer\nclaims "only while in flight", the terminal-result case is pinned with a comment\nsaying it is recorded as a bug rather than asserted as correct, and the bug is\nwritten up in ~/tinyhuman/bugs/W6-ui-bugs.md #14. A fix makes that test fail,\nwhich is the fix landing.\n

M3gA-Mind7723a51b2830
diff --git a/app/src/AppRoutes.redirects.test.tsx b/app/src/AppRoutes.redirects.test.tsx
index 126037405b..4a80820e4f 100644
--- a/app/src/AppRoutes.redirects.test.tsx
+++ b/app/src/AppRoutes.redirects.test.tsx
@@ -114,9 +114,23 @@ describe('AppRoutes back-compat redirects', () => {
const [fs, path] = await Promise.all([import('node:fs'), import('node:path')]);
// vitest runs with `app/` as cwd (test/vitest.config.ts sets the root).
const source = fs.readFileSync(path.resolve('src/AppRoutes.tsx'), 'utf8');
- const routed = [...source.matchAll(/<Route path="([^"]+)" element={<Navigate /g)].map(
- match => match[1]
- );
+
+ // Each route's body is the slice up to the next `<Route path=`, and the body
+ // is searched for `<Navigate`. Deliberately NOT a single-line regex like
+ // `/<Route path="…" element={<Navigate /`: Prettier wraps a `<Route>` across
+ // lines as soon as its props exceed the print width, and a one-line pattern
+ // then silently skips that redirect — the list stays unchanged and this test
+ // still claims full coverage. A guard that stops guarding is worse than none.
+ const starts = [...source.matchAll(/<Route\s+path="([^"]+)"/g)];
+ const routed = starts
+ .filter((match, index) => {
+ const from = match.index ?? 0;
+ const to =
+ index + 1 < starts.length ? (starts[index + 1].index ?? source.length) : source.length;
+ return /<Navigate\b/.test(source.slice(from, to));
+ })
+ .map(match => match[1]);
+
expect(routed.sort()).toEqual(REDIRECTS.map(r => r.from).sort());
});
});
diff --git a/app/src/AppRoutesIOS.pairing.test.tsx b/app/src/AppRoutesIOS.pairing.test.tsx
index f36f33ce3d..819d402d08 100644
--- a/app/src/AppRoutesIOS.pairing.test.tsx
+++ b/app/src/AppRoutesIOS.pairing.test.tsx
@@ -21,13 +21,24 @@
* `pages/ios/PairScreen.test.tsx`. Not repeated here.
*/
import { render, screen } from '@testing-library/react';
-import { MemoryRouter } from 'react-router-dom';
+import { MemoryRouter, useParams } from 'react-router-dom';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
vi.mock('./features/human/HumanPage', () => ({
default: () => <div data-testid="page-human">human</div>,
}));
-vi.mock('./pages/Accounts', () => ({ default: () => <div data-testid="page-chat">chat</div> }));
+// Renders the route param back out. A stub that discards params makes
+// `/chat/thread-abc`, `/chat/anything` and a route that dropped the
+// `:threadId` segment entirely produce identical DOM — so the deep-link test
+// below would pass without observing the thread id at all. Mirrors the
+// technique already used in `AppRoutes.connections-flows.test.tsx`.
+vi.mock('./pages/Accounts', () => {
+ const ChatProbe = () => {
+ const { threadId } = useParams();
+ return <div data-testid="page-chat">{`chat:${threadId ?? ''}`}</div>;
+ };
+ return { default: ChatProbe };
+});
vi.mock('./pages/Settings', () => ({
default: () => <div data-testid="page-settings">settings</div>,
}));
@@ -103,7 +114,9 @@ describe('AppRoutesIOS — deep links a paired phone must honour', () => {
renderAt('/chat/thread-abc');
- expect(screen.getByTestId('page-chat')).toBeInTheDocument();
+ // The segment must survive to the page, not merely match the route: this is
+ // the half a notification deep link depends on.
+ expect(screen.getByTestId('page-chat')).toHaveTextContent('chat:thread-abc');
expect(screen.getByTestId('mobile-tab-bar')).toBeInTheDocument();
expect(screen.queryByTestId('page-human')).not.toBeInTheDocument();
});
diff --git a/app/src/components/intelligence/MemorySourceRow.pipelineWarning.test.tsx b/app/src/components/intelligence/MemorySourceRow.pipelineWarning.test.tsx
index 2bf440c1de..e7999b017b 100644
--- a/app/src/components/intelligence/MemorySourceRow.pipelineWarning.test.tsx
+++ b/app/src/components/intelligence/MemorySourceRow.pipelineWarning.test.tsx
@@ -129,7 +129,7 @@ describe('MemorySourceRow — the row tells the truth about embedding state', ()
});
});
-describe('MemorySourceRow — the warning is suppressed only while a sync is in flight', () => {
+describe('MemorySourceRow — what suppresses the warning', () => {
// `settled = !progress && !result` in MemorySourceRow.tsx. This suppression is
// correct (mid-sync `chunks_pending` is legitimately transient) and is also the
// most plausible way for the indicator to never appear: a source wedged in a
@@ -145,6 +145,29 @@ describe('MemorySourceRow — the warning is suppressed only while a sync is in
expect(warning()).not.toBeInTheDocument();
});
+ it('ALSO stays hidden after a sync has finished, for as long as the result chip lives', () => {
+ // Pinned because it is surprising and load-bearing, not because it is right.
+ //
+ // `settled = !progress && !result` (MemorySourceRow.tsx:100). `result` is the
+ // terminal success/failure chip, and MemorySourcesRegistry only clears it
+ // when the NEXT sync starts (`:213`, `:358`) — nothing else drops it. So
+ // after any completed sync the "stored without vectors" warning is hidden
+ // indefinitely, which is exactly the shape of the incident this file exists
+ // for: chunks synced, none embedded, and no indicator anywhere.
+ //
+ // Recorded as a bug in ~/tinyhuman/bugs/W6-ui-bugs.md rather than asserted
+ // as correct. If someone narrows the suppression to `progress` alone, this
+ // test fails and should be updated to expect the warning — that failure is
+ // the fix landing, not a regression.
+ renderRow({
+ status: storedWithoutVectors(),
+ progress: null,
+ result: { ok: true } as unknown as React.ComponentProps<typeof MemorySourceRow>['result'],
+ });
+
+ expect(warning()).not.toBeInTheDocument();
+ });
+
it('reports the truth again once the sync has settled', () => {
renderRow({ status: storedWithoutVectors(), progress: null, result: null });