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
test(connections): address the #5883 review — hoisted mock, wider probe, one assertion\n\nYellowSnnowmann: the negative assertion on the pinned /skills?tab= case was a\nstrict tautology given the line above it, and it encoded "the fixed value must\nnot appear" as a second contract — so whoever fixes the redirect would hit two\nfailures and have to decide whether the negative one was deliberate. Removed;\nthe comment block already carries the intent.\n\nCodeRabbit: the vi.mock factory closed over a plain top-level const. vi.mock is\nhoisted above every declaration, so a factory reading an ordinary const hits it\nbefore initialisation when the mocked module is pulled in during the import\nphase. It happens to work here — useChannelDefinitions is only called during\nrender, inside the test body — but it is the documented hazard, so webDef now\ncomes from vi.hoisted.\n\nCodex: LocationProbe reported only pathname + search, so a destination carrying\na fragment could lose it with every assertion still green. Now includes\nloc.hash.\n\nCodex also flagged /routines and /workflows as pinning a mismatch against the\nroute contract. The facts check out and are worth recording, but the conclusion\ndoes not follow, so the assertions stay and the divergence is documented at each\nsite instead:\n\n * AGENTS.md:175 is the authoritative route table. It specifies\n /routines & /workflows -> /settings/automations, and\n /webhooks -> /settings/integrations#webhooks.\n * /routines is NOT a real divergence: /settings/automations is itself\n <Navigate to="/flows"> (settingsRouteElements.tsx:164), so the code\n short-circuits one hop of the documented chain and lands in the same place.\n * /workflows IS a divergence, and a three-way one — AGENTS.md says\n /settings/automations, AppRoutes.tsx's own /flows block comment says /flows,\n and the code renders <Activity/> and stays put.\n * /webhooks IS a divergence: no fragment is emitted, so the Webhooks section\n is not selected on arrival.\n\nAsserting the documented destinations would produce knowingly-failing tests for\nbehaviour the app does not have. Which side moves is a source decision for the\nmaintainer; these tests describe the app as it is and now say so explicitly.\n\nNOT EXECUTED — no local builds or test runs in this phase. Verified by reading\nAGENTS.md:175, AppRoutes.tsx, settingsRouteElements.tsx:164. Prettier clean, tsc\nreports no errors in the touched files. CI is the check.\n
M3gA-Mind16ff8a48b057
diff --git a/app/src/AppRoutes.connections-flows.test.tsx b/app/src/AppRoutes.connections-flows.test.tsxindex e19112e6d9..751d217c53 100644--- a/app/src/AppRoutes.connections-flows.test.tsx+++ b/app/src/AppRoutes.connections-flows.test.tsx@@ -72,7 +72,13 @@ const AppRoutes = (await import('./AppRoutes')).default;/** Reports the live location so assertions can name the URL we landed on. */function LocationProbe() {const loc = useLocation();- return <span data-testid="href">{loc.pathname + loc.search}</span>;+ // `hash` included deliberately. Without it the probe reports only+ // `pathname + search`, so a route whose destination carries a fragment —+ // AGENTS.md:175 specifies `/webhooks` -> `/settings/integrations#webhooks` —+ // could lose that fragment and every assertion here would stay green+ // (#5883, Codex). This is a HashRouter, so `loc.hash` is the fragment WITHIN+ // the routed path, not the leading `#/` of the URL.+ return <span data-testid="href">{loc.pathname + loc.search + loc.hash}</span>;}function renderAt(entry: string) {@@ -124,14 +130,25 @@ describe('connections / channels back-compat redirects (real route table)', () =// '/connections', search: location.search }} />` or equivalent — this test// MUST be flipped to expect '/connections?tab=messaging' and the two source// comments left alone, because they will finally be true.+ //+ // One assertion, not two. A second `.not.toBe('/connections?tab=messaging')`+ // was strictly implied by the line below it and could never fire+ // independently — and it encoded "the fixed value must not appear" as a+ // separate contract, so whoever fixes the redirect would hit two failures+ // and have to work out whether the negative one was deliberate+ // (#5883, YellowSnnowmann).const at = renderAt('/skills?tab=messaging');expect(at.href()).toBe('/connections');- expect(at.href()).not.toBe('/connections?tab=messaging');});});describe('automation route slugs', () => {it('/routines redirects to /flows', () => {+ // `AGENTS.md:175` documents `/routines` -> `/settings/automations`. The two+ // agree on where the user ends up: `/settings/automations` is itself+ // `<Navigate to="/flows">` (settingsRouteElements.tsx:164), so the code+ // short-circuits one hop of the documented chain and lands in the same+ // place. `/workflows` is the real divergence — see the test below.const at = renderAt('/routines');expect(at.href()).toBe('/flows');expect(at.page()).toBe('flows');@@ -140,11 +157,23 @@ describe('automation route slugs', () => {it('/webhooks redirects to the Integrations settings page', () => {// Webhooks were retired from the UI; the route survives only to keep old// deep links from 404-ing.+ //+ // ⚠️ CONTRACT DIVERGENCE. `AGENTS.md:175` is the authoritative route table+ // and specifies `/webhooks` -> `/settings/integrations#webhooks`. The code+ // (`AppRoutes.tsx`) emits no fragment, so the Webhooks section is not+ // selected on arrival. This asserts what the app DOES; changing it to the+ // documented destination would be a knowingly-failing test. The fix is a+ // source change and someone has to decide which side moves — see W5 BUG-13.const at = renderAt('/webhooks');expect(at.href()).toBe('/settings/integrations');});it('/workflows is NOT a redirect — it renders the legacy SKILL.md hub', () => {+ // ⚠️ CONTRACT DIVERGENCE, and a three-way one. `AGENTS.md:175` says+ // `/workflows` -> `/settings/automations`; `AppRoutes.tsx`'s own `/flows`+ // block comment says it redirects to `/flows`; the code renders <Activity/>+ // and stays put. Three statements, three destinations. This pins the code.+ // See W5 BUG-13 (#5883, Codex).// Guards against the stale claim in `AppRoutes.tsx`'s own `/flows` block// comment, which says "the bare `/workflows` and `/routines` slugs now// redirect here (to `/flows`)". Only `/routines` does. `/workflows` rendersdiff --git a/app/src/pages/__tests__/Skills.tab-resolution.test.tsx b/app/src/pages/__tests__/Skills.tab-resolution.test.tsxindex 896e4c3c26..e234a2632e 100644--- a/app/src/pages/__tests__/Skills.tab-resolution.test.tsx+++ b/app/src/pages/__tests__/Skills.tab-resolution.test.tsx@@ -29,14 +29,24 @@ import type { ChannelDefinition } from '../../types/channels';import Skills from '../Skills';// A non-empty definition list is what makes the channels group render at all.-const webDef: ChannelDefinition = {- id: 'web',- display_name: 'Web',- description: 'Chat via the built-in web UI.',- icon: 'web',- auth_modes: [],- capabilities: [],-};+//+// Declared through `vi.hoisted` rather than as a plain top-level `const`:+// `vi.mock` is hoisted above every declaration in the file, so a factory that+// closes over an ordinary const reads it before initialisation if the mocked+// module is pulled in during the import phase. It happens to work here — the+// hook is only called during render, inside the test body — but it is the+// documented hazard and `vi.hoisted` is the supported way to share a value+// with a factory (#5883, CodeRabbit).+const { webDef } = vi.hoisted(() => ({+ webDef: {+ id: 'web',+ display_name: 'Web',+ description: 'Chat via the built-in web UI.',+ icon: 'web',+ auth_modes: [],+ capabilities: [],+ } as ChannelDefinition,+}));vi.mock('../../hooks/useChannelDefinitions', () => ({useChannelDefinitions: () => ({ definitions: [webDef], loading: false, error: null }),