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): strengthen four assertions weaker than the tests that carried them\n\nAll four review findings on #5887 are the same failure mode, and it is the one\nthis branch exists to hunt: an assertion narrower than its test's own name.\nAccepting all four.\n\n1. Collapsed rail, keyboard reachability (CodeRabbit). `focus()` succeeds on a\n `tabindex="-1"` element, so the collapsed-rail test proved programmatic focus\n only -- a row Tab can never reach would have passed. Same trap I had already\n fixed in the expanded case and missed here. Now asserts tabIndex >= 0.\n\n2. "collapsing hides the labels" asserted no label (CodeRabbit). It checked rail\n width and reopening only. Collapsed swaps SidebarNav for CollapsedNavRail,\n which renders icons with aria-label and no `[data-slot="sidebar-menu-label"]`\n spans, so the count goes to zero -- now asserted, with a non-zero count\n asserted first so the check cannot pass on an empty locator.\n\n3. Palette Enter asserted only a non-empty hash (CodeRabbit + Codex). Codex\n pinned down why that was worse than weak: the fixture boots on `#/chat`, and\n the top two actions are `nav.home` (-> /home -> /chat) and `nav.chat`\n (-> /chat), so the assertion was already true BEFORE Enter and stayed true\n whichever action ran, or if none did. The test could not detect the\n regression in its title. Now starts from /brain, maps each seed action to its\n real destination via lib/commands/globalActions.ts, and asserts the exact\n hash of the ARROW-SELECTED action. It also fails loudly if items 0 and 1\n share a destination, so a fixture that cannot discriminate reports that\n rather than passing.\n\n4. Rewards accepted absence as success (Codex). `count === 0` passing meant a\n regressed gate, a gate that never becomes ready, or a deleted row all counted\n as success. Verified the premise before changing it: useCloudNavGate requires\n isReady && sessionToken && !isLocalSessionToken (useCloudNavGate.ts:26-28);\n isLocalSessionToken is true only when the token's third dot-part is literally\n `local` (utils/localSession.ts:32-36); buildBypassJwt ends `.sig`\n (helpers/core-rpc.ts:17-22). So this fixture is a cloud session and the row\n must be present. Now asserted.\n\nNOT EXECUTED. Local builds and test runs are prohibited as of this phase, so\nthese four changes are reasoned from source and typechecked only -- prettier\nclean, tsc reports no errors in the touched files. CI is the check. Change 3 in\nparticular alters which route the test expects and has not been run.\n
M3gA-Mind committed 3 months ago
bb05d96
test(e2e): address review on #5888 — fail loudly instead of skipping to green\n\nNOT RUN LOCALLY. A standing rule now forbids local builds and test execution,\nso these are reasoned from source and verified by reading only; CI is the check.\nStated here so nobody reads them as proven.\n\nYellowSnnowmann (major), brain spec: correct and important. All three tests\nended in test.skip when chunks_pending was 0, so a lane with a working\nembeddings provider would skip the whole file to green while asserting nothing\nabout the render path — the same void the spec exists to close. Replaced with\nrequireDegraded(), which skips locally (the memory engine is a downloaded\ncdylib a developer may genuinely be unable to fetch) and THROWS in CI, naming\nwhat to fix. Their alternative — drive the precondition with an\nembeddings-less core in beforeAll — is strictly better and I have said so in\nthe thread; I did not implement it because I cannot verify it without running.\n\nchatgpt-codex, brain spec: correct, and the same root cause from the other\nside. The spec hard-failed on module unavailability instead of skipping, so an\noffline run failed on infrastructure unrelated to the assertion.\nclassifyModuleFailure() now detects the module-load error and applies the same\nrule: skip locally, fail in CI with the remedy (stage the checksum-pinned\nmodule as the Rust E2E job does).\n\ncoderabbitai, five threads, all legitimate:\n - brain: temp corpora were never removed; now tracked and rm'd in afterAll.\n - notifications: reload could race redux-persist's async setItem; now polls\n the persisted blob for read state before reloading.\n - onboarding: resetMock swallowed transport errors and non-2xx; now throws.\n - onboarding: Boolean(completed?.result) turned a malformed response into a\n passing assertion; now requires an actual boolean first.\n - rewards: mockAdmin swallowed errors the same way; now throws.\n
M3gA-Mind committed 3 months ago
ae777b8
fix(shell): remove the window blur listener leak, and guard it for real\n\nReview #5887 (YellowSnnowmann): test.fail() kept CI green on a shipping defect.\nThe annotation was honest inside the file, but the signal a maintainer sees is a\npassing suite, and the leak was recorded nowhere else. Fixing the source instead.\n\nThe drag teardown removed 'blur-sm' -- a Tailwind class name, not a DOM event --\nwhile the registration used 'blur', so removeEventListener never matched and a\nwindow listener leaked per drag at each of two sites:\n\n Sidebar.tsx:283 removeEventListener('blur-sm', detach) -> 'blur'\n RootShellLayout.tsx:185 removeEventListener('blur-sm', stop) -> 'blur'\n\nThese were the only two 'blur-sm' string literals in app/src, both inside\nremoveEventListener and neither in a className, which points at a Tailwind v4\nblur -> blur-sm class rename reaching into string arguments.\n\nThe reviewer also corrected my analysis, and he is right. I had written that the\nstale handlers were "near-silent" and their teardown "idempotent". They are not:\nRootShellLayout's stop() calls setDragWidth(null) and detach() mutates\ndocument.body.style, so every window blur fires a React state update and a style\nmutation per past drag. One nuance in his favour that neither of us stated:\ncommitWidth itself IS guarded after the first call, because dragWidthRef.current\nis nulled -- the state update and style mutation are not. The file now records\nthat precise account instead of either looser version.\n\napp-shell-listener-hygiene.spec.ts drops test.fail() and the KNOWN FAILING\nsuffix, so it is a live regression guard rather than a documented defect.\n\nVerification status, stated plainly: this exact fix was executed and green\n(8/8, including the previously-failing leak assertion) on the PRE-REBASE tree.\nIt has NOT been re-run since the rebase onto 9a631f963, because local builds and\ntest runs are now prohibited. The change is two string literals with no other\nedits, and CI is the check.\n
M3gA-Mind committed 3 months ago
3869a41
test(e2e): rewards and invites survive a real browser reload\n\nrewards-progression-persistence.spec.ts already covers a "simulated restart",\nbut it does that with page.goto('/#/home') and back — a remount inside the same\nJS context, where redux and every in-memory cache survive. A user pressing Cmd-R\ndestroys the context and the page rebuilds from persisted storage plus what it\nre-fetches. Nothing in the suite crossed that line for these two surfaces, and\ntop-level-functional-flows.spec.ts covers the invite copy/redeem interactions\nwithout ever reloading.\n\nVerified state, stated precisely: all three tests have passed, but never all in\none run. Tests 2 and 3 passed together in 6.7s and 6.8s. Test 1 passed at 51.0s\nin an earlier run and has since failed on cold-boot first paint under load.\n\nTwo spec-local timeout raises, both justified by observation rather than\nguessing, and both kept out of the shared playwright.config.ts:\n - describe timeout 150s: the default 60s was enough on an idle machine and\n tipped all three over with "Test timeout of 60000ms exceeded" — no assertion\n failing — once other e2e sessions shared the host.\n - 60s on test 1's first-paint wait: it is first in the file and pays the cold\n boot plus the first rewards fetch.\n\nTest 2 was under-seeded in its first draft: it set rewardsScenario without\nrewardsLastSyncedAt, and the missing progress summary read as a routing failure.\nBoth keys are now set, matching the existing rewards spec.\n
M3gA-Mind committed 3 months ago
c4c0bbc
test(e2e): keyboard traversal of the app shell — the first spec here to press Tab\n\n`rg "press\('Tab'\)|activeElement"` over all 78 Playwright specs returns\nnothing: no spec in this repo has ever pressed Tab or read\ndocument.activeElement. jsdom cannot stand in either -- it has no sequential\nfocus navigation, no :focus-visible resolution and no computed outline -- so the\n735 vitest files say nothing about it. Keyboard regressions are silent: nothing\nlooks broken to a mouse user.\n\nSeven tests. The two that matter most:\n\n * focus is not lost to <body> when a nav row changes route -- the classic SPA\n regression where the focused element unmounts, focus falls back to body, and\n the next Tab restarts from the top of the document;\n * Tab moves onward rather than trapping inside the sidebar -- a trap in the\n nav is unrecoverable without a mouse.\n\nPlus: every row focusable AND in the tab order, Enter and Space both activate\n(a div-with-onClick answers to neither), the focus ring actually resolves to a\nvisible box-shadow/outline, and the collapsed rail stays reachable -- if its\nrows are not focusable, collapsing leaves a keyboard user with no nav at all.\n\nA flaw in this spec's own first version, worth recording because it shipped\ngreen: "every nav row is reachable by keyboard focus" used only\n`locator.focus()`, which succeeds on a `tabindex="-1"` element. Programmatic\nfocus and tab-order membership are different properties, so the test passed\nagainst exactly the regression its own comment named. Found by asking what fault\nthe assertion would catch while choosing a mutation, not by re-reading it. Fixed\nwith a tabIndex >= 0 assertion and then proven with a tabIndex={-1} injection --\nwhich the original would have let through.\n\nAll seven revert-proven, rebuilding dist-web between injection and run:\n tabIndex={-1} on nav rows -> test 1 only\n Enter/Space suppressed -> tests 2, 3, 7\n focus-visible:ring-2 removed -> test 6 only\n focus blurred after a nav click -> test 4\n Tab trapped inside the nav -> test 5\n\nTwo accessibility gaps found while writing this are recorded in the bug list and\ndeliberately NOT asserted here: the shell has no skip link, and no <main>\nlandmark (RootShellLayout renders a plain div; the only <main> elements in\napp/src are in pages/Accounts.tsx and a dev demo). Neither is a contract this\nrepo has adopted -- no a11y lint rule, no axe run, no stated WCAG target -- so a\nred lane for either would be shipping an opinion as a gate.\n
M3gA-Mind committed 3 months ago
2919e14
test(e2e): #5676 AC-3/AC-4 in a browser, plus a listener-leak guard\n\nTwo specs.\n\napp-shell-sidebar-resize.spec.ts covers the two acceptance criteria of #5676\nthat a browser can actually reach, and its header records the split explicitly\nso a green run is not mistaken for closing the issue:\n\n AC-1 no native webview punch-through when collapsed -- OUT OF REACH here\n AC-2 macOS traffic lights stay clear of the rail -- OUT OF REACH here\n AC-3 the seam paints bg-line-chrome on hover/focus -- covered\n AC-4 drag-resize, persistence, arrow-key steps -- covered\n\n#5676 asks for a visual pass on a real desktop build (pnpm dev:app). AC-1 and\nAC-2 are about native compositing and window chrome; the web lane is a browser\ntab and has neither. AC-3 is the case the issue itself calls out -- "unit tests\nonly assert the class name is applied, never its rendered colour" -- and\ngetComputedStyle in a real engine is exactly the missing instrument.\n\nTwo DOM facts cost a run each and are now recorded in the file:\n\n * The rail is `w-0` by design (Sidebar.tsx:330), so Playwright reports it\n `hidden`, `hover()` never acts on it, and boundingBox() is a zero-width\n line. Use toHaveCount for presence, and point at the hit-area child.\n * Only the LEFT half of the widened hit area receives events. Measured with\n elementFromPoint (sidebar edge x=224, hit area 220..228): x=221 and x=222\n hit the rail; x=224 and x=227 hit the content viewport, which paints above\n the hit area's z-10 from a different stacking context. Aiming at the\n element centre -- what hover() and boundingBox() centre do -- lands on the\n dead side. Recorded as W5 BUG-11.\n\napp-shell-listener-hygiene.spec.ts guards W5 BUG-12: the resize drag adds a\nwindow 'blur' listener and removes 'blur-sm', so one leaks per drag per site.\nBoth Sidebar.tsx:283/291 and RootShellLayout.tsx:185/202 have the pairing, and\nthose two string literals are the only 'blur-sm' occurrences in app/src -- both\ninside removeEventListener, neither in a className, which points at a Tailwind\nv4 blur -> blur-sm class rename reaching into string arguments.\n\nMeasured: baseline 3, +2 per drag, 9 after three drags. A control test asserting\nthe three correctly-paired pointer listeners DO balance is what makes that\nnumber trustworthy rather than an instrumentation artifact.\n\nThe leaking assertion is marked test.fail(): it states the contract the code\nintends, so it is green on main today and turns red the moment the bug is fixed,\nwhich is the prompt to remove the annotation. Verified both ways -- replacing\nthe two literals with 'blur' makes it pass and leaves the rest of the suite\ngreen. The source change is NOT included here; this dispatch is test-only.\n\nEvery test revert-proven by mutation, rebuilding dist-web between injection and\nrun: arrow step 16->8, drag move neutered, rail rendered while collapsed, and\nthe seam indicator emptied each failed only the tests asserting that property.\n
M3gA-Mind committed 3 months ago
981a2ff
3b84b5b