Skip to content

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

Commits on main

test(e2e): assert theme switching lands on the document\n\n`ThemeProvider.applyTheme` (providers/ThemeProvider.tsx:38-60) does three\nseparate things: toggles the `dark` class on <html>, sets `style.colorScheme`,\nand writes the palette as `--*` custom properties. jsdom can observe the class;\nthe resolved color-scheme and the computed custom properties need a real engine.\n"The theme visibly applied" means all three moved together, which is why this\nbelongs in the browser lane.\n\n8 tests: Dark sets the class and color-scheme; Light clears both; the palette\ncustom properties actually change (a theme that set the class and no properties\nwould look unchanged to the user); a named family applies its own surface,\ndistinct from Classic at the same variant; aria-pressed marks exactly one\nfamily; variant and family compose without overriding each other; the theme\nsurvives a reload; and it still applies after leaving the settings subtree,\nsince the class lives on <html>.\n\nOne thing worth knowing, now in the bug list as FINDING-3: theme is TWO\nindependent axes, not one list. Five families (Classic, Ocean, Sepia, Matrix,\nHAL 9000), each with a light and a dark variant, exposed as a variant toggle\nplus a family grid. `presets.ts:65-73` names two concrete themes 'Light' and\n'Dark', which is misleading — there is no family button called "Dark", and my\nfirst version timed out looking for one. The variant toggle is scoped by its\naria-label; the family tiles are the aria-pressed buttons.\n\nRevert-proofed WITH a rebuild: pinning `root.style.colorScheme = 'light'` fails\nexactly test 1 and leaves the other 7 green — correctly, since test 2 asserts\ncolor-scheme IS light and the fault cannot break it. Restored and rebuilt; 8/8.\n\nAlso fixes the cold-start flake seen in the first run: booting via the default\n'/home' hash lets the '/home' -> '/chat' redirect race the settings navigation\nand win, so beforeEach now boots straight to the route.\n
M3gA-Mind committed 3 months ago
f2f97a4
test(e2e): keyboard and caret behaviour in settings text fields\n\nAnswers the question the brief asked: do any settings text inputs share the\nchat-composer caret defect W4 found? **No.** All five caret cases pass against\nthe current build, so this lands as a regression guard rather than a\ncharacterisation.\n\nWhy it needs a browser: jsdom has no caret. `fireEvent.change(input, { target:\n{ value } })` replaces the whole value in one step, so a component that resets\nthe selection on re-render is indistinguishable from one that does not. Every\nsettings test under app/src — including the ones I wrote last round — is blind\nto this.\n\nThe profile editor is the sharpest place to ask, because its ID field is\nprogrammatically rewritten while you type the Name (ProfileEditorPage.tsx:125-128)\n— a controlled input whose value is reassigned during render is exactly the\nshape that produces caret jumps.\n\n9 tests: caret stays put when typing at the end, mid-string, across two\nconsecutive mid-string keystrokes (the case that makes the composer bug\nuser-visible), on backspace, and when the auto-slugged ID field is edited\ndirectly; the ID auto-slugs from the Name; the idTouched latch survives real\ntyping; Tab moves Name -> ID; and Create enables only once a usable id exists.\n\nThe latch and the Create gate are also covered by my jsdom specs, deliberately:\nthose fire a synthetic change event, these type, which is what a user does and\nwhat exercises the per-keystroke re-render.\n\nRevert-proofed WITH a rebuild, twice. A value-normalising fault\n(`setName(value.toUpperCase())`) failed 5 tests but on VALUE assertions, which\nproves them live without isolating the caret. So a caret-only fault was used\ninstead — an onChange that calls `setSelectionRange(len, len)` on the next\nframe, reproducing W4's exact symptom without touching the text. That fails\nprecisely the three mid-string caret tests, on caret offset (expected 3,\nreceived 8), while every value assertion still passes and the type-at-the-end\ncase correctly still passes. Restored and rebuilt.\n
M3gA-Mind committed 3 months ago
e55384a
test(e2e): browser spec for the recovery-phrase replace gate\n\n`settings-account-preferences.spec.ts` drives generate -> confirm -> save and\nasserts the wallet ends up configured. Its helper CLICKS THROUGH the replace\ngate to reach generate mode, so nothing asserts the gate itself: that a\nconfigured wallet cannot reach the generate flow without passing it, and that\nbacking out leaves the key material untouched.\n\nThis is the highest-stakes flow in the app — confirming replace destroys the\nuser's only copy of their wallet — and a cancel that silently rotated the key\nwould be unrecoverable. The proof is in the core's wallet_status, not the DOM,\nso every test reads the real wallet over RPC before and after and compares\naddresses.\n\n6 tests: a configured wallet shows no phrase and no one-click regenerate; the\ngate appears without pre-generating a replacement; Cancel returns to view mode\nAND leaves the wallet byte-identical; abandoning the open gate by navigating\naway is equally safe; re-entering after Cancel starts from view mode rather than\na still-armed gate; and "I already have a recovery phrase" opens import without\ntouching the existing wallet.\n\nFour things this cost, all of which are lane knowledge worth keeping:\n\n- The crypto surface is desktop-gated. Without `emulateTauriRuntime`,\n /settings/recovery-phrase never mounts in the web lane and the router falls\n through to chat — which reads as a routing bug. Copied per-spec, as the other\n specs needing it do; helpers/ is shared.\n- `bootAuthenticatedPage`'s default '/home' hash waits for the chat-shell\n redirect and can overwrite a requested hash, so the panel is reached by an\n explicit goto.\n- Navigating to the SAME hash is a no-op for the router, so after saving a new\n wallet the panel keeps its post-save state and never re-reads status. Setup\n hops via another settings route to force a remount.\n- Wallet readiness is polled over RPC, not by reading the panel's mode: view vs\n generate is derived from an async status fetch and racing it made the first\n test flaky.\n\nRevert-proofed WITH a rebuild: with the gate's Cancel wired to\n`setMode('generate')` and the bundle rebuilt, exactly tests 3 and 5 fail on\n`Replace wallet` never returning, and the other four pass. Restored and rebuilt.\n
M3gA-Mind committed 3 months ago
1472d14
4af77b4
test(e2e): browser spec for settings panel navigation\n\n`navigation-settings-panels.spec.ts` looks like settings coverage and is not.\nIt asserts `#root` innerText is >50 chars and that SOME marker matches, where\nthe markers ('Settings', 'Appearance', 'Notifications', 'Tools', 'Memory') are\nthe settings SIDEBAR's own labels — rendered on every /settings/* route. I\nconfirmed this against the live DOM: the sidebar text alone contains every one\nof them. All seven of its cases would stay green if the router mounted the\nchrome and no panel at all.\n\nThis spec asserts two things per route, because one is not enough:\n\n1. the page's single `<h1>` has the route's exact title — the sidebar renders\n no h1, so this catches a dead or unresolved route;\n2. a body control only that panel renders — this catches a MIS-WIRED route.\n\nThe second exists because of something I got wrong first: `SettingsPanel.tsx:108`\nresolves the heading as `title ?? t(findEntryById(currentRoute).titleKey)`, so\nfor panels that pass no explicit title the h1 comes from the ROUTE REGISTRY, not\nthe component. An h1-only spec therefore cannot tell which panel mounted. I\nverified that by wiring /settings/security to <MigrationPanel />, rebuilding,\nand watching an h1-only version pass while showing the wrong panel.\n\n15 tests: 9 deep links (heading + identity + hash), a guard that exactly one h1\nexists so the discriminator itself is pinned, sidebar click-through, a\nthree-panel walk, aria-current on the open entry, back/forward, and reload.\n\nMarkers were read out of the running app, not inferred. Two notes that came from\nthat: sandbox-settings is desktop-only, so in the web lane its body is the\ndesktop-only notice rather than the Docker fields, and the spec asserts what\nthis build actually renders; and `bootAuthenticatedPage` is given an explicit\nsettings hash, because its default '/home' waits for the chat-shell redirect and\nexhausted the 60s budget in beforeEach.\n\nRevert-proofed: with /settings/security wired to <MigrationPanel /> and the\nbundle REBUILT, tests 4 and 12 fail on `getByText('Retry keychain detection')`\nwhile the other 13 pass. Rebuilding is load-bearing — the lane serves a prebuilt\nbundle from app/dist-web, so a source edit alone changes nothing and makes any\nPlaywright revert-proof vacuous.\n
M3gA-Mind committed 3 months ago
10de039
fix(test): make the settings specs typecheck
M3gA-Mind committed 3 months ago
c6a6a78
test(settings): cover every PrivacyPanel data kind and the empty catalog\n\nThe sibling spec exercises `raw` and `derived` only, so three of the five\n`kindLabel` arms (PrivacyPanel.tsx:36-49) never ran, and neither did the\n"ready but empty" state nor the analytics toggle's catch.\n\nThese labels are the substance of the panel — it is the screen that tells a\nuser what leaves their computer, so a capability rendered under the wrong kind\nmisinforms them about exactly what they came to check. The switch has no\ndefault, so a kind added to the union without a case returns undefined and the\nbadge renders blank; the table-driven test is what would catch that.\n\n12 tests:\n- each of raw / derived / credentials / diagnostics / metadata, individually\n and all five together\n- leaves-device vs stays-local, and the destinations line omitted when empty\n- the empty catalog, a catalog whose entries carry no privacy metadata, and a\n null privacy field — all three must reach the empty state, not the error one\n- the analytics toggle keeps the panel rendered when persisting rejects\n\nThree of these were vacuous on first write and were fixed, not kept: they\nasserted `queryBy...not.toBeInTheDocument()` after `waitFor(mockList called)`,\nwhich resolves synchronously on mount — so they were inspecting the LOADING\nstate and passed with the annotation filter removed entirely. They now wait for\nthe ready state by its own text first, and fail as intended when the filter goes.\n\nEvery assertion was verified to fail with the behaviour reverted.\n
M3gA-Mind committed 3 months ago
f446d77
test(settings): cover privacy-mode status branches and sandbox input validation\n\nBoth panels' existing specs cover only valid input and the happy path, which is\nwhat held their branch coverage at 70.8% and 71.4%.\n\nPrivacyModeSection (9 tests). This control sets the data-egress posture\n(#4435), so a save that fails quietly leaves the user believing they are in\nlocal_only when they are not — every failure branch was untested:\n- load failure renders the message and leaves NO option selected\n- a non-Error rejection is stringified rather than rendering blank\n- options are disabled while loading and while a save is in flight\n- a failed save keeps the previous selection rather than showing the click\n- the UI adopts the mode the core echoes back, not the one clicked\n- the saved note clears after its two-second window\n\nSandboxSettingsPanel (14 tests). The three blur handlers each drop input on the\nfloor, and none of those rejections was exercised. They are worth guarding: a\n0 or negative limit would become a Docker run argument, and a blank image would\nreplace a working one.\n- memory and CPU refuse 0 and negatives, accept positive/fractional values,\n and persist null when cleared to whitespace\n- a blank docker image does not persist; a padded one is trimmed\n- null limits from the core render as empty fields\n- off-Tauri the panel calls the core not at all\n- a stale persist failure landing after a newer persist is dropped\n\nTwo scope corrections made during the fault-injection pass rather than assumed:\n\nThe memory/CPU fields are `type="number"`, so non-numeric text ('abc', '1024mb')\nis unreachable — jsdom, like a browser, reports an empty value and the entry\nlands on the clear-to-null branch. The `!isNaN(parsed)` half of each guard is\ndead through the UI. Those cases were dropped rather than contorted, and the\nfile says why.\n\nThe stale-response assertion needed a real microtask+render flush; the bare\n`waitFor(() => expect(x).not.toBeInTheDocument())` form passes on its first\ntick and held even with the sequence guard removed.\n\nEvery assertion was verified to fail with the behaviour reverted.\n
M3gA-Mind committed 3 months ago
8399db3
test(settings): cover PermissionsPanel's sequence guards and RPC-shape defaults\n\nBranch coverage sat at 69.8% with the panel's concurrency machinery entirely\nunexercised. `persistSeqRef` (PermissionsPanel.tsx:115) and `dirSeqRef` (:166)\nexist so a slow in-flight response cannot report over a newer one, and neither\nhad a test; nor did the `??` defaults that a save carries straight back to the\ncore.\n\n11 tests:\n- `require_task_plan_approval ?? true` and `trusted_roots ?? []` for an older\n core that omits both — and that a genuine `false` is preserved rather than\n defaulted back on. These are read at load and written back on the next save,\n so getting them wrong silently rewrites the user's settings.\n- an autonomy load failure is reported without blanking the independent folder\n section\n- autonomy save failure surfaces\n- a stale save failure landing after a newer save is dropped\n- action_dir: the path is trimmed before sending; a failed save keeps edit mode\n open with the typed value; cancel restores the original\n- Save is disabled while in flight, so a second click cannot double-send\n- off-Tauri, a tier click persists nothing\n\nTwo notes on rigour, both the result of the fault-injection pass rather than\nreview:\n\n`waitFor(() => expect(x).not.toBeInTheDocument())` passes on its first tick,\nbefore a rejection has been handled — so the stale-response assertions held\neven with the guard removed. They now flush the microtask queue and React\nrender first (`flush()`), and fail as intended when `persistSeqRef` is bypassed.\n\nThe stale-success assertion is guarded twice: `persistSeqRef` drops it, and\n`StatusLine` renders error-over-saved by design. Removing the seq guard alone\nleaves it green. The comment says so rather than implying it pins the guard.\n
M3gA-Mind committed 3 months ago
9943d77
test(settings): cover the agent-profile save payload and action failures\n\nBoth panels' existing specs stop at the happy path. `ProfileEditorPage.test.tsx`\nasserts `sent.id` and `sent.name` and nothing else about the object\n`handleSubmit` builds; `ProfilesPanel.test.tsx` covers the *load* error but\nneither `setActive` nor `remove` failing. Those gaps are why the defect below\nwent unnoticed.\n\nProfileEditorPage.payload.test.tsx (20 tests):\n- the `idTouched` latch — editing the id stops the name re-slugging over it,\n and the id keeps tracking the name until it is touched\n- payload normalisation: name/description trimming, `name.trim() || id` when\n the name is blank, null rather than "" for the optional text fields,\n `agentId` defaulting to orchestrator, and the `Number.isFinite` guard that\n keeps "abc" / "--" / "Infinity" from becoming a NaN temperature\n- `builtIn` preserved when editing a built-in, false on create\n- the failure path: an alert appears, the page does not navigate away, the\n button re-enables, and a later success clears the error\n\nProfilesPanel.actions.test.tsx (9 tests):\n- select and delete failures surface an error at all\n- the error clears on a subsequent success\n- a dismissed confirm neither deletes nor raises an error\n- affordance rules: no Delete on a built-in, no "Set as active" on the active\n profile, Edit on both, and the Active/Built-in/Custom labels\n\nFound while writing these, and pinned as CURRENT behaviour in one test per\npanel: **every failed profile save, select and delete renders "[object Object]"\ninstead of the message.** `dispatch(thunk).unwrap()` rejects with Redux\nToolkit's SerializedError — a plain object, not an `Error` — so the\n`err instanceof Error ? err.message : String(err)` guard at\nProfileEditorPage.tsx:170 and ProfilesPanel.tsx:46,59 takes the String branch\nand stringifies an object. The guard is defeated by the exact case it was\nwritten for. Details and a suggested fix are in the bug list; when it is fixed\nthose two tests should be flipped to assert the message, not deleted.\n\nEvery assertion was verified to fail with the behaviour reverted.\n
M3gA-Mind committed 3 months ago
2f46568
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-Mind committed 3 months ago
7723a51
test(app): pin route auth guards and the iOS re-pairing escape hatch\n\nTwo more new specs, no existing file touched.\n\nAppRoutes.guards.test.tsx — which desktop routes require authentication and\nwhich deliberately do not. A route losing <ProtectedRoute> exposes its surface\nand its on-mount RPC to an unauthenticated session; a route gaining one locks\nout the OAuth callback that establishes the session in the first place. Both\nare one-line edits in a 260-line JSX table and nothing asserted either:\nauth-access-control.spec.ts covers the session lifecycle, never the per-route\nclassification, and the existing vitest specs mock the guards to passthroughs.\n\n Two layers. Render assertions for the routes this file owns, plus a\n source-level classifier over the WHOLE table so a route added or re-guarded\n anywhere fails here even when its page is another spec's business. The\n classifier separates `protected` from `protected-but-open`\n (`requireAuth={false}`) — the wrapper is still present, so the route reads as\n guarded in review while the check is off.\n\n It deliberately does NOT assert `requireAuth={true}` is spelled out:\n ProtectedRoute.tsx:18 defaults it to true, so that would fail on a harmless\n tidy-up and catch no real defect. Verified — dropping the prop from /invites\n changed no behaviour and correctly failed nothing.\n\nAppRoutesIOS.pairing.test.tsx — /pair must stay reachable from an ALREADY\nPAIRED phone. openhuman#5479 ("Cannot Pair iPhone") is a Rust wire-contract\nfailure and is not fixed here; what this protects is what turns it from "retry"\ninto "bricked". `isPaired()` is `listProfiles().length > 0` and never asks\nwhether the core answers, so a phone holding a profile for a desktop that is\ngone reads as paired — and is exactly the phone that must reach a QR scan.\nAppRoutesIOS.test.tsx covers /pair while UNPAIRED; the paired case regresses\nsilently. PairScreen's own behaviour is already covered by PairScreen.test.tsx\nand is not repeated.\n\nProven by reverting the behaviour each covers:\n - /rewards loses ProtectedRoute -> 3 fail\n - /callback/:kind gains ProtectedRoute -> 2 fail\n - /callback/:kind/:status deleted -> 3 fail\n - requireAuth={false} on /invites -> table names "protected-but-open"\n - requireAuth={false} on /rewards -> 2 fail\n - an unclassified route added -> table fails\n - /pair removed from the mobile table -> 4 of 5 fail\n - /pair wrapped in RequirePairing / MobileShell -> 2 / 1 fail\n - /chat/:threadId? loses its optional segment -> 1 fail\n
M3gA-Mind committed 3 months ago
6aaef92
test(app): pin route redirect contracts and the embedding-state warning\n\nTwo new vitest specs, no existing file touched.\n\nAppRoutes.redirects.test.tsx — every `<Navigate>` in the route table asserted\nby resolved location rather than by what rendered, plus a drift guard that\nfails when a redirect is added to AppRoutes.tsx and not to the table here.\n\n The existing `/accounts` guard in AppRoutes.auth.test.tsx cannot fail:\n it asserts the `Accounts` component rendered, and `Accounts` is also the\n element for `/chat/:threadId?`, so deleting the redirect outright leaves it\n green. Verified by doing exactly that — old spec 2 passed, new spec 3 failed.\n\n `replace` was unasserted anywhere. A pushed redirect leaves the retired path\n on the history stack, so Back returns to it and is redirected forward again.\n Nine cases now pin REPLACE.\n\nMemorySourceRow.pipelineWarning.test.tsx — the "stored without vectors" banner\nmust reach the screen. The verdict behind it (deriveSourcePipelineHealth) is\nalready exhaustively covered; the *rendering* was not, so neutering the JSX\nblock left the whole suite green. That is the shape of the incident where\n2,581 chunks sat with 0 embedded and no indicator appeared anywhere.\n\nEvery assertion was proven by reverting the behaviour it covers and confirming\nthe failure names it:\n - drop `?tab=messaging` from /channels -> 2 fail\n - drop `replace` from /feedback -> 1 fail (PUSH vs REPLACE)\n - retarget /routines to /chat -> 1 fail\n - add an untracked redirect -> drift guard fails\n - neuter `{ingestedOnly && ...}` -> 6 fail\n - force `settled = false` (wedged progress) -> 6 fail\n - force `settled = true` (no suppression) -> 1 fail\n
M3gA-Mind committed 3 months ago
628c47b
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-Mind committed 3 months ago
16ff8a4