Skip to content

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

Commits on main

style: apply prettier to the specs in this branch
M3gA-Mind committed 3 months ago
76449ce
test(connections): cover ?tab= resolution on the Connections page\n\nSkills.intelligence-tabs.test.tsx covers six canonical values (llm, voice,\nembeddings, search, usage, composio-key). The rest of that useMemo\n(Skills.tsx:517-542) had none:\n\n - the four LEGACY aliases -- apps, messaging, tools, explorer -- had ZERO\n coverage, despite existing specifically for back-compat;\n - the default landing tab, which every first visit takes, had none;\n - an unrecognised or empty value had none.\n\nAsserts the resolved tab off the two-pane nav's aria-current\n(TwoPaneNav.tsx:97-98) rather than each tab's body, so a case does not depend\non whatever mocks its panel happens to need. Welcome is the exception -- it is\nthe landing overview with no nav row of its own, asserted by its own testid.\n\nAlso pins that an unrecognised value, an empty value and a wrong-case value all\nfall back to Welcome rather than resolving to nothing.\n\nContext worth carrying: the aliases are currently unreachable by the route they\nwere written for. /skills redirects with <Navigate to="/connections" replace />,\na bare path string, so the query is dropped before the page sees it -- pinned\nseparately in AppRoutes.connections-flows.test.tsx. They remain reachable via a\ndirect /connections?tab=apps, which is what this file exercises, so the branches\nare live rather than dead.\n\nEvery test revert-proven, four mutations:\n delete the whole alias table -> 6 fail\n map 'messaging' to the wrong tab -> 1 fail, exactly that case\n change the default from welcome -> the 4 fallback cases fail\n drop 'wallet' from the accept-list -> 1 fail\nSkills.tsx restored after each; 16/16 green, prettier and tsc clean, 3.5s.\n
M3gA-Mind committed 3 months ago
a2a0f64
ee9e53a
test(chat): address PR review — remove vacuous assertions, scope test.fail\n\nFour review threads, all legitimate.\n\n@YellowSnnowmann (Brain.errorRecovery): the `queryByRole('alert')` assertion\nafter the recovery wait was structurally incapable of failing — waiting for\n`memory-graph` makes `graph` truthy, which makes the alert branch unreachable\nwhatever `error` holds. I had documented that unfalsifiability and kept the\nline anyway, in a PR arguing vacuous coverage is worse than none. Removed, and\nthe comment block kept as the record of what was checked. The same assertion\nsurvives in the CHARACTERISES test, where the unreachability IS the defect\nbeing recorded rather than evidence of a cleared error; that distinction is now\nwritten down instead of implied.\n\n@coderabbitai (IME bridge): `writesDuringComposition` was `observed.length` on\nan array the loop had just pushed to, so it was 3 whatever the bridge did.\nDeleted. Two replacements were tried and are recorded in the file so they are\nnot retried: spying on `composer.setText` records ZERO calls while the store\nstill ends up correct (the hook's `useAui()` does not return the same composer\nobject a test can reach), and a pre-rerender sentinel is reverted by the\nbridge on the next render. What ships keeps the store-content assertion, which\nwas always the meaningful half, plus the inverse case a fix must preserve — a\nsame-value rerender must not write.\n\n@coderabbitai (Shift+Enter): `toContain('hello')` / `toContain('world')` were\nboth true of the unmodified "hello world", so the test passed whether or not\nthe key did anything. Now asserts a `<br>` in the composer DOM rather than a\nliteral newline in textContent — the composer is Lexical and whether a hard\nbreak contributes a character is its implementation detail — plus a\nwhitespace-stripped equality pinning the surrounding text.\n\n@chatgpt-codex-connector (test.fail scoping): `test.fail()` marks the whole\ntest, so a broken auth flow, dead socket or gate-poll timeout would all be\nrecorded as "expected". My comment claimed the run never fails on the poll with\nnothing enforcing it. Everything that could fail for the wrong reason moved\ninto the green sibling, which uses byte-identical setup and asserts a\ncompletion request actually reached the mock; the expected-failure test now\nholds setup plus the single banner assertion.\n\nThe IME change was revert-proofed before local execution was withdrawn:\nsuspending the bridge write fails 4 of 5 tests, the reworked one with\n`expected [ '', '', '' ] to deeply equal [ 'n', 'ni', 'nihao' ]`. The Shift+Enter\nand test.fail changes are reasoned from source and NOT executed — a standing\ninstruction stopped local builds and test runs mid-review. CI is the check.\n
M3gA-Mind committed 3 months ago
7380e72
test(chat): narrow the caret defect, and catch a dead Edit affordance\n\nFour Playwright tests. Two findings, both from measurement rather than reading.\n\n1. The caret defect is narrower than reported, and in a different component.\n The main composer is `LexicalComposerInput` from `@assistant-ui/react-lexical`\n (thread.tsx:429), NOT `ComposerPrimitive.Input` - which corrects my own\n earlier attribution. And only a typed keystroke loses the caret:\n\n type X at offset 5 -> caret 12 (end) WRONG\n Backspace -> caret 4 correct\n paste ABC -> caret 8 correct\n\n I predicted the end position for both contrasts and was wrong both times.\n So the fault is not "any insertion" and not "any value-changing render" -\n it is Lexical's insert-text path, and whatever preserves the selection on\n its delete and paste commands is not running there. Both contrasts are\n asserted so they guard against the fix spreading damage.\n\n2. The message Edit button is rendered but inert. The runtime adapter\n implements neither onEdit nor setMessages, so assistant-ui reports\n edit: false and EditComposer never renders - yet ActionBarPrimitive.Edit is\n rendered unconditionally (thread.tsx:844). Hovering a user message shows a\n pencil button; clicking it does nothing.\n\n auiThreadState.test.tsx predicted exactly this in its header - "this test is\n what would fail the day someone wires an affordance to a capability the\n adapter cannot honour" - and did not fail, because it asserts the capability\n flag and nobody asserted the DOM. Found while trying to reach the edit\n composer to isolate the caret bug.\n\nUndo and redo after a mid-string insertion are covered and correct.\n\nRevert-proofed with a rebuild between injection and re-run: renaming the edit\nbutton's class changed the served bundle hash and failed the Edit test at\ntoHaveCount(1) with Received 0, leaving the other three untouched. Run on\ndedicated ports 18404/17704/4404.\n
M3gA-Mind committed 3 months ago
9a9299d
test(chat): reproduce the mid-string caret jump in a real browser\n\nUser report: typing in the middle of composer text moves the caret to the end.\nReproduced end to end in Playwright; five tests.\n\nMeasured: type "hello world", Home, ArrowRight x5 (caret=5), type "X" ->\ntext is "helloX world" (correct) but caret=12, the end. The next character\ntherefore lands at the end too, giving "helloX worldY" instead of\n"helloXY world". The text corruption, not the cursor, is what users notice.\n\nThe composer is a contenteditable div - no `value`, no `selectionStart` - so\nthe caret is measured through Selection/Range. A MutationObserver shows the\nmechanism: ArrowRight produces no mutations at all, while a character produces\na native `characterData` insert followed by a `childList` record replacing the\ntext node outright. Replacing the node destroys the Selection anchored to it\nand the browser re-collapses the caret to the end.\n\nBoth host-side suspects are eliminated by instrumentation, not by reading:\n`useComposerTextBridge` fires ZERO times during typing (probed with a\nconsole.warn above its setText call), and replacing\n`onChange={e => setInputValue(e.target.value)}` with a complete no-op changed\nnothing at all. Host `inputValue` state is not on the typing path. What remains\nis assistant-ui's ComposerPrimitive.Input, which owns the composer store during\ntyping and whose re-render swaps the node.\n\nDeletion is unaffected - backspace keeps the caret correctly - so the defect is\nspecific to insertion renders. That contrast is covered as its own test.\n\nNo jsdom test could have caught this: jsdom has no contenteditable selection\nmodel, and a text-only assertion passes because the FIRST keystroke is correct.\n\nThe desired behaviour is test.fail()-marked so it flips to a hard failure when\nfixed; the scrambled-text consequence is asserted green so the defect survives\na careless removal of the marker. An arrow-key control test and the backspace\ncontrast test bound the claim: the control passing while the insertion test\nrecords caret=12 is what proves the measurement discriminates.\n
M3gA-Mind committed 3 months ago
a419ea0
test(chat): cover thread-list CRUD and the /chat/:threadId deep link\n\nSeven Playwright tests, no product change. Of the ~16 existing chat specs only\n`conversations-web-channel-flow` touches thread switching, and incidentally;\nthe sidebar's own create/rename/delete and the deep link had no coverage at\nall.\n\nThe deep link is the one that mattered most. `Conversations.tsx:670-685`\nresolves `routeThreadId` through a branch that deliberately bypasses the\nGeneral-tab visibility filter, so a task-labelled thread can be opened by URL\neven though the sidebar would never list it. That filter is live\n(`selectedLabel` is hardcoded to General at `:311`), so a regression there\nsends a shared link to the wrong thread — or to a fresh empty one, which\nreads as data loss. Two tests cover it: one asserts the link wins over the\nmost-recent-thread resume (a decoy thread is created after the target so a\npassive resume would pick the wrong one), the other that an unknown id falls\nback to /chat rather than sitting on a route pointing at nothing.\n\nRename is asserted across a reload so it proves a backend commit rather than\nlocal component state, and Escape-cancel is covered separately because it has\nto suppress the commit the ensuing blur would otherwise fire. Delete asserts\nthe row survives while the dialog is open, so the confirmation is not\ndecorative, and that an untouched neighbour thread is left alone.\n\nAll seven revert-proofed with per-test attribution, each failing on its own\nassertion:\n delete no-op -> tests 6,7 fail at `expect(dialog).toBeVisible()`\n Escape branch removed -> test 5 fails at `expect(input).toHaveCount(0)`\n deep-link find broken -> test 2 fails at the selectedThreadId poll\n fallback nav removed -> test 3 fails at the page.url() poll\n rename dispatch cut -> test 4 fails at `toContainText(RENAMED)`\nand the untouched tests kept passing in each run, so the breaks are scoped.\n
M3gA-Mind committed 3 months ago
a2f560b
test(chat): cover the pre-stream failure path (#5729) and the IME composer bridge (#5763)\n\nTwo new spec files, no product change. Both areas were uncovered: the\nexisting ~14 chat specs cover mid-stream failure and Enter-key suppression\nduring IME composition, neither of which is what these two issues report.\n\napp/test/playwright/specs/chat-pre-stream-failure.spec.ts\n Reproduces #5729 end to end. A connection reset injected on the completion\n request (the mock backend's `httpFaultRules` engine, via /__admin/behavior —\n no shared harness file is touched) kills the turn before any stream event,\n so no `chat_error` is published and the UI shows nothing until\n `armSilenceTimer`'s 120s watchdog. The first test asserts the behaviour the\n product should have and is marked `test.fail()`, so it flips to a hard\n failure the day #5729 is fixed. The other two pin what users get today: the\n turn is silently dropped (an empty assistant bubble mounts, no banner, the\n scripted answer never arrives) and the composer still recovers for a retry.\n\n Each test gates on a `/__admin/requests` poll proving the turn actually\n reached the LLM route, so "no banner" cannot be confused with "the send\n never left the client" — which is exactly what the first draft got wrong.\n\napp/src/components/chat/composer/__tests__/useComposerTextBridge.ime.test.tsx\n Pins the #5763 mechanism. `useComposerTextBridge` is deliberately\n prop-wins and composition-unaware, so every intermediate IME pre-edit value\n is written back into the composer store — i.e. the textarea's value is\n assigned mid-composition, which is what commits the pre-edit buffer and\n produces the reported `nihao` -> `n ni nihao 你好` accumulation. Three\n community PRs are open (#5791, #5775, #5764); this does not pick one, it\n makes the seam visible so any of them turns these tests red.\n\nEvery test was revert-checked and fails with its own assertion named.\n
M3gA-Mind committed 3 months ago
8d16bf4