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): address review — replace assertions that could not fail\n\nReview fixes for #5881. Most of these are the same defect in different\nclothes: an assertion that is already true before the behaviour under test\nhappens, so the test reports success either way.\n\n`tinysweeper` found two, both in the leave-guard tests. `toContain('/flows')`\nis satisfied by `/flows/<id>` itself, so the poll returned true on its first\nevaluation, before the click navigated. In the Discard test that left the real\ncheck racing an in-flight navigation; in the clean-leave test it was the ONLY\npositive assertion, so that test could not fail at all. Both now poll the\nnarrow condition — the absence of this flow's own path. The identical mistake\nin flows-canvas-routes' back-button test was NOT flagged by anyone; fixed too,\nwhere it was non-load-bearing only by luck of a later list-only assertion.\n\n`coderabbitai` found three more of the same shape:\n - the unknown-?tab= test asserted that nav rows were visible, which is true\n on every tab — it could not tell a working fallback from one landing on\n the wrong tab. Now asserts the SELECTED row via aria-current, the same\n predicate the new alias spec uses.\n - the /skills?tab= bug test asserted the Channels nav row was visible, which\n likewise proved nothing about the harm it documents. Now asserts Welcome\n is selected.\n - both /flows/draft tests passed on the unknown-flow screen, which also has\n a back button and no title. There is a dedicated `flow-canvas-draft-missing`\n testid; they now assert it, and the second also excludes `flow-canvas-error`\n rather than only `flow-canvas-not-found`.\n - AboutPanel asserted /^https?:\/\// while being named "rather than a\n hardcoded one" — a shape a hardcoded URL satisfies. Now asserts\n LATEST_APP_DOWNLOAD_URL.\n - AgentsPanel resolved `undefined as never` for an API returning\n Promise<boolean>; the cast was the tell. Now resolves true.\n\n`coderabbitai` also caught two tests asserting states that were never reached:\nthe failed-install test's "enabled and reading Install" is also the button's\nINITIAL state, so it passed whether or not the click did anything, and the\ntext-retention test slept 800ms rather than observing a request in flight.\nBoth now HOLD the RPC, assert the pending state, then release.\n\n`chatgpt-codex-connector` caught the recovery-phrase fallback: the execCommand\nstub returned success without inspecting the textarea, so both fallback tests\npassed if it were empty or held the wrong phrase — and a false "Copied" here\ncan cost a user their only copy. The stub now captures the copied value and\nboth tests assert it equals the phrase.\n\n`YellowSnnowmann` flagged prettier drift in four spec files; formatted, and\nall nine files are clean.\n\nNOT DONE, deliberately: preserving `?tab=` through the /skills redirect. That\nis a production change and this PR is test-only (0 production files). The bug\nis recorded with a verified fix; the test pins current behaviour and is\nlabelled BUG with flip instructions. Replied on the thread.\n\nNOT VERIFIED BY EXECUTION: local builds and test runs are prohibited under the\ncurrent standing rule, so none of this was run. Every change is reasoned from\nthe source, with the file:line each claim rests on written beside it. The\nrevert-proofs that normally back my specs could not be redone for these edits.\nCI is the check.\n
M3gA-Mind committed 3 months ago
a69e4a2
style: apply prettier to the specs in this branch
M3gA-Mind committed 3 months ago
46387c9
test(e2e): browser coverage for canvas node-add, drag-drop and the leave guard\n\nCloses the last uncovered item of the brief: adding a node to the Workflow\nCanvas. NodePalette.tsx:6-11 documents two add paths and says which is already\ncovered — click is "the path the unit tests drive". The DRAG path is HTML5\ndrag-and-drop carrying an application/tinyflows-node payload on dataTransfer,\nand jsdom implements neither, so no component test can reach EditableFlowCanvas's\nonDrop at all.\n\nPaired with the unsaved-changes guard, because losing canvas edits is the\nexpensive failure here. The Discard test goes past the UI and re-reads the flow\nthrough flows_get, so "discarded" means genuinely not persisted rather than\njust visually gone.\n\nRevert-proofed with four mutations, each rebuilt before the run:\n - onDrop ignores the palette payload -> ONLY the drag test fails; click-add\n and the kind check pass, which is what proves the two add paths are\n independent rather than one covering both.\n - click-add disabled -> the click and kind tests fail while drag passes.\n - the dirty guard disabled -> the three dirty-guard tests fail, clean-leave\n passes.\n - the guard forced always-on -> ONLY clean-leave fails.\nBoth directions of the guard condition are covered, not just "it fires\nsometimes". Every test in the file has a killing mutation except the\npalette-render precondition. Sources restored (git diff --quiet verified).\n\nAlso fixes a FLAKE I introduced in skills-search-install: the "clearing restores\nthe rows" half of the filter test passed alone and in a four-spec run, then\nfailed in the full five-spec run. Clearing takes fetchCatalog's\n`!query && !sourceFilter` branch (SkillsExplorerTab.tsx:517), which calls\nskillRegistryApi.browse() — an UPSTREAM registry fetch, not reliably fast in\nthis lane. Swapping a vacuous assertion for a flaky one is not an improvement,\nso the test now pins only the deterministic half and the file records why, to\nstop it being "restored" later.\n\nFinding recorded separately (W3-ui-bugs.md §11): the canvas opens with its\ninsert palette HIDDEN — showPalette={sidePanel === 'legend'} while sidePanel\nstarts at 'copilot' — yet the empty state reads "Add a node from the palette on\nthe left", and the palette renders on the right once revealed.\n\n42/42 across all five of my specs on the assigned ports (18403/17703/4403).\nNo production code changed.\n
M3gA-Mind committed 3 months ago
b5f2ae0
test(e2e): browser coverage for skills search debounce and install states\n\nskills-registry.spec.ts has a test called "search filters entries by query",\nbut it sits in that file's RPC-smoke describe: it calls\nopenhuman.skill_registry_search directly and never touches the UI. Nothing\ntyped into the search box, and nothing exercised the install button.\n\nThe part only a browser can check is the debounce. SkillsExplorerTab.tsx:22\nsets SEARCH_DEBOUNCE_MS = 300 and restarts the timer per keystroke, so a burst\nof typing must produce ONE catalog search carrying the FINAL text, and a pause\nmust produce a second — it has to delay, not swallow. These count real RPCs\nagainst real keystroke timing.\n\nThe install button's middle state is the same shape: Install -> Installing\n(disabled) -> Installed badge, where the middle only exists while the request is\noutstanding. The spec holds the install RPC open with a route handler to observe\nit, then releases. A third test fails the install and asserts the button\nre-enables, since a button stranded disabled leaves the user unable to retry.\n\nOne test was written and REMOVED as vacuous before committing: it asserted\n`queries.length >= previousCount` after clearing the box, which array lengths\nmake structurally always true. The meaningful half is folded into the filter\ntest instead — a no-match query empties the catalog AND clearing restores it.\n\nRevert-proofed with three mutations, each rebuilt before the run:\n - SEARCH_DEBOUNCE_MS = 0 -> the burst test fails with\n 'expected one debounced search, got 6: ["d","do","doc","dock","docke","docker"]',\n a per-keystroke prefix sequence no unchanged build could emit.\n - the in-flight `disabled` removed -> only the Installing test fails.\n - the state reset moved out of `finally` into the success path -> only the\n re-enable test fails.\nNote on the third: an earlier attempt used an early `return` in the `catch`,\nwhich does NOT work because `finally` runs after `return` — the test would have\npassed and been wrongly recorded as unproven. A mutation that changes nothing is\nindistinguishable from a vacuous test; see W3-ui-bugs.md §10.\nSkillsExplorerTab.tsx restored (git diff --quiet verified).\n\n7/7, and 34/34 across all four of my specs, on the assigned ports\n(18403/17703/4403). No production code changed.\n
M3gA-Mind committed 3 months ago
e584461
test(e2e): browser coverage for the Flows routes and back-compat slugs\n\nExisting coverage is thin and indirect: skill-lifecycle.spec.ts only checks the\nflows_list RPC is reachable, and top-level-functional-flows.spec.ts drives the\nLEGACY SKILL.md /workflows CRUD page, a different surface. Nothing opened\n/flows/:id.\n\nCovers the list surface, an existing flow's canvas (created through\nflows_create), the not-found state for an unknown id, the back button, the\nunsaved-draft route, and the three back-compat slugs.\n\nTwo scope facts pinned rather than papered over:\n - /flows/draft cannot be opened by URL. The draft graph rides in\n location.state, so a direct hit renders an empty state on purpose "rather\n than a broken canvas". The test asserts that, and a second test pins the\n route-order guarantee that "draft" is never captured as an :id.\n - /webhooks is a TWO-hop redirect: AppRoutes.tsx:238 -> /settings/integrations\n -> settingsRouteElements.tsx:129 -> /connections. The intermediate target is\n itself a redirect, and no #webhooks fragment survives either hop, so an old\n bookmark lands on generic Connections. Recorded in the bug list.\n\nThree assertions were rewritten after proving vacuous:\n - /workflows and /routines asserted only "body non-empty, some button\n visible" — which the CHAT surface satisfies, and chat is where they were,\n because bootAuthenticatedPage races its own /home -> /chat redirect when\n given any other hash. They now assert distinct destinations, and /workflows\n additionally asserts flows-new-workflow is ABSENT so the two surfaces\n cannot be conflated.\n - flow-canvas-title is an <input>, so toContainText compares against text\n content and always sees "". Now toHaveValue.\nAlso: flows_create answers a CLI envelope {result, logs}; reading .id off the\nraw result yields undefined while the core logs "flows_create -> ok".\n\nRevert-proofed with two swap mutations (swaps, not deletions, so every import\nstays used and TS6133 cannot leave a stale dist-web), each rebuilt before the\nrun:\n - /routines and /webhooks redirect targets swapped -> both those tests fail,\n untouched /workflows passes.\n - canvas title forced to a fixed string -> the title test fails naming\n 'unexpected value "pw-wrong-title"', the other two canvas tests pass.\nFlowCanvasPage.tsx and AppRoutes.tsx restored (git diff --quiet verified).\n\n9/9, and 27/27 across all three of my specs, on the assigned ports\n(18403/17703/4403). No production code changed.\n
M3gA-Mind committed 3 months ago
7a066ce
test(e2e): browser coverage for connector-modal focus trap and Escape\n\nEvery connector setup flow on /connections renders through ModalShell, whose\nmodule doc names the bug it was written for: "there was none — Tab escaped the\ndialog into the page behind it". None of that is testable in jsdom, which does\nnot implement sequential focus navigation: Tab moves nothing there, so a jsdom\nfocus-trap test passes whether or not the trap exists. This is the only place\nthe behaviour is actually exercised.\n\nThe vehicle is SecretPromptDialog, opened by dispatching the window event the\nsocket bridge normally publishes — the one connector dialog that opens\ndeterministically with no live credentials, and a plain ModalShell consumer.\nmcp-setup-secret-flow.spec.ts already covers submit/cancel/show-hide; this\ncovers only the keyboard and focus surface it does not touch.\n\nRevert-proofed with four mutations, each rebuilt and re-driven in the browser:\n 1. Focus trap deleted (Radix DialogContent -> a plain div, the pre-ModalShell\n state) -> the Tab test fails with "focus left the dialog after 3 Tab\n press(es)" and Shift+Tab with "after 2".\n 2. allowEscapeClose = false -> "Escape closes the dialog" fails.\n 3. ModalShell's focus-restore effect removed -> "Escape restores focus" fails.\n 4. Mutation 3 re-run in ISOLATION (Escape working again), because under\n mutation 2 tests 5 and 6 had failed only because the dialog never closed —\n attribution, not behaviour. Isolated, exactly the restore test fails.\nAll three sources restored byte-identical afterwards (git diff --quiet verified).\n\nA fourth containment test was written and REMOVED: it asserted\nactiveElement.id !== 'pw-focus-anchor' after 12 Tabs and PASSED with the trap\ndeleted, because escaping focus need not land on that one element. The spec\ncarries a comment so it is not re-added. Two rules from that, worth reusing:\nassert focus is INSIDE the container rather than outside one element, and assert\nafter every keypress so the failure names which press escaped.\n\nTwo tests are labelled in-file as NOT mutation-proven rather than counted:\n"moves focus into the dialog when it opens" survives both the trap deletion and\nremoving the input's autoFocus (Radix focuses on open independently), and\n"Escape does not submit the secret" is a negative guard no one-line mutation\nbreaks.\n\n9/9 passing in 7.6s against the e2e-web-build.sh bundle. No production code\nchanged.\n
M3gA-Mind committed 3 months ago
445a60d
test(e2e): browser coverage for Connections tab URLs and deep links\n\nPlaywright, driven in a real browser. skills-registry.spec.ts already clicks\neach Connections tab and asserts the panel that renders; nothing checked the\nURL. This covers the half that reaches users: whether the address bar follows\nthe tab, whether a bookmarked deep link lands where it names, and whether a\nreload comes back to the same place.\n\nIt also pins a real bug. AppRoutes.tsx:169 comments that the /skills →\n/connections redirect "preserves ?tab= deep links". It does not: <Navigate\nto="/connections" replace /> is a fixed string with no search, and React Router\ndoes not carry the query across it, so activeTab falls through to its 'welcome'\ndefault and a pre-rename bookmark lands on the overview. The test named\n"BUG: ..." pins CURRENT behaviour and is annotated in-file with what to flip\nwhen the fix lands. The sibling test is the control: /channels redirects to\n/connections?tab=messaging — a literal search string — and that one works, which\nis what makes this a bug rather than a limitation.\n\nRevert-proofed with three mutations, each rebuilt and re-run in the browser:\n 1. INVERSE — applying the two-line fix (a SkillsRedirect component reading\n useLocation().search) makes the BUG test fail, naming the assertion:\n Expected substring: not "tab=channels" / Received: "#/connections?tab=channels".\n That also confirms the fix works.\n 2. handleTabChange stops calling navigate → "clicking a tab writes ?tab=" fails.\n 3. /channels redirect drops its explicit tab → the control test fails.\nBoth source files restored byte-identical afterwards (diff -q verified).\n\nScope note in-file: nothing here opens the Composio tab. Doing so downloads the\ntinyconnectors module from a GitHub release, and a failed download is terminal\nfor the core process — it stops answering RPC and takes the rest of the file\nwith it. Recorded in the bug list.\n\n9/9 passing in 33.5s against the e2e-web-build.sh bundle. No production code\nchanged.\n
M3gA-Mind committed 3 months ago
cc4e76b
test(settings): cover agent removal and toggle failures in AgentsPanel\n\nhandleRemove was an entirely uncovered function and it is the one that deletes a\nregistry entry. The same handler backs two differently labelled buttons —\n"Delete" for a custom agent, "Reset" for a built-in — so the copy is the only\nthing telling a user which of those they are about to do; a swap there is a\nuser deleting an agent they meant to reset.\n\nCovers: the right id reaching remove(), the list being re-fetched afterwards\nrather than patched locally, the Delete/Reset labelling, and the failure arms of\nboth handleRemove and handleToggle including their non-Error fallbacks.\n\nNot covered, and the file says why: handleToggle's ORCHESTRATOR_ID early return\nis unreachable because the orchestrator's switch is rendered disabled. The\nexisting suite already asserts the reachable half.\n\n6 of 8 tests mutation-proven (reload-after-remove, label swap, swallowed\nfailure, non-Error fallback, fixed-id removal, swallowed toggle failure); the\n"row untouched on toggle failure" test is labelled in-file as a regression guard\nbecause this panel has no optimistic update to break — which is itself worth\npinning, since AgentAccessPanel does update optimistically and roll back.\nSource restored byte-identical after every mutation.\n\nAgentsPanel: 79.6 -> 100% lines, 62.5 -> 76.78% branches, 100% functions.\nSettings suite 1085 -> 1093 tests, 95 files, 0 failures. No production code\nchanged.\n
M3gA-Mind committed 3 months ago
b73cf90
test(settings): pin AgentAccessPanel's fail-closed security defaults\n\nOn load the panel reads four security fields through nullish coalescing:\nrequire_task_plan_approval ?? true, auto_approve_all ?? false,\ntrusted_roots ?? [] and auto_approve ?? []. Each default is chosen to fail\nCLOSED — a core that drops a field must land on "approval required" and\n"nothing auto-approved", not the permissive value. The existing suite always\nsupplies every field, so none of those arms was exercised (66.2% branches).\n\nThe failure this guards: if `?? true` were ever written `?? false`, a core that\nomitted require_task_plan_approval would silently stop requiring plan approval,\nand the toggle would render OFF as though the user had chosen it.\n\nAlso covers addRoot's guards — blank path, duplicate path (clears the field\nwithout persisting), the chosen access level reaching the new root, and that\nEnter adds while other keys do not.\n\n10 mutations, one per test, each confirmed to fail naming its assertion; source\nrestored byte-identical after each. One test was rewritten after its mutation\nsurvived: asserting that the panel merely renders with trusted_roots omitted\nproves nothing, because undefined does not crash the render — it has to add a\nroot, since addRoot spreads the array and spreading undefined throws.\n\nAgentAccessPanel: 92.1 -> 96.42% lines, 66.2 -> 76.05% branches.\nSettings suite 1075 -> 1085 tests, 94 files, 0 failures. No production code\nchanged.\n
M3gA-Mind committed 3 months ago
57a47c3
test(settings): cover the embeddings wipe gate on model and dimension changes\n\nChanging the embedding model or its dimensionality invalidates every stored\nvector, so the core answers EMBEDDINGS_DIMENSION_CHANGE_REQUIRES_WIPE and the\npanel parks the change behind a confirmation. That gate is written three times —\nhandleProviderChange, handleModelChange and handleDimsChange — and the existing\nsuite exercises only the first, leaving the panel at 70.8% branches.\n\nCovers both remaining gates, that a model change carries the NEW model's default\ndimensions into the pending wipe (applying the old dimensionality to a new model\nis how a wipe produces vectors nothing can query), that a dimensions-only change\ndoes not smuggle a model switch into the destructive call, that confirmWipe\nsends confirm_wipe: true, that a failure during the wipe is surfaced rather than\nswallowed, that the pending wipe is cleared so a second confirm cannot re-fire\nit, and both non-Error rejection arms.\n\nWorth noting for anyone testing a gate like this: asserting the call count and\narguments is NOT enough. With the gate deleted the code falls through to a\nreload, so the probing call's count and args are identical either way — only the\nconfirmation dialog differs. Two tests here passed with the gate removed until\nthey were rewritten to turn on the dialog.\n\n9 mutations run — one per test — each confirmed to fail naming its assertion;\nsource restored byte-identical after each.\n\nEmbeddingsPanel: 88.4 -> 92.92% lines, 70.8 -> 73.71% branches, 100% functions.\nSettings suite 1067 -> 1075 tests, 93 files, 0 failures. No production code\nchanged.\n
M3gA-Mind committed 3 months ago
d8da036
test(settings): cover AboutPanel update states and CronJobsPanel ordering\n\nTwo panels in my area, both weak on branches rather than lines.\n\nAboutPanel (52.1% branches): the existing suite drives the real useAppUpdate\nhook through the status event and reaches three of its nine phases. Added 18\ntests over what the panel *renders* from that hook and from Redux — every phase\nproduces a distinct summary (a phase falling through to the default arm would\ncollide with idle and shrink the set), both available_version forks, the\nlast-checked line appearing only when check() returns non-null, and all four\npaths of the rpcUrl effect: cloud reads Redux without calling the shell,\nlocal resolves core_rpc_url, non-Tauri and a rejected command both fall back to\nthe unavailable placeholder. 52.1 -> 83.33% branches, 66.7 -> 88.88% lines,\n100% functions.\n\nCronJobsPanel (60.9% branches, already 97.5% lines): the uncovered part was the\nnext_run sort comparator — an entirely uncovered function that decides which job\nthe user reads as "next" — and the `: String(err)` arm of eight rejection\nformatters. Note the existing suite cannot observe those arms: formatCronError\nis `t(key).replace('{message}', message)`, and a `t` that returns the bare key\ndrops the message, so this file's i18n stub returns a real template instead.\n100% lines, 69.56% branches, 100% functions.\n\n12 mutations run across the two files, each confirmed to fail naming the new\nassertion; sources restored byte-identical after each. Three assertions were\nstrengthened after a mutation failed to kill them (the version strings also\nrender in the update banner, so those tests now suppress the banner to isolate\nthe summary).\n\nSettings suite 1043 -> 1067 tests, 92 files, 0 failures. No production code\nchanged.\n
M3gA-Mind committed 3 months ago
6d8b4d7
test(settings): cover the address-copy paths in WalletBalancesPanel\n\nThe existing suite covers loading/error/retry, the not-configured placeholder\nstate, row rendering, truncation and opening the Send/Receive modals, but left\nthe panel at 83.1% lines / 72.9% branches / 70.8% functions. handleCopyAddress\nwas entirely uncovered — the control a user relies on to get a receive address\nout of the app correctly.\n\nCovers: that the FULL address is written to the clipboard rather than the\ntruncated `0x9858…da94` shown in the row; that a rejected clipboard write does\nnot still report success; the 2s indicator reset; that a second copy restarts\nthat window instead of leaving the first timer to fire; that unmounting clears\nthe pending timer; and truncateAddress's <=12-character boundary.\n\nTwo areas are deliberately not covered and the file says why: the\nrequestId staleness guards are unreachable because Refresh is disabled while\nloading, and the modal onClose/onSuccess props are one-line plumbing the\nexisting suite already reaches.\n\n6 of 8 tests are mutation-proven (full-vs-truncated address, truncation\nboundary, timer restart, unmount cleanup, 2s reset, and the rejected-write\npath); the per-row test is labelled in-file as a regression guard because React\nprops make it unbreakable by a realistic single-line change. Source restored\nbyte-identical after every mutation.\n\nSettings suite 1022 -> 1030 tests, 0 failures. No production code changed.\n
M3gA-Mind committed 3 months ago
4af00ed