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
chore: files changed app/test/e2e/specs/agent-review.spec.ts,app/test/e2e/specs/chat-harness-scroll-
Steven Enamakeldb733951bc06
diff --git a/app/test/e2e/specs/agent-review.spec.ts b/app/test/e2e/specs/agent-review.spec.tsdeleted file mode 100644index b73031addf..0000000000--- a/app/test/e2e/specs/agent-review.spec.ts+++ /dev/null@@ -1,134 +0,0 @@-// @ts-nocheck-/**- * Canonical "agent review" E2E flow.- *- * Goal: one deterministic, mock-backed path through onboarding + the privacy- * settings panel that produces a readable artifact trail on disk so coding- * agents can:- * - launch the app into a known state,- * - navigate via automation,- * - inspect screenshots + page source at each checkpoint,- * - inspect mock backend request evidence.- *- * See docs/gitbooks/en/developing/agent-observability.md for how artifacts are laid out.- *- * This spec intentionally keeps assertions loose: its primary contract is- * "the flow reaches each checkpoint and captures artifacts", not a strict- * UI assertion — we already have login-flow.spec.ts for that.- */-import { waitForApp, waitForAppReady, waitForAuthBootstrap } from '../helpers/app-helpers';-import { captureCheckpoint, getArtifactDir, saveMockRequestLog } from '../helpers/artifacts';-import { triggerAuthDeepLink } from '../helpers/deep-link-helpers';-import {- clickText,- textExists,- waitForWebView,- waitForWindowVisible,-} from '../helpers/element-helpers';-import {- clearRequestLog,- getRequestLog,- resetMockBehavior,- startMockServer,- stopMockServer,-} from '../mock-server';--async function tryClick(text: string, timeout = 5_000): Promise<boolean> {- if (!(await textExists(text))) return false;- try {- await clickText(text, timeout);- return true;- } catch {- return false;- }-}--async function waitForAny(texts: string[], timeout = 10_000): Promise<string | null> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- for (const t of texts) {- if (await textExists(t)) return t;- }- await browser.pause(500);- }- return null;-}--describe('Agent review — canonical onboarding + privacy flow', () => {- before(async function beforeSuite() {- this.timeout(90_000);- // Force label so the run dir is predictable: "<ts>-agent-review".- process.env.E2E_ARTIFACT_LABEL = process.env.E2E_ARTIFACT_LABEL || 'agent-review';- getArtifactDir();-- await startMockServer();- await waitForApp();- clearRequestLog();- });-- after(async () => {- resetMockBehavior();- await stopMockServer();-- console.log(`[agent-review] artifacts: ${getArtifactDir()}`);- });-- it('01 launches and reaches welcome', async function () {- this.timeout(90_000);- await triggerAuthDeepLink('e2e-agent-review-token');- await waitForWindowVisible(25_000);- await waitForWebView(15_000);- await waitForAppReady(15_000);- await waitForAuthBootstrap(15_000);-- await waitForAny(['Welcome', 'Continue', "Let's Start", 'Home'], 15_000);- await captureCheckpoint('welcome');- saveMockRequestLog('after-welcome', getRequestLog());- });-- it('02 advances past welcome step', async () => {- const clicked =- (await tryClick("Let's Start")) || (await tryClick('Continue')) || (await tryClick('Skip'));-- console.log(`[agent-review] welcome advance clicked=${clicked}`);- await browser.pause(2_000);- await captureCheckpoint('post-welcome');- });-- it('03 walks remaining onboarding steps or lands on home', async () => {- // Referral- if (await textExists('Referral code')) {- await tryClick('Skip for now');- await browser.pause(1_500);- }- // Skills- if (await textExists('Connect Gmail')) {- await tryClick('Skip for Now');- await browser.pause(2_000);- }- // Context gathering (may auto-skip)- if (await textExists('Context')) {- await tryClick('Continue');- await browser.pause(1_500);- }-- await waitForAny(['Home', 'Skills', 'Conversations', 'Settings'], 15_000);- await captureCheckpoint('post-onboarding');- saveMockRequestLog('after-onboarding', getRequestLog());- });-- it('04 opens settings privacy panel', async () => {- // Navigate via hash route — works on tauri-driver and Mac2 WebView.- try {- await browser.execute(() => {- window.location.hash = '#/settings/privacy';- });- } catch {- // Non-fatal: if hash nav is unavailable, we still capture what we see.- }- await browser.pause(2_000);- await waitForAny(['Privacy', 'Analytics'], 10_000);- await captureCheckpoint('privacy-panel');- saveMockRequestLog('after-privacy', getRequestLog());- });-});diff --git a/app/test/e2e/specs/chat-harness-scroll-render.spec.ts b/app/test/e2e/specs/chat-harness-scroll-render.spec.tsdeleted file mode 100644index 5b81849835..0000000000--- a/app/test/e2e/specs/chat-harness-scroll-render.spec.ts+++ /dev/null@@ -1,280 +0,0 @@-// @ts-nocheck-/**- * Chat harness — scroll behaviour + markdown rendering.- *- * Two related properties on the same chat surface:- *- * 1. Scroll: the assistant-ui thread viewport- * (`[data-slot="aui_thread-viewport"]`, `components/assistant-ui/thread.tsx`)- * follows the bottom through the native assistant-ui viewport.- * After several messages, the container's `scrollTop` must sit- * within a small margin of `scrollHeight - clientHeight`.- * When the user manually scrolls UP, the auto-stick releases- * (so we don't yank them away from the message they're reading).- *- * 2. Markdown rendering: the assistant-ui message renders assistant- * content through its markdown renderer. Bold, code blocks- * and links must produce the right DOM tags (`<strong>`, `<pre>`,- * `<code>`, `<a>`).- *- * We script the mock LLM to reply with a markdown blob containing all- * three constructs at once, and use the same exchange to fill the- * thread for the scroll asserts.- */-import { waitForApp } from '../helpers/app-helpers';-import {- chatMounted,- clickByTitle,- clickSend,- typeIntoComposer,- waitForSocketConnected,-} from '../helpers/chat-harness';-import { textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { setMockBehavior, startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-chat-harness-scroll-render';--const CANARY_BOLD = 'BOLD-CANARY-22ff';-const CANARY_CODE = 'CODE-CANARY-93b1';-const LINK_URL = 'https://example.com/canary';--// Lots of message lines so the column actually has overflow.-const FILLER_LINES = Array.from(- { length: 80 },- (_, i) => `Filler line ${i + 1} — autogenerated to grow the scroll column.`-);--const STREAM_SCRIPT = [- ...FILLER_LINES.map(line => ({ text: line + '\n', delayMs: 5 })),- // Keep the markdown constructs in separate deltas. This reflects a real- // streamed response and gives the renderer a turn to reconcile each block- // before the terminal SSE event closes the stream.- { text: `\n**${CANARY_BOLD}** is bold.\n\n`, delayMs: 30 },- // The harness protects fenced blocks while it scans streamed narration for- // legacy tool-call dialects. An indented Markdown block exercises the same- // rendered <pre><code> contract without entering that protected path.- { text: ` ${CANARY_CODE}\n line 2\n\n`, delayMs: 30 },- { text: `Visit [the docs](${LINK_URL}) for more.`, delayMs: 30 },- { finish: 'stop', delayMs: 30 },-];--async function scrollMetrics(): Promise<{- scrollTop: number;- scrollHeight: number;- clientHeight: number;- found: boolean;-}> {- return (await browser.execute(() => {- const messageColumn = document.querySelector(- '[data-slot="aui_thread-viewport"]'- ) as HTMLElement | null;- // Wry can place the overflow owner on a layout ancestor (or the document)- // rather than directly on the viewport. Measure the element that is- // actually scrollable, while preferring the viewport when it owns scroll.- const candidates: HTMLElement[] = [];- for (let el = messageColumn; el; el = el.parentElement) candidates.push(el);- if (document.scrollingElement instanceof HTMLElement)- candidates.push(document.scrollingElement);- // A layout ancestor can be taller than the viewport without owning a- // scrollbar. Treating it as the message scroller produces a false- // negative in Wry, where the document layout may overflow while the- // native webview owns the actual scroll position.- const el =- candidates.find(node => {- const overflowY = getComputedStyle(node).overflowY;- return (- node.scrollHeight > node.clientHeight && (overflowY === 'auto' || overflowY === 'scroll')- );- }) ?? messageColumn;- if (!el) return { scrollTop: 0, scrollHeight: 0, clientHeight: 0, found: false };- return {- scrollTop: el.scrollTop,- scrollHeight: el.scrollHeight,- clientHeight: el.clientHeight,- found: true,- };- })) as { scrollTop: number; scrollHeight: number; clientHeight: number; found: boolean };-}--async function scrollMessageColumn(top: number): Promise<void> {- await browser.execute((y: number) => {- const messageColumn = document.querySelector(- '[data-slot="aui_thread-viewport"]'- ) as HTMLElement | null;- const candidates: HTMLElement[] = [];- for (let node = messageColumn; node; node = node.parentElement) candidates.push(node);- if (document.scrollingElement instanceof HTMLElement)- candidates.push(document.scrollingElement);- const el =- candidates.find(node => {- const overflowY = getComputedStyle(node).overflowY;- return (- node.scrollHeight > node.clientHeight && (overflowY === 'auto' || overflowY === 'scroll')- );- }) ?? messageColumn;- if (el) el.scrollTo({ top: y, behavior: 'auto' });- }, top);-}--describe('Chat harness — scroll + markdown render', () => {- before(async function beforeSuite() {- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);-- setMockBehavior('llmStreamScript', JSON.stringify(STREAM_SCRIPT));- setMockBehavior('llmStreamChunkDelayMs', '5');- });-- after(async () => {- setMockBehavior('llmStreamScript', '');- setMockBehavior('llmStreamChunkDelayMs', '');- await stopMockServer();- });-- // One `it` covers stream → markdown render → scroll-anchor → scroll-up- // release because all four assertions are facts about the SAME chat- // exchange. Splitting them into separate Mocha tests would make each- // case rely on state produced by the previous one — a fragile shape- // CodeRabbit flagged. Keeping the asserts together also keeps the- // failure-mode obvious: if streaming dies, no later check executes.- it('streams long markdown, renders it, auto-anchors to bottom, releases on scroll-up', async function () {- this.timeout(90_000);- await navigateViaHash('/chat');- await browser.waitUntil(async () => await chatMounted(), {- timeout: 15_000,- timeoutMsg: 'Conversations did not mount',- });- expect(await clickByTitle('New thread', 8_000)).toBe(true);-- await typeIntoComposer('Reply with the markdown sample please.');- const socketReady = await waitForSocketConnected(30_000);- if (!socketReady) {- console.warn(- '[chat-harness-scroll-render] socket did not connect within 30 s — send may fail'- );- }- expect(- await browser.waitUntil(async () => await clickSend(), {- timeout: 5_000,- timeoutMsg: 'Send button never enabled',- })- ).toBe(true);-- // ── 1. Stream completes: both canaries arrive ──────────────────- await browser.waitUntil(async () => await textExists(CANARY_BOLD), {- timeout: 40_000,- timeoutMsg: 'bold canary never landed',- });- try {- await browser.waitUntil(async () => await textExists(CANARY_CODE), {- timeout: 20_000,- timeoutMsg: 'code canary never landed',- });- } catch (error) {- console.log(- '[indented-code-state]',- await browser.execute(canary => {- const state = (- window as unknown as {- __OPENHUMAN_STORE__?: {- getState: () => {- thread?: { messages?: { content: string }[] };- chatRuntime?: { streamingAssistantByThread?: Record<string, unknown> };- };- };- }- ).__OPENHUMAN_STORE__?.getState();- return {- storedCanary:- state?.thread?.messages?.some(message => message.content.includes(canary)) ?? false,- streamingCanary: JSON.stringify(- state?.chatRuntime?.streamingAssistantByThread ?? {}- ).includes(canary),- codeText: document.querySelector('pre code')?.textContent ?? null,- };- }, CANARY_CODE)- );- throw error;- }-- // ── 2. Markdown renders to the expected DOM tags ───────────────- let tags = { hasBold: false, hasCode: false, hasLink: false };- await browser.waitUntil(- async () => {- tags = await browser.execute(- (boldCanary: string, codeCanary: string, linkUrl: string) => {- const strongs = Array.from(document.querySelectorAll('strong')).map(- s => s.textContent ?? ''- );- const codes = Array.from(document.querySelectorAll('pre code, pre')).map(- c => c.textContent ?? ''- );- const anchors = Array.from(document.querySelectorAll('a[href]')).map(a => ({- href: (a as HTMLAnchorElement).getAttribute('href') ?? '',- text: a.textContent ?? '',- }));- return {- hasBold: strongs.some(t => t.includes(boldCanary)),- hasCode: codes.some(t => t.includes(codeCanary)),- hasLink: anchors.some(a => a.href === linkUrl),- };- },- CANARY_BOLD,- CANARY_CODE,- LINK_URL- );- return tags.hasBold && tags.hasCode && tags.hasLink;- },- { timeout: 10_000, timeoutMsg: 'markdown tags never rendered after stream completion' }- );- expect(tags.hasBold).toBe(true);- expect(tags.hasCode).toBe(true);- expect(tags.hasLink).toBe(true);-- // ── 3. Auto-scroll anchored to the bottom after the stream ─────- // (within 40 px to absorb sub-pixel layout drift)- const overflowExposed = await browser- .waitUntil(- async () => {- const metrics = await scrollMetrics();- if (!metrics.found) return false;- return metrics.scrollHeight - metrics.clientHeight > 120;- },- { timeout: 10_000, timeoutMsg: 'chat messages scroll container never overflowed enough' }- )- .catch(() => false);- // On Linux Wry, the native webview can own the scrollbar without exposing- // its scroll metrics to WebDriver. The streamed markdown above remains a- // real end-to-end assertion; skip only the geometry-specific portion when- // the driver cannot identify an overflow owner.- if (!overflowExposed) {- console.warn(- '[chat-harness-scroll-render] WebDriver did not expose an overflow owner; skipping scroll geometry assertions'- );- return;- }- const atBottom = await scrollMetrics();- console.log(- `[chat-harness-scroll-render] bottom metrics: scrollTop=${atBottom.scrollTop}, scrollHeight=${atBottom.scrollHeight}, clientHeight=${atBottom.clientHeight}`- );- expect(atBottom.scrollHeight).toBeGreaterThan(atBottom.clientHeight);- expect(atBottom.scrollHeight - (atBottom.scrollTop + atBottom.clientHeight)).toBeLessThan(40);-- // ── 4. Manual scroll-up releases the auto-stick ────────────────- const targetTop = Math.max(0, atBottom.scrollTop - Math.floor(atBottom.clientHeight / 2));- await scrollMessageColumn(targetTop);- await browser.pause(500); // let the stick hook react- const afterScrollUp = await scrollMetrics();- console.log(- `[chat-harness-scroll-render] after manual scroll: scrollTop=${afterScrollUp.scrollTop}, scrollHeight=${afterScrollUp.scrollHeight}, clientHeight=${afterScrollUp.clientHeight}, targetTop=${targetTop}`- );- expect(Math.abs(afterScrollUp.scrollTop - targetTop)).toBeLessThan(40);- expect(- afterScrollUp.scrollHeight - (afterScrollUp.scrollTop + afterScrollUp.clientHeight)- ).toBeGreaterThan(50);- });-});diff --git a/app/test/e2e/specs/chat-tool-call-flow.spec.ts b/app/test/e2e/specs/chat-tool-call-flow.spec.tsdeleted file mode 100644index afeca92e48..0000000000--- a/app/test/e2e/specs/chat-tool-call-flow.spec.ts+++ /dev/null@@ -1,153 +0,0 @@-// @ts-nocheck-/**- * Chat tool-call lifecycle — end-to-end.- *- * Exercises the complete single-round tool-call flow:- * - LLM emits a `tool_calls` response (web_fetch)- * - Core dispatches the tool, then calls the LLM again with the result- * - Final answer streams back and renders in the DOM- * - Tool timeline entry appears while the tool is in flight- * * */-import { waitForApp } from '../helpers/app-helpers';-import {- chatMounted,- clickByTitle,- clickSend,- getSelectedThreadId,- typeIntoComposer,- waitForSocketConnected,-} from '../helpers/chat-harness';-import { clickToolGroupTrigger, textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { clearRequestLog, setMockBehavior, startMockServer, stopMockServer } from '../mock-server';--const LOG_PREFIX = '[chat-tool-call-flow]';-const USER_ID = 'e2e-chat-tool-call-flow';-const PROMPT = 'Fetch the contents of https://example.com for me.';-const CANARY_FINAL = 'canary-tool-call-fetched-a1b2c3';--// Two forced responses: first the tool_calls emission, then the final answer-// after the core feeds the tool result back to the LLM.-const FORCED_RESPONSES = [- {- content: '',- toolCalls: [- {- id: 'call_web_fetch_1',- name: 'web_fetch',- arguments: JSON.stringify({ url: 'https://example.com' }),- },- ],- },- { content: `Here is the fetched content: ${CANARY_FINAL}` },-];--async function renderedToolNames(): Promise<string[]> {- return (await browser.execute(() =>- Array.from(document.querySelectorAll<HTMLElement>('[data-testid="assistant-ui-tool-call"]'))- .map(card => card.getAttribute('data-tool-name'))- .filter((name): name is string => Boolean(name))- )) as string[];-}--async function activityGroupExpanded(): Promise<boolean> {- return browser.execute(() => {- const trigger = document.querySelector<HTMLElement>(- '[data-slot="tool-group-root"] [data-slot="tool-group-trigger"]'- );- return trigger?.getAttribute('aria-expanded') === 'true';- });-}--describe('Chat tool-call lifecycle', () => {- before(async () => {- console.log(`${LOG_PREFIX} Starting mock server and resetting app`);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);-- setMockBehavior('llmForcedResponses', JSON.stringify(FORCED_RESPONSES));- setMockBehavior('llmStreamChunkDelayMs', '10');- clearRequestLog();- console.log(`${LOG_PREFIX} Setup complete — forced responses configured`);- });-- after(async () => {- setMockBehavior('llmForcedResponses', '');- setMockBehavior('llmStreamChunkDelayMs', '');- await stopMockServer();- console.log(`${LOG_PREFIX} Teardown complete`);- });-- it('T1.1 — rendered assistant UI tool card appears during the turn', async () => {- console.log(`${LOG_PREFIX} T1.1: navigating to /chat and opening new thread`);- await navigateViaHash('/chat');- await browser.waitUntil(async () => await chatMounted(), {- timeout: 15_000,- timeoutMsg: 'Conversations panel did not mount',- });- expect(await clickByTitle('New thread', 8_000)).toBe(true);-- const threadId = (await browser.waitUntil(async () => await getSelectedThreadId(), {- timeout: 8_000,- timeoutMsg: 'thread.selectedThreadId never populated',- })) as string;- expect(typeof threadId).toBe('string');- console.log(`${LOG_PREFIX} T1.1: thread created: ${threadId}`);-- await typeIntoComposer(PROMPT);- const socketReady = await waitForSocketConnected(30_000);- if (!socketReady) {- console.warn('[chat-tool-call-flow] socket did not connect within 30 s — send may fail');- }- expect(- await browser.waitUntil(async () => await clickSend(), {- timeout: 5_000,- timeoutMsg: 'Send button never enabled',- })- ).toBe(true);-- await browser.waitUntil(async () => (await renderedToolNames()).includes('web_fetch'), {- timeout: 45_000,- interval: 100,- timeoutMsg: 'Rendered web_fetch tool card never appeared',- });- expect(await renderedToolNames()).toContain('web_fetch');- });-- it('T1.2 — rendered assistant UI tool card identifies the web fetch', async () => {- console.log(`${LOG_PREFIX} T1.2: checking rendered tool card`);- await browser.waitUntil(async () => await textExists(CANARY_FINAL), {- timeout: 40_000,- timeoutMsg: 'final answer did not render before inspecting the settled tool timeline',- });- if (!(await activityGroupExpanded())) {- await clickToolGroupTrigger(0, '1 tool call');- }- await browser.waitUntil(async () => await activityGroupExpanded(), {- timeout: 10_000,- timeoutMsg: 'assistant activity group did not expand to show the rendered tool card',- });- const cards = await browser.execute(() =>- Array.from(- document.querySelectorAll<HTMLElement>(- '[data-slot="tool-group-root"] [data-testid="assistant-ui-tool-call"]'- )- ).map(card => ({ name: card.getAttribute('data-tool-name'), text: card.innerText }))- );- expect(cards).toHaveLength(1);- expect(cards[0].name).toBe('web_fetch');- expect(cards[0].text).toContain('Read webpage');- expect(cards[0].text).toContain('example.com');- });-- it('T1.3 — final answer with canary text renders in the DOM', async () => {- console.log(`${LOG_PREFIX} T1.3: waiting for canary text in DOM`);- await browser.waitUntil(async () => await textExists(CANARY_FINAL), {- timeout: 40_000,- timeoutMsg: `final answer "${CANARY_FINAL}" never rendered in the chat`,- });- console.log(`${LOG_PREFIX} T1.3: passed — canary visible`);- });-});diff --git a/app/test/e2e/specs/chat-tool-error-recovery.spec.ts b/app/test/e2e/specs/chat-tool-error-recovery.spec.tsdeleted file mode 100644index ce03cb70b6..0000000000--- a/app/test/e2e/specs/chat-tool-error-recovery.spec.ts+++ /dev/null@@ -1,214 +0,0 @@-// @ts-nocheck-/**- * Chat tool-error recovery — stream errors mid-response.- *- * Uses `llmStreamScript` with an error entry to simulate an upstream- * LLM failure mid-stream, then verifies:- *- * T3.1 — error state is surfaced in the chat (error message or retry)- * T3.2 — composer (textarea + send button) re-enables after error- * T3.3 — IN_FLIGHT map clears on error- * T3.4 — a new message can be typed and sent after error (recovery)- */-import { waitForApp } from '../helpers/app-helpers';-import {- chatMounted,- clickByTitle,- clickSend,- getSelectedThreadId,- typeIntoComposer,- waitForSocketConnected,-} from '../helpers/chat-harness';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { clearRequestLog, setMockBehavior, startMockServer, stopMockServer } from '../mock-server';--const LOG_PREFIX = '[chat-tool-error-recovery]';-const USER_ID = 'e2e-chat-tool-error-recovery';-const TIMEOUT = 20_000;--// First turn: stream partial text then inject an error.-const ERROR_STREAM_SCRIPT = JSON.stringify([- { text: 'Starting to answer', delayMs: 30 },- // Keep the partial chunk visible long enough for the desktop renderer to- // paint it before the injected terminal error clears the streaming state.- { error: 'upstream LLM error', delayMs: 1_000 },-]);--// Second turn: a clean response for the recovery assertion.-const RECOVERY_CANARY = 'canary-recovery-7g8h9i';-const RECOVERY_FORCED = [{ content: `Recovery successful: ${RECOVERY_CANARY}` }];--describe('Chat tool-error recovery', () => {- let threadId: string;-- before(async () => {- console.log(`${LOG_PREFIX} Starting mock server and resetting app`);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- clearRequestLog();- console.log(`${LOG_PREFIX} Setup complete`);- });-- after(async () => {- setMockBehavior('llmStreamScript', '');- setMockBehavior('llmForcedResponses', '');- await stopMockServer();- console.log(`${LOG_PREFIX} Teardown complete`);- });-- it('T3.1 — error state surfaces in chat after stream error', async function () {- // macOS needs extra headroom for reset/navigation plus the two streaming- // observation windows; the default 30s budget can expire mid-assertion.- this.timeout(60_000);- console.log(`${LOG_PREFIX} T3.1: configuring error stream script`);- setMockBehavior('llmStreamScript', ERROR_STREAM_SCRIPT);-- await navigateViaHash('/chat');- await browser.waitUntil(async () => await chatMounted(), {- timeout: 15_000,- timeoutMsg: 'Conversations panel did not mount',- });- expect(await clickByTitle('New thread', 8_000)).toBe(true);-- threadId = (await browser.waitUntil(async () => await getSelectedThreadId(), {- timeout: 8_000,- timeoutMsg: 'thread.selectedThreadId never populated',- })) as string;- expect(typeof threadId).toBe('string');- console.log(`${LOG_PREFIX} T3.1: thread created: ${threadId}`);-- await typeIntoComposer('Tell me something important.');- const socketReady = await waitForSocketConnected(30_000);- if (!socketReady) {- console.warn('[chat-tool-error-recovery] socket did not connect within 30 s — send may fail');- }- expect(- await browser.waitUntil(async () => await clickSend(), {- timeout: 5_000,- timeoutMsg: 'Send button never enabled',- })- ).toBe(true);-- // After the error is injected, the UI should surface an error indicator.- // Do not require the partial chunk to remain visible first: the terminal- // error can replace that transient render before WebDriver samples it.- // The durable error/lifecycle state proves that the streamed turn ran.- // The exact text varies by implementation, so poll broadly.- const errorIndicators = [- 'error',- 'Error',- 'failed',- 'Failed',- 'retry',- 'Retry',- 'Something went wrong',- ];- let sawError = false;- const deadline = Date.now() + TIMEOUT;- while (Date.now() < deadline) {- for (const indicator of errorIndicators) {- if (await textExists(indicator)) {- sawError = true;- console.log(`${LOG_PREFIX} T3.1: error indicator found: "${indicator}"`);- break;- }- }- if (sawError) break;-- // Also check Redux for a lifecycle state that indicates error/interrupted.- const lifecycle = await browser.execute((tid: string) => {- const winAny = window as unknown as { __OPENHUMAN_STORE__?: { getState: () => unknown } };- const state = winAny.__OPENHUMAN_STORE__?.getState() as- | { chatRuntime?: { inferenceTurnLifecycleByThread?: Record<string, string | null> } }- | undefined;- return state?.chatRuntime?.inferenceTurnLifecycleByThread?.[tid] ?? null;- }, threadId);-- if (lifecycle === 'interrupted' || lifecycle === null) {- // null means the lifecycle entry was cleared (turn finished / errored out).- console.log(`${LOG_PREFIX} T3.1: lifecycle state after error: ${lifecycle}`);- sawError = true;- break;- }-- await browser.pause(300);- }- expect(sawError).toBe(true);- console.log(`${LOG_PREFIX} T3.1: passed`);- });-- it('T3.2 — composer re-enables after error', async () => {- console.log(`${LOG_PREFIX} T3.2: checking composer re-enables`);- // Clear the error stream so the composer is no longer blocked.- setMockBehavior('llmStreamScript', '');-- // Wait for the send button or textarea to become active again.- let composerEnabled = false;- const deadline = Date.now() + TIMEOUT;- while (Date.now() < deadline) {- composerEnabled = await browser.execute(() => {- const btn = document.querySelector(- 'button[aria-label="Send message"]'- ) as HTMLButtonElement | null;- const ta = document.querySelector(- 'textarea[placeholder="Send a message..."], [contenteditable="true"][role="textbox"][aria-label="Message input"]'- ) as HTMLTextAreaElement | HTMLElement | null;- return (- (btn !== null && !btn.disabled) ||- (ta !== null &&- !(ta as HTMLTextAreaElement).disabled &&- ta.getAttribute('aria-disabled') !== 'true')- );- });- if (composerEnabled) {- console.log(`${LOG_PREFIX} T3.2: composer re-enabled`);- break;- }- await browser.pause(400);- }- expect(composerEnabled).toBe(true);- console.log(`${LOG_PREFIX} T3.2: passed`);- });-- it('T3.3 — IN_FLIGHT map clears on error', async () => {- console.log(`${LOG_PREFIX} T3.3: verifying IN_FLIGHT cleared`);- await browser.waitUntil(- async () => {- const snap = await callOpenhumanRpc<{ result: { entries: Array<{ key: string }> } }>(- 'openhuman.test_support_in_flight_chats',- {}- );- if (!snap.ok) return false;- const entries = snap.result?.result?.entries ?? [];- const stillRunning = entries.some(e => e.key.endsWith(`::${threadId}`));- return !stillRunning;- },- { timeout: TIMEOUT, timeoutMsg: 'IN_FLIGHT never cleared after stream error' }- );- console.log(`${LOG_PREFIX} T3.3: passed — IN_FLIGHT cleared`);- });-- it('T3.4 — new message can be typed and sent after error (recovery)', async () => {- console.log(`${LOG_PREFIX} T3.4: sending recovery message`);- setMockBehavior('llmForcedResponses', JSON.stringify(RECOVERY_FORCED));- setMockBehavior('llmStreamChunkDelayMs', '10');-- await typeIntoComposer('Please try again with a fresh answer.');- expect(- await browser.waitUntil(async () => await clickSend(), {- timeout: TIMEOUT,- timeoutMsg: 'Send button never became active for recovery message',- })- ).toBe(true);-- await browser.waitUntil(async () => await textExists(RECOVERY_CANARY), {- timeout: 30_000,- timeoutMsg: `recovery canary "${RECOVERY_CANARY}" never rendered after error recovery`,- });- console.log(`${LOG_PREFIX} T3.4: passed — recovery canary visible`);- });-});diff --git a/app/test/e2e/specs/composio-triggers-flow.spec.ts b/app/test/e2e/specs/composio-triggers-flow.spec.tsdeleted file mode 100644index 3a4ac8070e..0000000000--- a/app/test/e2e/specs/composio-triggers-flow.spec.ts+++ /dev/null@@ -1,97 +0,0 @@-/**- * End-to-end: client-side Composio trigger toggles (PR for backend #671).- *- * Opens the Composio connection modal against the shared mock backend and- * checks that available and active triggers render in the- * Composio connection modal and asserts the Triggers section renders- * the expected toggle for an ACTIVE Gmail connection.- *- * The mock backend (`scripts/mock-api-core.mjs`) seeds:- * - one ACTIVE Gmail connection (`c1`)- * - one available trigger (`GMAIL_NEW_GMAIL_MESSAGE`)- * - an empty active-trigger list that mutates as enable/disable run- *- * Trigger list and mutation behavior belongs to Composio Rust tests. This spec- * owns the rendered Triggers section.- */-import { waitForApp } from '../helpers/app-helpers';-import { textExists, waitForText } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateToSkills } from '../helpers/shared-flows';-import { clearRequestLog, setMockBehavior, startMockServer, stopMockServer } from '../mock-server';--describe('Composio trigger section UI', () => {- before(async function () {- // waitForApp() + resetApp() can exceed the default 30s Mocha hook budget.- this.timeout(90_000);- await startMockServer();- setMockBehavior(- 'composioConnections',- JSON.stringify([{ id: 'c1', toolkit: 'gmail', status: 'ACTIVE' }])- );- setMockBehavior(- 'composioAvailableTriggers',- JSON.stringify([- { slug: 'GMAIL_NEW_GMAIL_MESSAGE', scope: 'static' },- { slug: 'SLACK_NEW_MESSAGE', scope: 'static', requiredConfigKeys: ['channel'] },- ])- );- setMockBehavior('composioActiveTriggers', JSON.stringify([]));- await waitForApp();- await resetApp('e2e-composio-triggers-token');- clearRequestLog();- });-- after(async () => {- await stopMockServer();- });-- it('Triggers section renders in the Composio modal for an ACTIVE connection', async () => {- // Seed one active trigger so the modal shows both the enabled and- // available rows when it loads.- setMockBehavior(- 'composioActiveTriggers',- JSON.stringify([- { id: 'ti-seeded', slug: 'GMAIL_NEW_GMAIL_MESSAGE', toolkit: 'gmail', connectionId: 'c1' },- ])- );-- await navigateToSkills();-- await waitForText('Integrations', 10_000);- await waitForText('Gmail', 10_000);-- const opened = await browser.execute(() => {- const buttons = Array.from(document.querySelectorAll<HTMLButtonElement>('button'));- const gmailManage = buttons.find(button => {- const label = button.getAttribute('aria-label') ?? '';- return /Gmail/i.test(label) && /Manage/i.test(label);- });- if (!gmailManage) return false;- ['mousedown', 'mouseup', 'click'].forEach(type => {- gmailManage.dispatchEvent(- new MouseEvent(type, { bubbles: true, cancelable: true, view: window, button: 0 })- );- });- return true;- });- if (!opened) {- throw new Error('Could not find connected Gmail Manage button on Skills page');- }-- await waitForText('Triggers', 10_000);- const togglesVisible = await browser.waitUntil(- async () =>- Boolean(- await browser.execute(- () => document.querySelector('[data-testid="trigger-toggles"]') !== null- )- ),- { timeout: 10_000, interval: 500, timeoutMsg: 'trigger toggles did not render' }- );- expect(togglesVisible).toBe(true);- // formatTriggerLabel('GMAIL_NEW_GMAIL_MESSAGE', { toolkit: 'gmail' }) strips- // the leading 'Gmail' prefix, producing "New Gmail Message".- expect(await textExists('New Gmail Message')).toBe(true);- });-});diff --git a/app/test/e2e/specs/connector-gmail-composio.spec.ts b/app/test/e2e/specs/connector-gmail-composio.spec.tsdeleted file mode 100644index c6d6f50290..0000000000--- a/app/test/e2e/specs/connector-gmail-composio.spec.ts+++ /dev/null@@ -1,86 +0,0 @@-/**- * E2E: Gmail (Composio) connector-card and connection-state UI.- * Covers the connector card and its connection states.- */-import { waitForApp } from '../helpers/app-helpers';-import {- assertConnectorCardVisible,- assertModalPhase,- assertSessionNotNuked,- openConnectorModal,- seedComposioConnection,- seedComposioToolkits,-} from '../helpers/composio-helpers';-import {- textExists,- waitForText,- waitForWebView,- waitForWindowVisible,-} from '../helpers/element-helpers';-import { triggerAuthLoopbackBypass } from '../helpers/loopback-auth-helpers';-import { completeOnboardingIfVisible, navigateToSkills } from '../helpers/shared-flows';-import {- clearRequestLog,- resetMockBehavior,- startMockServer,- stopMockServer,-} from '../mock-server';--const LOG = '[ConnectorGmailComposioE2E]';-const CONNECTOR_NAME = 'Gmail';-const TOOLKIT_SLUG = 'gmail';-const AUTH_TOKEN = 'e2e-connector-gmail-composio-token';--describe('Gmail (Composio) connector flow', () => {- before(async function () {- this.timeout(90_000);- await startMockServer();- seedComposioToolkits([TOOLKIT_SLUG]);- seedComposioConnection(TOOLKIT_SLUG, 'ACTIVE', 'c-gmail-1');- await waitForApp();- clearRequestLog();- await triggerAuthLoopbackBypass(AUTH_TOKEN);- await waitForWindowVisible(25_000);- await waitForWebView(15_000);- await completeOnboardingIfVisible(LOG);- });-- after(async () => {- await stopMockServer();- });-- afterEach(async () => {- resetMockBehavior();- seedComposioToolkits([TOOLKIT_SLUG]);- seedComposioConnection(TOOLKIT_SLUG, 'ACTIVE', 'c-gmail-1');- });-- it('card is visible and selectable', async function () {- this.timeout(60_000);- await assertConnectorCardVisible(CONNECTOR_NAME);- console.log(`${LOG} PASS: card visible`);- });-- it('failed connection shows error state, not blank screen', async function () {- this.timeout(60_000);- seedComposioConnection(TOOLKIT_SLUG, 'FAILED', 'c-gmail-fail');- await navigateToSkills();- await waitForText(CONNECTOR_NAME, 10_000);- const alive = await textExists(CONNECTOR_NAME);- expect(alive).toBe(true);- await assertSessionNotNuked();- console.log(`${LOG} PASS: failed state does not blank screen`);- });-- it('expired auth shows Reconnect button and does not log user out', async function () {- this.timeout(60_000);- seedComposioConnection(TOOLKIT_SLUG, 'EXPIRED', 'c-gmail-expired');- await navigateToSkills();- await waitForText(CONNECTOR_NAME, 10_000);- const modal = await openConnectorModal(CONNECTOR_NAME, 15_000, 'Auth expired');- expect(modal).toBeTruthy();- await assertModalPhase('expired', CONNECTOR_NAME);- await assertSessionNotNuked();- console.log(`${LOG} PASS: expired auth does not log user out`);- });-});diff --git a/app/test/e2e/specs/core-port-conflict-recovery.spec.ts b/app/test/e2e/specs/core-port-conflict-recovery.spec.tsdeleted file mode 100644index 8bfd077cf4..0000000000--- a/app/test/e2e/specs/core-port-conflict-recovery.spec.ts+++ /dev/null@@ -1,91 +0,0 @@-// @ts-nocheck-/**- * E2E spec: core port conflict recovery- *- * Covers:- * - When port 7788 (default OPENHUMAN_CORE_PORT) is already bound by an- * unrelated process before the desktop app starts, the embedded in-process- * core either binds a fallback port and continues normally, OR surfaces a- * clear conflict message so the user can diagnose the issue.- * - A second app instance while the first already owns port 7788 must not- * silently produce 401s or version drift — it should either attach to the- * running core or surface a clear error.- *- * Gap note (port fallback path):- * The desktop app's CoreProcessHandle selects a fallback port when the- * preferred port is occupied by a non-OpenHuman listener- * (see crates/openhuman-app/src/core_process.rs, `identify_listener` +- * `is_expected_port_clash`). The fallback port is communicated back via- * `EmbeddedReadySignal.fallback_from`. The UI does not currently render a- * user-visible "port conflict" dialog — the app continues working on the- * fallback port. As a result, this spec cannot assert a specific conflict- * dialog text; instead it asserts that the app reaches a usable state (home- * screen or onboarding) even under a port conflict, which proves the fallback- * path engaged.- *- * A separate dialog assertion is omitted because a second app instance uses- * the embedded core's fallback port and the shipped UI does not display a- * conflict banner. The startup-integrity assertion below covers the behavior- * this E2E harness can observe.- */-import { waitForApp } from '../helpers/app-helpers';-import { textExists } from '../helpers/element-helpers';-import { startMockServer, stopMockServer } from '../mock-server';--const DEFAULT_CORE_PORT = Number(process.env.OPENHUMAN_CORE_PORT ?? 7788);--function stepLog(message: string, context?: unknown): void {- const stamp = new Date().toISOString();- if (context === undefined) {- console.log(`[CorePortConflictE2E][${stamp}] ${message}`);- return;- }- console.log(`[CorePortConflictE2E][${stamp}] ${message}`, JSON.stringify(context, null, 2));-}--async function waitForHome(timeout = 25_000): Promise<boolean> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- if (await textExists('Ask your assistant anything')) return true;- if (await textExists('Your device is connected')) return true;- if (await textExists('Welcome')) return true;- if (await textExists('Get Started')) return true;- await browser.pause(700);- }- return false;-}--describe('Core port conflict recovery', () => {- before(async () => {- stepLog('starting mock server');- await startMockServer();- });-- after(async () => {- stepLog('stopping mock server');- await stopMockServer();- });-- // NOTE on scope: the Tauri harness boots the app before any spec runs, so- // we cannot pre-bind DEFAULT_CORE_PORT before the embedded core attempts to- // listen. This case therefore validates startup integrity (core started and- // app reached a usable screen) rather than the port-conflict fallback branch.- // The conflict path (bind port → trigger restart → assert fallback) is- // exercised in 4.2.2 once the UI dialog for that scenario is implemented.- it('4.2.1 — app reaches usable state on normal startup (startup-integrity check)', async () => {- stepLog('app is already running — verify it reached usable state', {- defaultCorePort: DEFAULT_CORE_PORT,- });-- // The Tauri app has already been launched by the test harness before- // this spec runs. We cannot pre-bind the port before app launch from- // within a spec (the app boots earlier). This case therefore validates- // the app's normal startup: if the app reached the home/onboarding- // screen without crashing, the embedded core started cleanly.- await waitForApp();-- const onHome = await waitForHome(25_000);- stepLog('app reached usable state', { onHome });- expect(onHome).toBe(true);- });-});diff --git a/app/test/e2e/specs/harness-composio-tool-flow.spec.ts b/app/test/e2e/specs/harness-composio-tool-flow.spec.tsdeleted file mode 100644index ac3f1878e2..0000000000--- a/app/test/e2e/specs/harness-composio-tool-flow.spec.ts+++ /dev/null@@ -1,171 +0,0 @@-// @ts-nocheck-/**- * Harness Composio E2E: one Gmail action renders a user-visible reply.- */-import { waitForApp } from '../helpers/app-helpers';-import {- clickByTitle,- clickSend,- getSelectedThreadId,- typeIntoComposer,- waitForAssistantReplyContaining,- waitForSocketConnected,-} from '../helpers/chat-harness';-import { textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import {- clearRequestLog,- resetMockBehavior,- setMockBehavior,- startMockServer,- stopMockServer,-} from '../mock-server';--const LOG_PREFIX = '[HarnessComposio]';-const USER_ID = 'e2e-harness-composio-tool-flow';--function seedHarnessComposioState(): void {- setMockBehavior('composioToolkits', JSON.stringify(['gmail', 'github', 'linear']));- setMockBehavior(- 'composioConnections',- JSON.stringify([- { id: 'conn-gmail', toolkit: 'gmail', status: 'ACTIVE' },- { id: 'conn-github', toolkit: 'github', status: 'ACTIVE' },- { id: 'conn-linear', toolkit: 'linear', status: 'ACTIVE' },- ])- );-}--// ----------------------------------------------------------------------------// Shared helpers-// -----------------------------------------------------------------------------/** Navigate to /chat, open a fresh thread, wait for the socket, then send a- * message and return. The calling test is responsible for asserting outcomes. */-async function navigateChatAndSend(prompt: string): Promise<void> {- await navigateViaHash('/chat');- await browser.waitUntil(- async () => {- if (await getSelectedThreadId()) return true;- if (await textExists('No messages yet')) return true;- return textExists('How can I help');- },- { timeout: 15_000, timeoutMsg: 'Chat surface did not mount' }- );- // Each scenario is independent. Keeping prior tool-call turns in the same- // conversation makes the last scenario exercise an unrelated, cumulative- // renderer state instead of its own action flow.- const previousThreadId = await getSelectedThreadId();- const clicked =- (await clickByTitle('New thread', 8_000)) ||- (await clickByTitle('New thread (/new)', 3_000)) ||- (await browser.execute(() => {- const btn = Array.from(document.querySelectorAll('button')).find(- button => (button.textContent ?? '').trim() === 'New'- ) as HTMLButtonElement | undefined;- if (!btn) return false;- btn.click();- return true;- }));- expect(clicked).toBe(true);- await browser.waitUntil(- async () => {- const selectedThreadId = await getSelectedThreadId();- return Boolean(selectedThreadId && selectedThreadId !== previousThreadId);- },- { timeout: 8_000, timeoutMsg: 'a fresh thread.selectedThreadId never populated' }- );-- await typeIntoComposer(prompt);- const socketReady = await waitForSocketConnected(30_000);- if (!socketReady) {- console.warn(`${LOG_PREFIX} socket did not connect within 30s — send may fail`);- }- expect(- await browser.waitUntil(async () => await clickSend(), {- timeout: 15_000,- timeoutMsg: 'Send button never enabled',- })- ).toBe(true);- console.log(`${LOG_PREFIX} Sent prompt: "${prompt.slice(0, 60)}..."`);-}--// ----------------------------------------------------------------------------// Suite-// -----------------------------------------------------------------------------describe('Harness — Composio tool-call prompt flow', () => {- before(async function beforeSuite() {- this.timeout(90_000);- console.log(`${LOG_PREFIX} Starting mock server and resetting app`);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- console.log(`${LOG_PREFIX} Suite setup complete`);- });-- after(async () => {- resetMockBehavior();- await stopMockServer();- console.log(`${LOG_PREFIX} Suite teardown complete`);- });-- // ── C1.1 — Gmail GMAIL_GET_MAIL ──────────────────────────────────────────-- it('C1.1 — Gmail GMAIL_GET_MAIL: prompt triggers composio action and final reply cites subject lines', async function () {- this.timeout(120_000);- console.log(`${LOG_PREFIX} C1.1: begin`);-- clearRequestLog();- resetMockBehavior();- seedHarnessComposioState();-- // Canned inbox: 3 messages the mock Composio execute will return.- const GMAIL_MESSAGES = [- { id: 'msg-1', subject: 'Q3 Budget Review', from: '[email protected]' },- { id: 'msg-2', subject: 'Team lunch this Friday', from: '[email protected]' },- { id: 'msg-3', subject: 'Staging deployment failed', from: '[email protected]' },- ];- setMockBehavior(- 'composioExecuteResponse_GMAIL_GET_MAIL',- JSON.stringify({ messages: GMAIL_MESSAGES })- );-- // Two-turn forced response sequence:- // Turn 1 — LLM emits a tool call for GMAIL_GET_MAIL- // Turn 2 — LLM returns a final answer after receiving the tool result- const CANARY = 'canary-gmail-a1b2c3';- const FORCED = [- {- content: '',- toolCalls: [- {- id: 'call_gmail_get_mail_1',- name: 'GMAIL_GET_MAIL',- arguments: JSON.stringify({ max_results: 10 }),- },- ],- },- {- content: `Here are your latest emails: Q3 Budget Review, Team lunch this Friday, Staging deployment failed. ${CANARY}`,- },- ];- setMockBehavior('llmForcedResponses', JSON.stringify(FORCED));- setMockBehavior('llmStreamChunkDelayMs', '10');-- await navigateChatAndSend('check my email');-- // Assert final reply contains the canary + at least one subject line.- await browser.waitUntil(async () => await textExists(CANARY), {- timeout: 60_000,- timeoutMsg: `C1.1: final reply canary "${CANARY}" never appeared`,- });- console.log(`${LOG_PREFIX} C1.1: canary visible — asserting subject lines`);- expect(- await waitForAssistantReplyContaining('Q3 Budget Review', { logPrefix: LOG_PREFIX })- ).toBe(true);-- console.log(`${LOG_PREFIX} C1.1: PASSED`);- });-});diff --git a/app/test/e2e/specs/logout-relogin-onboarding.spec.ts b/app/test/e2e/specs/logout-relogin-onboarding.spec.tsdeleted file mode 100644index 50201b8bb7..0000000000--- a/app/test/e2e/specs/logout-relogin-onboarding.spec.ts+++ /dev/null@@ -1,102 +0,0 @@-// @ts-nocheck-/**- * E2E regression: onboarding overlay after logout -> re-login.- *- * Verifies:- * 1. Initial login can complete onboarding and reach Home.- * 2. Logout returns to the Welcome screen (session is cleared).- * 3. Re-login via the auth deep-link bypass returns to chat without- * restarting onboarding for the same completed account.- *- * Architecture note: auth tokens live in the Rust core (not Redux-persist).- * `applySessionToken` stores the JWT and fires `core-state:session-token-updated`- * immediately after the token exchange, then CoreStateProvider refreshes the- * authoritative user/profile snapshot. Routing now waits for that refreshed- * currentUser before sending incomplete onboarding sessions to /onboarding.- */-import { waitForApp, waitForAppReady, waitForAuthBootstrap } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { hasAppChrome, waitForWebView, waitForWindowVisible } from '../helpers/element-helpers';-import { triggerAuthLoopbackBypass } from '../helpers/loopback-auth-helpers';-import { resetApp } from '../helpers/reset-app';-import {- dismissBootCheckGateIfVisible,- logoutViaSettings,- performFullLogin,-} from '../helpers/shared-flows';-import {- clearRequestLog,- resetMockBehavior,- startMockServer,- stopMockServer,-} from '../mock-server';--describe('Logout -> re-login onboarding state', function () {- // Suite-level timeout — covers all hooks and tests. The full flow- // (resetApp + first login + logout + test_reset + reload + re-login)- // can take 60-90s, well over the default 30s.- this.timeout(180_000);-- before(async () => {- await startMockServer();- await waitForApp();- // Reach Welcome screen first (this spec drives login itself).- await resetApp('e2e-logout-relogin-reset', { skipAuth: true });- clearRequestLog();- resetMockBehavior();- });-- after(async () => {- resetMockBehavior();- await stopMockServer();- });-- it('keeps completed onboarding after logout and re-login', async function () {- const hasChrome = await hasAppChrome();- expect(hasChrome).toBe(true);-- // ── First login: complete onboarding and reach Home ──────────────────────- clearRequestLog();- resetMockBehavior();- await performFullLogin('e2e-logout-relogin-first-token', '[LogoutReLogin]');-- // Let post-onboarding routing guards settle before navigating to Settings.- await browser.pause(2_000);-- // ── Logout ────────────────────────────────────────────────────────────────- await logoutViaSettings('[LogoutReLogin]');- // logoutViaSettings confirms "Welcome" is visible — the session is cleared.-- // Onboarding completion belongs to the user. Re-authenticate the same- // account and verify logout did not send it through setup again.- await browser.execute(() => {- window.location.replace('#/');- window.location.reload();- });- await browser.pause(2_000);- await waitForWindowVisible(15_000);- await waitForWebView(10_000);- await dismissBootCheckGateIfVisible(12_000);-- clearRequestLog();- await triggerAuthLoopbackBypass('e2e-logout-relogin-first-token');- await waitForWindowVisible(25_000);- await waitForWebView(15_000);- await waitForAppReady(15_000);- await waitForAuthBootstrap(15_000);-- await browser.waitUntil(- async () =>- (await browser.execute(() => window.location.hash.startsWith('#/chat'))) as boolean,- { timeout: 30_000, interval: 250, timeoutMsg: 'Re-login did not return to chat' }- );- const onboarding = await callOpenhumanRpc('openhuman.config_get_onboarding_completed', {});- expect(onboarding.ok).toBe(true);- expect(onboarding.result.result).toBe(true);- expect(- await browser.execute(- () => document.querySelector('[data-testid="onboarding-layout"]') !== null- )- ).toBe(false);- });-});diff --git a/app/test/e2e/specs/onboarding-modes.spec.ts b/app/test/e2e/specs/onboarding-modes.spec.tsdeleted file mode 100644index 9828bd0ff2..0000000000--- a/app/test/e2e/specs/onboarding-modes.spec.ts+++ /dev/null@@ -1,164 +0,0 @@-// @ts-nocheck-/**- * E2E coverage for the current onboarding split: self-hosted users configure- * inference/search/vault, while TinyHumans users complete managed setup and go- * straight to chat.- */-import { waitForApp, waitForAppReady, waitForAuthBootstrap } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { waitForWebView, waitForWindowVisible } from '../helpers/element-helpers';-import { triggerAuthLoopbackBypass } from '../helpers/loopback-auth-helpers';-import { resetApp } from '../helpers/reset-app';-import { dismissBootCheckGateIfVisible } from '../helpers/shared-flows';-import {- resetMockBehavior,- setMockBehavior,- startMockServer,- stopMockServer,-} from '../mock-server';--async function clickTestId(testId: string, timeout = 10_000): Promise<boolean> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- const clicked = await browser.execute(id => {- const element = document.querySelector<HTMLElement>(`[data-testid="${id}"]`);- if (!element || (element as HTMLButtonElement).disabled) return false;- element.click();- return true;- }, testId);- if (clicked) return true;- await browser.pause(250);- }- return false;-}--async function hasTestId(testId: string, timeout = 15_000): Promise<boolean> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- if (- await browser.execute(id => document.querySelector(`[data-testid="${id}"]`) !== null, testId)- ) {- return true;- }- await browser.pause(250);- }- return false;-}--async function waitForHash(prefix: string, timeout = 30_000): Promise<boolean> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- if (await browser.execute(value => window.location.hash.startsWith(value), prefix)) return true;- await browser.pause(250);- }- return false;-}--async function onboardingCompleted(): Promise<boolean> {- const response = await callOpenhumanRpc<boolean | { result: boolean }>(- 'openhuman.config_get_onboarding_completed',- {}- );- if (!response.ok) throw new Error(`Could not read onboarding state: ${response.error}`);- return typeof response.result === 'boolean' ? response.result : response.result.result;-}--async function setOnboardingCompleted(value: boolean): Promise<void> {- const response = await callOpenhumanRpc('openhuman.config_set_onboarding_completed', { value });- if (!response.ok) throw new Error(`Could not set onboarding state: ${response.error}`);-}--describe('Onboarding — self-hosted and managed paths', function () {- this.timeout(120_000);-- before(async function () {- this.timeout(90_000);- await startMockServer();- resetMockBehavior();- setMockBehavior('composioConnections', '[]');- await waitForApp();- await resetApp('e2e-onboarding-modes', { skipAuth: true, clearAuthSession: true });- });-- after(async () => {- resetMockBehavior();- await stopMockServer();- });-- it('self-hosted setup runs the three custom steps and supports skipping Search', async function () {- this.timeout(90_000);- await setOnboardingCompleted(false);- expect(await clickTestId('welcome-cta-self')).toBe(true);- await waitForAppReady(20_000);- await waitForAuthBootstrap(20_000);-- // The self-hosted CTA creates a local session and routes into the custom- // wizard. Reapply the flag after identity activation so the gate sees the- // local user's incomplete state as well.- await setOnboardingCompleted(false);- await browser.execute(() => {- window.location.replace('#/onboarding/custom/inference');- window.location.reload();- });- await waitForAppReady(20_000);-- expect(await hasTestId('onboarding-custom-inference-step')).toBe(true);- const labels = await browser.execute(() =>- Array.from(document.querySelectorAll('[data-testid="onboarding-wizard-stepper"] > li')).map(- item => (item.querySelector('span:last-child')?.textContent ?? '').trim()- )- );- expect(labels).toEqual(['Inference', 'Search', 'Vault']);- expect(await clickTestId('onboarding-next-button')).toBe(true);-- expect(await hasTestId('onboarding-custom-search-step')).toBe(true);- expect(await clickTestId('onboarding-search-skip')).toBe(true);- expect(await hasTestId('onboarding-custom-vault-step')).toBe(true);- expect(await clickTestId('onboarding-next-button')).toBe(true);-- expect(await waitForHash('#/chat')).toBe(true);- expect(await onboardingCompleted()).toBe(true);- expect(await hasTestId('onboarding-custom-voice-step', 500)).toBe(false);- expect(await hasTestId('onboarding-custom-oauth-step', 500)).toBe(false);- expect(await hasTestId('onboarding-custom-embeddings-step', 500)).toBe(false);- });-- it('managed setup completes automatically and lands in chat', async function () {- this.timeout(90_000);- const cleared = await callOpenhumanRpc('openhuman.auth_clear_session', {});- expect(cleared.ok).toBe(true);- await browser.execute(() => {- window.location.replace('#/');- window.location.reload();- });- await waitForWindowVisible(20_000);- await waitForWebView(15_000);- await waitForAppReady(20_000);- await dismissBootCheckGateIfVisible(8_000);-- await triggerAuthLoopbackBypass('e2e-onboarding-managed');- await waitForAppReady(20_000);- await waitForAuthBootstrap(20_000);-- // A managed account has no local setup to configure. Exercise its welcome- // route with an incomplete flag and verify that it marks setup complete.- await setOnboardingCompleted(false);- await browser.execute(() => {- window.location.replace('#/onboarding/welcome');- window.location.reload();- });- await waitForAppReady(20_000);- await waitForAuthBootstrap(20_000);-- const deadline = Date.now() + 20_000;- let completed = false;- while (Date.now() < deadline) {- completed = await onboardingCompleted();- if (completed) break;- await browser.pause(250);- }- expect(completed).toBe(true);- expect(await waitForHash('#/chat')).toBe(true);- expect(await hasTestId('onboarding-layout', 500)).toBe(false);- });-});diff --git a/app/test/e2e/specs/runtime-picker-login.spec.ts b/app/test/e2e/specs/runtime-picker-login.spec.tsdeleted file mode 100644index 4a10288ded..0000000000--- a/app/test/e2e/specs/runtime-picker-login.spec.ts+++ /dev/null@@ -1,171 +0,0 @@-// @ts-nocheck-/**- * E2E coverage for the current first-launch choices, local setup, managed- * sign-in, and logout flow.- */-import { waitForApp, waitForAppReady, waitForAuthBootstrap } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { waitForText, waitForWebView, waitForWindowVisible } from '../helpers/element-helpers';-import { triggerAuthLoopbackBypass } from '../helpers/loopback-auth-helpers';-import { resetApp } from '../helpers/reset-app';-import {- dismissBootCheckGateIfVisible,- logoutViaSettings,- waitForRequest,-} from '../helpers/shared-flows';-import {- clearRequestLog,- getRequestLog,- resetMockBehavior,- setMockBehavior,- startMockServer,- stopMockServer,-} from '../mock-server';--const LOG = '[WelcomeFlow]';--async function clickTestId(testId: string, timeout = 15_000): Promise<boolean> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- const clicked = await browser.execute(id => {- const element = document.querySelector<HTMLElement>(`[data-testid="${id}"]`);- if (!element || (element as HTMLButtonElement).disabled) return false;- element.click();- return true;- }, testId);- if (clicked) return true;- await browser.pause(250);- }- return false;-}--async function hasTestId(testId: string, timeout = 15_000): Promise<boolean> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- if (- await browser.execute(id => document.querySelector(`[data-testid="${id}"]`) !== null, testId)- ) {- return true;- }- await browser.pause(250);- }- return false;-}--async function waitForHash(prefix: string, timeout = 30_000): Promise<boolean> {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- if (await browser.execute(value => window.location.hash.startsWith(value), prefix)) return true;- await browser.pause(250);- }- return false;-}--async function setOnboardingCompleted(value: boolean): Promise<void> {- const result = await callOpenhumanRpc('openhuman.config_set_onboarding_completed', { value });- if (!result.ok) throw new Error(`Could not set onboarding state: ${result.error}`);-}--async function getOnboardingCompleted(): Promise<boolean> {- const result = await callOpenhumanRpc<boolean | { result: boolean }>(- 'openhuman.config_get_onboarding_completed',- {}- );- if (!result.ok) throw new Error(`Could not read onboarding state: ${result.error}`);- return typeof result.result === 'boolean' ? result.result : result.result.result;-}--describe('Welcome → local setup → managed login → logout', function () {- this.timeout(180_000);-- before(async function () {- this.timeout(90_000);- await startMockServer();- resetMockBehavior();- setMockBehavior('composioConnections', '[]');- await waitForApp();- await resetApp('e2e-welcome-login', { skipAuth: true, clearAuthSession: true });- clearRequestLog();- });-- after(async () => {- resetMockBehavior();- await stopMockServer();- });-- it('shows both current welcome choices and provider sign-in buttons', async function () {- this.timeout(60_000);- await waitForWindowVisible(20_000);- await waitForWebView(15_000);- await waitForAppReady(15_000);- expect(await waitForText('Welcome to OpenHuman', 15_000)).toBeTruthy();- expect(await hasTestId('welcome-card-self')).toBe(true);- expect(await hasTestId('welcome-cta-self')).toBe(true);- expect(await hasTestId('welcome-cta-tinyhumans')).toBe(true);- const providersVisible = await browser.execute(() => {- const buttons = Array.from(document.querySelectorAll('button'));- return buttons.some(button =>- /Google|GitHub|Twitter|Discord/i.test(- button.getAttribute('aria-label') || button.textContent || ''- )- );- });- expect(providersVisible).toBe(true);- });-- it('self-hosted choice opens and completes the custom wizard', async function () {- this.timeout(90_000);- await setOnboardingCompleted(false);- expect(await clickTestId('welcome-cta-self')).toBe(true);- await waitForAppReady(20_000);- await waitForAuthBootstrap(20_000);- await setOnboardingCompleted(false);- await browser.execute(() => {- window.location.replace('#/onboarding/custom/inference');- window.location.reload();- });- await waitForAppReady(20_000);-- expect(await hasTestId('onboarding-custom-inference-step')).toBe(true);- expect(await clickTestId('onboarding-next-button')).toBe(true);- expect(await hasTestId('onboarding-custom-search-step')).toBe(true);- expect(await clickTestId('onboarding-search-skip')).toBe(true);- expect(await hasTestId('onboarding-custom-vault-step')).toBe(true);- expect(await clickTestId('onboarding-next-button')).toBe(true);- expect(await waitForHash('#/chat')).toBe(true);- expect(await getOnboardingCompleted()).toBe(true);- });-- it('managed sign-in completes its setup and lands in chat', async function () {- this.timeout(90_000);- const cleared = await callOpenhumanRpc('openhuman.auth_clear_session', {});- expect(cleared.ok).toBe(true);- await browser.execute(() => {- window.location.replace('#/');- window.location.reload();- });- await waitForWindowVisible(20_000);- await waitForWebView(15_000);- await waitForAppReady(20_000);- await dismissBootCheckGateIfVisible(8_000);-- clearRequestLog();- await triggerAuthLoopbackBypass('e2e-welcome-managed-user');- await waitForWindowVisible(20_000);- await waitForWebView(15_000);- await waitForAppReady(20_000);- await waitForAuthBootstrap(20_000);-- expect(await waitForRequest(getRequestLog, 'GET', '/auth/me', 20_000)).toBeTruthy();- expect(await waitForHash('#/chat')).toBe(true);- expect(await getOnboardingCompleted()).toBe(true);- });-- it('logout returns the user to the current Welcome choices', async function () {- this.timeout(60_000);- await logoutViaSettings(LOG);- expect(await waitForText('Welcome to OpenHuman', 15_000)).toBeTruthy();- expect(await hasTestId('welcome-cta-self')).toBe(true);- expect(await hasTestId('welcome-cta-tinyhumans')).toBe(true);- });-});diff --git a/app/test/e2e/specs/settings-account-preferences.spec.ts b/app/test/e2e/specs/settings-account-preferences.spec.tsdeleted file mode 100644index 0d681fb034..0000000000--- a/app/test/e2e/specs/settings-account-preferences.spec.ts+++ /dev/null@@ -1,131 +0,0 @@-// @ts-nocheck-import { browser, expect } from '@wdio/globals';--import { waitForApp } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { clickSelector, clickText, textExists, waitForText } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-settings-account-preferences';--async function waitForHashContains(fragment: string, timeout = 10_000): Promise<void> {- await browser.waitUntil(- async () => String(await browser.execute(() => window.location.hash)).includes(fragment),- { timeout, interval: 250, timeoutMsg: `hash did not include ${fragment}` }- );-}--describe('Settings - Account Preferences', function () {- this.timeout(90_000);-- before(async function beforeSuite() {- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('renders the account settings section route', async function () {- this.timeout(90_000);- await navigateViaHash('/settings/account');-- await waitForText('Account', 15_000);- await waitForText('Preferences', 15_000);- await waitForText('Language', 15_000);- });-- it('saves a generated recovery phrase and exposes configured wallet state', async function () {- this.timeout(90_000);- await navigateViaHash('/settings/recovery-phrase');-- // A previous suite or persisted local wallet can leave this panel in its- // existing-wallet view. Follow the product's replacement flow before- // asserting the generated-phrase controls.- if (await textExists('Replace wallet')) {- await clickText('Replace wallet', 10_000);- await clickText('I understand, replace my wallet', 10_000);- }- await clickText('Reveal recovery phrase', 10_000);- await waitForText('Copy to Clipboard', 15_000);- await browser.waitUntil(- async () =>- await browser.execute(() => {- const checkbox = document.querySelector<HTMLInputElement>('#mnemonic-confirm-checkbox');- return checkbox !== null && !checkbox.disabled;- }),- {- timeout: 5_000,- interval: 100,- timeoutMsg: 'recovery phrase consent stayed disabled after reveal',- }- );- await clickSelector('input[type="checkbox"]');- expect(- await browser.execute(- () => document.querySelector<HTMLInputElement>('#mnemonic-confirm-checkbox')?.checked- )- ).toBe(true);- await clickText('Save Recovery Phrase', 10_000);-- await waitForText('Recovery phrase saved', 20_000);- await waitForText('Multi-chain wallet identities are ready', 20_000);-- const wallet = await callOpenhumanRpc('openhuman.wallet_status', {});- expect(wallet.ok).toBe(true);- expect(wallet.result?.result?.configured).toBe(true);- expect((wallet.result?.result?.accounts ?? []).length).toBeGreaterThan(0);-- // The dedicated /settings/connections page (with the "Web3 Wallet:- // Configured" status card) was removed in PR #2550 settings cleanup.- // The wallet_status RPC assertion above is the canonical signal that- // the recovery-phrase flow wired through to the wallet domain.- });-- it('persists the privacy analytics toggle to core config', async function () {- this.timeout(90_000);- const beforeAnalytics = await callOpenhumanRpc('openhuman.config_get_analytics_settings', {});- expect(beforeAnalytics.ok).toBe(true);-- const initialAnalytics = Boolean(beforeAnalytics.result?.result?.enabled);-- await navigateViaHash('/settings/privacy');- await waitForText('Privacy', 15_000);- // Renamed: t('privacy.shareAnonymizedData') = 'Share Product Analytics and Diagnostics'.- await waitForText('Share Product Analytics and Diagnostics', 15_000);-- await clickSelector('[data-testid="privacy-analytics-toggle"]');- await browser.waitUntil(- async () => {- const analytics = await callOpenhumanRpc('openhuman.config_get_analytics_settings', {});- return analytics.ok && Boolean(analytics.result?.result?.enabled) === !initialAnalytics;- },- { timeout: 15_000, interval: 500, timeoutMsg: 'analytics setting did not persist' }- );- await browser.waitUntil(- async () => {- const analytics = await callOpenhumanRpc('openhuman.config_get_analytics_settings', {});- return analytics.ok && Boolean(analytics.result?.result?.enabled) === !initialAnalytics;- },- { timeout: 15_000, interval: 500, timeoutMsg: 'privacy settings did not persist' }- );-- const snapshot = await callOpenhumanRpc('openhuman.app_state_snapshot', {});- expect(snapshot.ok).toBe(true);- expect(Boolean(snapshot.result?.result?.analyticsEnabled)).toBe(!initialAnalytics);- });-- it('opens the billing route and shows the account billing handoff', async function () {- this.timeout(60_000);- await navigateViaHash('/settings/account');-- await waitForHashContains('/settings/account');- await waitForText('Plan & billing', 15_000);- expect(await textExists('Open dashboard')).toBe(true);- });-});diff --git a/app/test/e2e/specs/settings-ai-skills.spec.ts b/app/test/e2e/specs/settings-ai-skills.spec.tsdeleted file mode 100644index 932901149e..0000000000--- a/app/test/e2e/specs/settings-ai-skills.spec.ts+++ /dev/null@@ -1,52 +0,0 @@-// @ts-nocheck-/**- * Settings → AI & Skills (capability 13.3).- *- * Rewritten to follow the cron-jobs-flow reference: one `resetApp(...)` at- * the top establishes a fresh-install baseline (auth + onboarding via- * real UI), then each test navigates to a sub-route and asserts the panel- * actually mounted. No more per-suite ad-hoc auth bootstrapping.- *- * Covers:- * - 13.3.1 LLM panel renders AI routing/provider controls- * - 13.3.2 Tools panel renders at least one tool toggle- */-import { waitForApp } from '../helpers/app-helpers';-import { textExists, waitForText } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-settings-ai-skills';--describe('Settings - AI & Skills', function () {- this.timeout(90_000);-- before(async function beforeSuite() {- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('mounts LLM panel and shows provider/routing controls (13.3.1)', async function () {- this.timeout(90_000);- await navigateViaHash('/settings/llm');-- const providersTab = await browser.$('[data-testid="ai-tab-providers"]');- await providersTab.waitForExist({ timeout: 15_000 });- expect(await providersTab.isDisplayed()).toBe(true);- });-- it('mounts Tools panel and shows skill toggles (13.3.2)', async () => {- await navigateViaHash('/settings/tools');-- await waitForText('Tools', 15_000);- const toolVisible = (await textExists('Filesystem')) || (await textExists('Shell'));- expect(toolVisible).toBe(true);- });-});diff --git a/app/test/e2e/specs/settings-channels-permissions.spec.ts b/app/test/e2e/specs/settings-channels-permissions.spec.tsdeleted file mode 100644index 082cb3c7c0..0000000000--- a/app/test/e2e/specs/settings-channels-permissions.spec.ts+++ /dev/null@@ -1,133 +0,0 @@-// @ts-nocheck-/**- * Settings → Channels & Permissions (capability 13.2).- *- * Rewritten to follow the cron-jobs-flow pattern: `resetApp(...)` brings- * the app to a fresh-install baseline first, then each test drives a- * settings sub-panel through real navigation + click assertions.- *- * Covers:- * - 13.2.1 Switching default messaging channel (Telegram ↔ Discord)- * - 13.2.2 Privacy panel renders + analytics toggle is present- */-import { waitForApp } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import {- clickSelector,- getSwitchCheckedByLabel,- textExists,- toggleSwitchByLabel,- visibleTextExists,- waitForText,-} from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { startMockServer, stopMockServer } from '../mock-server';--/** Read the persisted default messaging channel from the renderer's redux store. */-async function defaultMessagingChannel(): Promise<string | null> {- return browser.execute(() => {- const win = window as unknown as {- __OPENHUMAN_STORE__?: {- getState?: () => { channelConnections?: { defaultMessagingChannel?: string | null } };- };- };- return (- win.__OPENHUMAN_STORE__?.getState?.().channelConnections?.defaultMessagingChannel ?? null- );- });-}--const USER_ID = 'e2e-settings-channels';--describe('Settings - Channels & Permissions', () => {- before(async function () {- // resetApp bring-up can run ~25-30s and race the default 30s Mocha hook- // budget; raise it.- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('allows switching default messaging channel (13.2.1)', async () => {- // resetApp must finish dismissing the post-onboarding Joyride before a- // settings flow starts; otherwise the spotlight overlay intercepts the- // hash navigation and leaves the app on Chat.- expect(await visibleTextExists('Skip tour')).toBe(false);-- // The messaging panel now offers "Set as default" only on *connected*- // channels. In a fresh workspace the only always-connected channel is Web- // (the built-in chat), so we make Telegram the default first — that turns- // Web into a connected, non-default tile that exposes the control — then- // switch the default to Web through the UI.- await callOpenhumanRpc('openhuman.channels_set_default', { channel: 'telegram' });-- // Navigate away and back so the messaging panel re-seeds the default from- // the core (it reads the persisted default when the page mounts).- await navigateViaHash('/home');- await navigateViaHash('/connections?tab=messaging');-- await waitForText('Web', 15_000);- expect(await textExists('Telegram')).toBe(true);- expect(await textExists('Web')).toBe(true);-- // Confirm the panel seeded Telegram as the default before we switch.- await browser.waitUntil(async () => (await defaultMessagingChannel()) === 'telegram', {- timeout: 10_000,- interval: 500,- timeoutMsg: 'messaging panel did not seed Telegram as the default',- });-- // Switch to Web via the stable channel-select test id (its "Set as default"- // control is present because Web is always connected).- await clickSelector('[data-testid="channel-select-web"]');- await browser.waitUntil(async () => (await defaultMessagingChannel()) === 'web', {- timeout: 10_000,- interval: 500,- timeoutMsg: 'default messaging channel did not switch to web',- });- });-- it('renders privacy settings and analytics toggle (13.2.2)', async () => {- await navigateViaHash('/settings/privacy');-- await waitForText('Privacy', 15_000);- // PrivacyPanel's analytics section was renamed: t('privacy.anonymizedAnalytics')- // is now "Product Analytics" and the toggle label t('privacy.shareAnonymizedData')- // is "Share Product Analytics and Diagnostics".- await waitForText('Product Analytics', 15_000);- expect(await textExists('Share Product Analytics and Diagnostics')).toBe(true);-- const analyticsLabel = 'Share Product Analytics and Diagnostics';- expect(await textExists(analyticsLabel)).toBe(true);- const initialState = await getSwitchCheckedByLabel('privacy-analytics-toggle', analyticsLabel);- await toggleSwitchByLabel('privacy-analytics-toggle', analyticsLabel);- const expectedState = !initialState;- await browser.waitUntil(- async () =>- (await getSwitchCheckedByLabel('privacy-analytics-toggle', analyticsLabel)) ===- expectedState,- { timeout: 10_000, timeoutMsg: 'analytics preference did not change' }- );-- // Leaving and reopening the route remounts PrivacyPanel from the refreshed- // core snapshot, proving the preference was persisted by the core.- await navigateViaHash('/settings/account');- await navigateViaHash('/settings/privacy');- await waitForText(analyticsLabel, 15_000);- await browser.waitUntil(- async () =>- (await getSwitchCheckedByLabel('privacy-analytics-toggle', analyticsLabel)) ===- expectedState,- {- timeout: 10_000,- timeoutMsg: 'analytics preference was lost after reopening privacy settings',- }- );- });-});diff --git a/app/test/e2e/specs/skill-execution-flow.spec.ts b/app/test/e2e/specs/skill-execution-flow.spec.tsdeleted file mode 100644index 5d6d894f49..0000000000--- a/app/test/e2e/specs/skill-execution-flow.spec.ts+++ /dev/null@@ -1,66 +0,0 @@-// @ts-nocheck-/**- * Skill discovery end-to-end (UI shell + core JSON-RPC).- *- * The QuickJS/rquickjs skill execution runtime was removed (RC-7).- * This spec validates:- * 1. The app lands on a logged-in shell.- * 2. Core RPC (core.ping) is reachable over the same JSON-RPC URL the UI uses.- * 3. The Skills UI surface renders and shows the skills catalog.- */-import { waitForApp } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { dumpAccessibilityTree, textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateToSkills } from '../helpers/shared-flows';-import { getRequestLog, startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-skill-execution';--describe('Skill discovery (UI + core RPC)', () => {- before(async () => {- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('lands the user on a logged-in shell', async () => {- // Welcome text varies while the chat surface hydrates. The authenticated- // app shell is the stable contract this smoke test actually needs.- const atHome = (await browser.execute(- () => document.querySelector('[data-testid="root-shell-sidebar"]') !== null- )) as boolean;- expect(atHome).toBe(true);- });-- it('core.ping responds over the same JSON-RPC URL the UI uses', async () => {- const ping = await callOpenhumanRpc('core.ping', {});- expect(ping.ok).toBe(true);- });-- it('Connections UI surface shows installed tools', async () => {- // Phase 2: navigateToSkills() now navigates to /connections- await navigateToSkills();- await browser.pause(2_000);-- const hash = await browser.execute(() => window.location.hash);- // Phase 2: /skills redirects to /connections- expect(String(hash)).toContain('/connections');-- const visible =- (await textExists('Skills')) ||- (await textExists('Install')) ||- (await textExists('Available')) ||- (await textExists('Telegram')) ||- (await textExists('Notion'));- if (!visible) {- await dumpAccessibilityTree();- console.error('[SkillExecutionE2E] request log:', getRequestLog());- }- expect(visible).toBe(true);- });-});diff --git a/app/test/e2e/specs/skill-lifecycle.spec.ts b/app/test/e2e/specs/skill-lifecycle.spec.tsdeleted file mode 100644index 62728c2dd1..0000000000--- a/app/test/e2e/specs/skill-lifecycle.spec.ts+++ /dev/null@@ -1,65 +0,0 @@-// @ts-nocheck-/**- * Skill lifecycle smoke (issue #224).- *- * Drives auth → onboarding → Skills page and asserts:- * 1. The route mounts (`#/connections` — was `#/skills` before Phase 2).- * 2. The Skills shell renders one of the well-known affordances- * (Skills/Install/Available header).- *- * Note: the Skills page now fetches data via the `openhuman.flows_list`- * JSON-RPC method (not via a REST GET /skills to the mock backend). The- * mock-HTTP oracle was removed so the spec does not produce false-negative- * failures when the UI wires correctly through core RPC.- */-import { waitForApp } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateToSkills } from '../helpers/shared-flows';-import { startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-skill-lifecycle';--describe('Skill lifecycle smoke', () => {- before(async function beforeSuite() {- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('Connections page mounts and fetched the registry', async () => {- // Phase 2: navigateToSkills() now points to /connections- await navigateToSkills();- await browser.waitUntil(- // Phase 2: /skills redirects to /connections- async () =>- String(await browser.execute(() => window.location.hash)).includes('/connections'),- { timeout: 10_000, interval: 250, timeoutMsg: 'Connections route did not mount in time' }- );-- const hash = await browser.execute(() => window.location.hash);- // Phase 2: /skills → /connections- expect(String(hash)).toContain('/connections');-- // Connections page shows tabs: Apps (was Composio), Messaging (was Channels), Tools (was MCP)- const visible =- (await textExists('Apps')) ||- (await textExists('Messaging')) ||- (await textExists('Tools')) ||- (await textExists('Connections'));- expect(visible).toBe(true);-- // Verify the core RPC route for skills is reachable. The Skills page- // uses openhuman.flows_list (not a mock-backend HTTP call) since the- // QuickJS skills runtime was removed. We probe it here as the- // authoritative oracle that the data-fetch path is wired.- const rpcResult = await callOpenhumanRpc('openhuman.flows_list', {});- expect(rpcResult.ok).toBe(true);- });-});diff --git a/app/test/e2e/specs/skill-multi-round.spec.ts b/app/test/e2e/specs/skill-multi-round.spec.tsdeleted file mode 100644index aeb137117f..0000000000--- a/app/test/e2e/specs/skill-multi-round.spec.ts+++ /dev/null@@ -1,49 +0,0 @@-// @ts-nocheck-/**- * Multi-round tool usage via chat (issue #222) — smoke: authenticated user- * can open the chat surface where the agent would drive multi-round tool- * calls. Deep agent+tool loops are covered in Rust integration tests; here- * we verify the shell route mounts post-login.- *- * NOTE: the unified chat surface lives at `/chat` (the old `/conversations`- * route was retired — see CLAUDE.md). This spec is updated accordingly.- */-import { waitForApp } from '../helpers/app-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-skill-multi-round';--describe('Multi-round tool conversation smoke', () => {- before(async () => {- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('loads /chat after login for agent tool use', async () => {- await navigateViaHash('/chat');- await browser.pause(2_500);-- const hash = await browser.execute(() => window.location.hash);- expect(String(hash)).toContain('/chat');-- // The welcome copy is optional while the thread is hydrating, so assert the- // actual agent input surface rather than an empty-state string. Use the- // host-owned walkthrough marker because tauri-driver's XPath text lookup- // can miss nested text nodes under WebKitGTK.- const chatReady = await browser.waitUntil(- async () =>- (await browser.execute(- () => document.querySelector('[data-walkthrough="chat-agent-panel"]') !== null- )) as boolean,- { timeout: 10_000, interval: 250, timeoutMsg: 'Chat composer did not render' }- );- expect(chatReady).toBe(true);- });-});diff --git a/app/test/e2e/specs/skill-oauth.spec.ts b/app/test/e2e/specs/skill-oauth.spec.tsdeleted file mode 100644index 76feb42751..0000000000--- a/app/test/e2e/specs/skill-oauth.spec.ts+++ /dev/null@@ -1,44 +0,0 @@-// @ts-nocheck-/**- * Skill OAuth UI smoke (issue #221).- *- * JSON-RPC coverage for OAuth + setup persistence lives in Rust integration- * tests (`tests/json_rpc_e2e.rs`:- * `json_rpc_skills_status_reflects_setup_complete_without_runtime`,- * `json_rpc_skills_oauth_complete_after_start`). This spec only verifies- * the post-auth Skills shell shows the connection/setup affordances a user- * would tap to start that flow.- */-import { waitForApp } from '../helpers/app-helpers';-import { textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateToSkills } from '../helpers/shared-flows';-import { startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-skill-oauth';--describe('Skill OAuth UI smoke', () => {- before(async function beforeSuite() {- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('Skills page shows skill rows with actions after login', async () => {- await navigateToSkills();- await browser.pause(2_500);-- const hasSkillChrome =- (await textExists('Skills')) ||- (await textExists('Install')) ||- (await textExists('Available')) ||- (await textExists('Connect')) ||- (await textExists('Setup'));- expect(hasSkillChrome).toBe(true);- });-});diff --git a/app/test/e2e/specs/skill-socket-reconnect.spec.ts b/app/test/e2e/specs/skill-socket-reconnect.spec.tsdeleted file mode 100644index 0412435368..0000000000--- a/app/test/e2e/specs/skill-socket-reconnect.spec.ts+++ /dev/null@@ -1,39 +0,0 @@-// @ts-nocheck-/**- * Socket reconnect + skill sync smoke (issue #223).- *- * Ensures the app reaches a healthy post-auth Home state — the baseline- * any future reconnect/`tool:sync` flow would build on. Full reconnect- * behavior is integration-tested in app code.- */-import { waitForApp } from '../helpers/app-helpers';-import { textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateToHome, waitForHomePage } from '../helpers/shared-flows';-import { startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-skill-socket-reconnect';--describe('Socket reconnect skill sync smoke', () => {- before(async () => {- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('reaches Home after login (baseline for post-reconnect tool:sync)', async () => {- let home = await waitForHomePage(15_000);- if (!home) {- await navigateToHome();- home = await waitForHomePage(15_000);- }-- // waitForHomePage already checks current Home.tsx text ('Ask your assistant anything' etc.)- const ok = home || (await textExists('Ask your assistant anything'));- expect(ok).toBeTruthy();- });-});diff --git a/app/test/e2e/specs/skills-registry.spec.ts b/app/test/e2e/specs/skills-registry.spec.tsdeleted file mode 100644index 2b3fc17039..0000000000--- a/app/test/e2e/specs/skills-registry.spec.ts+++ /dev/null@@ -1,116 +0,0 @@-// @ts-nocheck-/**- * Skills registry E2E flow.- *- * Drives browse → install → uninstall through real UI clicks. The mock- * backend's `/skills` registry seeds the catalog; install/uninstall hits- * are validated through both UI feedback AND the mock request log so we- * know the click actually reached the network.- */-import { waitForApp } from '../helpers/app-helpers';-import {- clickButton,- clickText,- dumpAccessibilityTree,- textExists,-} from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateToSkills } from '../helpers/shared-flows';-import { clearRequestLog, getRequestLog, startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-skills-registry';--interface RequestLogEntry {- method: string;- url: string;- body?: unknown;-}--async function waitForRequest(- method: string,- urlFragment: string,- timeoutMs = 15_000-): Promise<RequestLogEntry | undefined> {- const deadline = Date.now() + timeoutMs;- while (Date.now() < deadline) {- const log = getRequestLog() as RequestLogEntry[];- const match = log.find(r => r.method === method && r.url.includes(urlFragment));- if (match) return match;- await browser.pause(500);- }- return undefined;-}--describe('Skills registry flow', () => {- before(async function beforeSuite() {- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('navigates to /connections and renders catalog content', async () => {- clearRequestLog();- // Phase 2: navigateToSkills() now navigates to /connections- await navigateToSkills();-- const currentHash = await browser.execute(() => window.location.hash);- // Phase 2: /skills → /connections- expect(String(currentHash)).toContain('/connections');-- await browser.pause(2_000);- // Phase 2: tab labels changed — Apps/Messaging/Tools instead of Composio/Channels/MCP- const hasSkillsContent =- (await textExists('Apps')) ||- (await textExists('Messaging')) ||- (await textExists('Tools')) ||- (await textExists('Telegram')) ||- (await textExists('Notion'));-- if (!hasSkillsContent) {- await dumpAccessibilityTree();- console.error('[SkillsRegistryE2E] request log:', getRequestLog());- }- expect(hasSkillsContent).toBe(true);- });-- it('shows at least one known registry skill name', async () => {- const hasNamedSkill =- (await textExists('Telegram')) || (await textExists('Notion')) || (await textExists('Gmail'));- expect(hasNamedSkill).toBe(true);- });-- it('install button (if present) triggers an RPC request', async () => {- clearRequestLog();- try {- await clickButton('Install', 5_000);- } catch {- // No install button visible in this state — skip the RPC oracle.- return;- }- const req = await waitForRequest('POST', '/rpc', 10_000);- expect(req).toBeDefined();- });-- it('uninstall affordance (if present) triggers an RPC request', async () => {- clearRequestLog();- const labels = ['Uninstall', 'Disconnect', 'Remove'];- let clicked = false;- for (const label of labels) {- try {- await clickText(label, 3_000);- clicked = true;- break;- } catch {- // try next label- }- }- if (!clicked) return;- const req = await waitForRequest('POST', '/rpc', 10_000);- expect(req).toBeDefined();- });-});diff --git a/app/test/e2e/specs/user-journey-full-task.spec.ts b/app/test/e2e/specs/user-journey-full-task.spec.tsdeleted file mode 100644index 6d6f2f4241..0000000000--- a/app/test/e2e/specs/user-journey-full-task.spec.ts+++ /dev/null@@ -1,216 +0,0 @@-// @ts-nocheck-/**- * User journey — full research task end-to-end.- *- * Simulates a real user asking the assistant to fetch content from- * a URL. The flow:- *- * 1. Login + land on home- * 2. Navigate to /chat- * 3. Ask: "Fetch the contents of example.com for me"- * 4. Agent calls web_fetch tool (mocked)- * 5. Final answer with canary text appears- * 6. Navigate away to settings, then back to /chat- * 7. Thread conversation history is still visible- *- * Tests:- * J1.1 — message sent and displayed in DOM- * J1.2 — tool call timeline appears during execution- * J1.3 — final answer with canary text renders- * J1.4 — after navigate away + back, thread messages still visible- */-import { waitForApp } from '../helpers/app-helpers';-import {- chatMounted,- clickByTitle,- clickSend,- getSelectedThreadId,- typeIntoComposer,- waitForSocketConnected,-} from '../helpers/chat-harness';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { textExists } from '../helpers/element-helpers';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { clearRequestLog, setMockBehavior, startMockServer, stopMockServer } from '../mock-server';--const LOG_PREFIX = '[user-journey-full-task]';-const USER_ID = 'e2e-user-journey-full-task';-const PROMPT = 'Fetch the contents of example.com for me';-const CANARY_FINAL = 'canary-journey-fetch-j1k2l3';--const FORCED_RESPONSES = [- {- content: '',- toolCalls: [- {- id: 'call_web_fetch_journey',- name: 'web_fetch',- arguments: JSON.stringify({ url: 'https://example.com' }),- },- ],- },- { content: `Here is the fetched page content: ${CANARY_FINAL}` },-];--describe('User journey — full research task', () => {- let threadId: string;-- before(async () => {- console.log(`${LOG_PREFIX} Starting mock server and resetting app`);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- setMockBehavior('llmForcedResponses', JSON.stringify(FORCED_RESPONSES));- setMockBehavior('llmStreamChunkDelayMs', '10');- clearRequestLog();- console.log(`${LOG_PREFIX} Setup complete`);- });-- after(async () => {- setMockBehavior('llmForcedResponses', '');- setMockBehavior('llmStreamChunkDelayMs', '');- await stopMockServer();- console.log(`${LOG_PREFIX} Teardown complete`);- });-- it('J1.1 — message sent and displayed in DOM', async () => {- console.log(`${LOG_PREFIX} J1.1: navigating to /chat`);- await navigateViaHash('/chat');- await browser.waitUntil(async () => await chatMounted(), {- timeout: 15_000,- timeoutMsg: 'Conversations panel did not mount',- });- expect(await clickByTitle('New thread', 8_000)).toBe(true);-- threadId = (await browser.waitUntil(async () => await getSelectedThreadId(), {- timeout: 8_000,- timeoutMsg: 'thread.selectedThreadId never populated',- })) as string;- expect(typeof threadId).toBe('string');- console.log(`${LOG_PREFIX} J1.1: thread created: ${threadId}`);-- await typeIntoComposer(PROMPT);- const socketReady = await waitForSocketConnected(30_000);- if (!socketReady) {- console.warn('[user-journey-full-task] socket did not connect within 30 s — send may fail');- }- expect(- await browser.waitUntil(async () => await clickSend(), {- timeout: 5_000,- timeoutMsg: 'Send button never enabled',- })- ).toBe(true);-- // The user message should appear in the DOM immediately.- await browser.waitUntil(async () => await textExists('example.com'), {- timeout: 10_000,- timeoutMsg: 'User message text "example.com" never appeared in chat',- });- console.log(`${LOG_PREFIX} J1.1: passed — user message visible`);- });-- it('J1.2 — tool call timeline appears during execution', async function () {- this.timeout(60_000);- console.log(`${LOG_PREFIX} J1.2: watching for tool timeline entry`);- let sawToolTimeline = false;- let sawFinalAnswer = false;- const deadline = Date.now() + 45_000;- while (Date.now() < deadline) {- const snap = (await browser.execute((tid: string) => {- const winAny = window as unknown as { __OPENHUMAN_STORE__?: { getState: () => unknown } };- const state = winAny.__OPENHUMAN_STORE__?.getState() as- | { chatRuntime?: { toolTimelineByThread?: Record<string, Array<{ name?: string }>> } }- | undefined;- const timeline = state?.chatRuntime?.toolTimelineByThread?.[tid] ?? [];- return timeline.map((e: { name?: string }) => e?.name ?? '');- }, threadId)) as string[];-- if (snap.length > 0) {- sawToolTimeline = true;- console.log(`${LOG_PREFIX} J1.2: timeline appeared — tools: ${snap.join(', ')}`);- break;- }- if (await textExists(CANARY_FINAL)) {- sawFinalAnswer = true;- console.log(`${LOG_PREFIX} J1.2: canary arrived (turn may have completed before poll)`);- break;- }- await browser.pause(200);- }-- const canaryVisible = sawFinalAnswer || (await textExists(CANARY_FINAL));- expect(sawToolTimeline || canaryVisible).toBe(true);- console.log(- `${LOG_PREFIX} J1.2: passed (sawTimeline=${sawToolTimeline}, canaryVisible=${canaryVisible})`- );- });-- it('J1.3 — final answer with canary text renders', async function () {- this.timeout(60_000);- console.log(`${LOG_PREFIX} J1.3: waiting for canary`);- await browser.waitUntil(async () => await textExists(CANARY_FINAL), {- timeout: 45_000,- timeoutMsg: `final answer canary "${CANARY_FINAL}" never rendered`,- });- console.log(`${LOG_PREFIX} J1.3: passed — canary visible`);- });-- it('J1.4 — after navigate away + back, thread messages still visible', async function () {- this.timeout(60_000);- console.log(`${LOG_PREFIX} J1.4: navigating away to /settings/privacy`);-- // Ensure the IN_FLIGHT map cleared (turn is fully done) before navigating.- await browser.waitUntil(- async () => {- const snap = await callOpenhumanRpc<{ result: { entries: Array<{ key: string }> } }>(- 'openhuman.test_support_in_flight_chats',- {}- );- return snap.ok && (snap.result?.result?.entries ?? []).length === 0;- },- { timeout: 15_000, timeoutMsg: 'IN_FLIGHT never cleared before navigate-away' }- );-- await navigateViaHash('/settings/privacy');- await browser.waitUntil(- async () =>- browser.execute(() =>- Boolean(document.querySelector('[data-testid="settings-privacy-panel"]'))- ),- {- timeout: 15_000,- timeoutMsg: 'Privacy settings panel did not mount before returning to chat',- }- );- console.log(`${LOG_PREFIX} J1.4: on /settings/privacy`);-- await browser.pause(500);-- console.log(`${LOG_PREFIX} J1.4: navigating back to /chat`);- await navigateViaHash('/chat');- await browser.waitUntil(async () => await chatMounted(), {- timeout: 15_000,- timeoutMsg: 'Conversations panel did not remount',- });-- // The thread we created should still be visible after route churn. Use a- // direct DOM text scan here: the failure artifact from Release CI showed- // the canary in the rendered page while the element-level lookup timed out- // under the shared CEF session.- await browser.waitUntil(- async () =>- browser.execute(- (canary: string) => document.body.textContent?.includes(canary) ?? false,- CANARY_FINAL- ),- {- timeout: 20_000,- interval: 300,- timeoutMsg: `canary "${CANARY_FINAL}" not visible after navigate back to /chat`,- }- );-- console.log(`${LOG_PREFIX} J1.4: passed — conversation persists across navigation`);- });-});diff --git a/app/test/e2e/specs/voice-mode.spec.ts b/app/test/e2e/specs/voice-mode.spec.tsdeleted file mode 100644index 4c913d4817..0000000000--- a/app/test/e2e/specs/voice-mode.spec.ts+++ /dev/null@@ -1,283 +0,0 @@-// @ts-nocheck-/**- * E2E test: Voice mode integration- *- * Current desktop flow:- * - Chat defaults to the text composer.- * - The microphone button switches the composer into `MicComposer`.- * - `MicComposer` exposes a "Switch to text" control to restore the text- * textarea.- *- * The older "Text / Voice" segmented toggle no longer exists. This spec- * covers the current desktop-only voice entry surface and keeps the- * `openhuman.voice_status` RPC contract assertions below.- */-import { waitForApp, waitForAppReady } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { triggerAuthDeepLink } from '../helpers/deep-link-helpers';-import {- clickButton,- clickSelector,- dumpAccessibilityTree,- textExists,- waitForWebView,- waitForWindowVisible,-} from '../helpers/element-helpers';-import { supportsExecuteScript } from '../helpers/platform';-import { completeOnboardingIfVisible } from '../helpers/shared-flows';-import { clearRequestLog, getRequestLog, startMockServer, stopMockServer } from '../mock-server';--async function waitForRequest(method, urlFragment, timeout = 15_000) {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- const log = getRequestLog();- const match = log.find(r => r.method === method && r.url.includes(urlFragment));- if (match) return match;- await browser.pause(500);- }- return undefined;-}--async function waitForHome(timeout = 20_000) {- // Home.tsx renders t('home.askAssistant') = 'Ask your assistant anything...' as stable CTA.- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- if (await textExists('Ask your assistant anything')) return true;- if (await textExists('Your device is connected')) return true;- await browser.pause(700);- }- return false;-}--async function waitForAnyText(candidates, timeout = 20_000) {- const deadline = Date.now() + timeout;- while (Date.now() < deadline) {- for (const t of candidates) {- if (await textExists(t)) return t;- }- await browser.pause(600);- }- return null;-}--// Both cases in this suite have current Playwright equivalents:-// `chat mic button switches into MicComposer and can return to text mode` and-// the `switchChatIntoMicComposer` control checks for permission/device cases.-// Issue #236 decides which runner owns these duplicate SPA-only assertions.-describe.skip(// https://github.com/senamakel/openhuman/issues/236-'Voice mode integration', () => {- before(async () => {- await startMockServer();- await waitForApp();- clearRequestLog();- });-- after(async () => {- await stopMockServer();- });-- it('can switch into the mic composer and back to text mode', async () => {- await triggerAuthDeepLink('e2e-voice-token');- await waitForWindowVisible(25_000);- await waitForWebView(15_000);- await waitForAppReady(15_000);-- const consume = await waitForRequest('POST', '/auth/login-token/consume');- expect(consume).toBeDefined();-- await completeOnboardingIfVisible('[VoiceModeE2E]');-- const onHome = await waitForHome(20_000);- if (!onHome) {- const tree = await dumpAccessibilityTree();- console.log('[VoiceModeE2E] Home not reached. Tree:\n', tree.slice(0, 4000));- }- expect(onHome).toBe(true);-- const hasTextInput = await waitForAnyText(['How can I help', 'Threads', 'New'], 10_000);- expect(hasTextInput).not.toBeNull();-- await clickButton('Voice mode', 10_000);-- const voiceStatusMessage = await waitForAnyText(- [- 'Tap and speak',- 'Tap to send',- 'Speech-to-text unavailable',- 'whisper-cli binary',- 'Ready',- 'Start Talking',- 'Voice input needs a speech model',- ],- 15_000- );- expect(voiceStatusMessage).not.toBeNull();-- if (supportsExecuteScript()) {- await clickSelector('button[aria-label="Switch to text"]', 10_000);- } else {- await clickButton('Switch to text', 10_000);- }- const textRestored = await waitForAnyText(['How can I help', 'Threads', 'New'], 10_000);- expect(textRestored).not.toBeNull();- });-- it('surfaces a mic entry button from the text composer', async () => {- const onConversations = await waitForAnyText(['How can I help', 'Threads', 'New'], 10_000);- if (!onConversations) {- const tree = await dumpAccessibilityTree();- console.log('[VoiceModeE2E] Conversations not ready. Tree:\n', tree.slice(0, 4000));- }- expect(onConversations).not.toBeNull();- expect(await textExists('Voice mode')).toBe(true);- });-});--/**- * Hosted STT engine — core RPC contract tests.- *- * These tests exercise the `openhuman.voice_status` RPC to assert the- * availability contract without touching the UI voice toggle (which was- * removed in #717). The RPC contract is:- *- * - `stt_engine` is the configured backend or third-party provider route.- * - `stt_available` reports whether that route can be constructed from the- * active configuration, with `stt_error` explaining a missing provider.- */-describe('Voice mode — hosted STT contract (voice_status RPC)', () => {- before(async () => {- await startMockServer();- await waitForApp();- });-- after(async () => {- await stopMockServer();- });-- it('5.1 — voice_status RPC returns a well-formed response', async () => {- const result = await callOpenhumanRpc('openhuman.voice_status', {});- expect(result).toBeDefined();- expect(typeof result).toBe('object');- const status = (result as any).result ?? result;- expect(typeof status.stt_available).toBe('boolean');- expect(typeof status.tts_available).toBe('boolean');- expect(typeof status.stt_engine).toBe('string');- expect(status.stt_error === null || typeof status.stt_error === 'string').toBe(true);- });-- it('5.2 — voice_status reports the resolved STT engine', async () => {- const result = await callOpenhumanRpc('openhuman.voice_status', {});- const status = (result as any).result ?? result;-- expect(status.stt_engine.length).toBeGreaterThan(0);- expect(status.stt_error === null || typeof status.stt_error === 'string').toBe(true);- });-});--/**- * Remaining desktop voice coverage: the shipped mic surface on the current- * chat route, plus the unsupported spoken-audio round-trip. The synthetic- * `voice_stt_dispatch` call moved to the JSON-RPC integration layer;- * permission/device and beep-placeholder browser API flows live in the- * Playwright voice-mode spec.- */-// This suite is no longer blanket-skipped: its current mic UI assertion runs,-// while only the real-audio injection case remains blocked by #435.-describe('Voice mode — Human tab capture & error mapping', () => {- before(async () => {- await startMockServer();- await waitForApp();- });-- after(async () => {- await stopMockServer();- });-- // ---------------------------------------------------------------------------- // Helper: navigate to the Assistant (Chat) tab via hash routing.- // /human merged into /chat: the mascot docks on the chat composer, and- // /human is kept only as a back-compat redirect.- // ---------------------------------------------------------------------------- async function navigateToHumanTab(): Promise<void> {- if (supportsExecuteScript()) {- await browser.execute(() => {- // /human → /chat (back-compat redirect preserved)- window.location.hash = '#/chat';- });- } else {- // Mac2 path: use the shared helper which abstracts the XCUIElementTypeButton- // XPath so the selector stays cross-driver and policy-compliant.- await clickButton('Assistant');- }- // Allow React router to settle and the Chat page to mount.- await browser.pause(1_500);- }-- // ---------------------------------------------------------------------------- // 6.1 — Human tab renders with MicComposer in idle state.- //- // Checks that the Human tab mounts the MicComposer idle button (aria-label="Start recording"- // / visible label "Tap and speak") is present.- // ---------------------------------------------------------------------------- it('6.1 — Human tab renders with MicComposer in idle state', async () => {- await triggerAuthDeepLink('e2e-voice-human-tab-token');- await waitForWindowVisible(25_000);- await waitForWebView(15_000);- await waitForAppReady(15_000);- await completeOnboardingIfVisible('[HumanTabE2E]');-- await navigateToHumanTab();-- // /human is a compatibility redirect into the current chat composer. Pin- // the controls users can invoke there rather than the removed setup label.- expect(await textExists('Voice mode')).toBe(true);- await clickButton('Voice mode');- expect(await textExists('Tap and speak')).toBe(true);- // The switch is icon-only: its accessible name is not visible DOM text,- // so target the button's label instead of the text-search helper.- await clickSelector('button[aria-label="Switch to text"]', 10_000);- expect(await waitForAnyText(['How can I help', 'Threads', 'New'], 10_000)).not.toBeNull();- });-- // 6.2 was an RPC-only call with a synthetic payload. The owner-layer JSON-RPC- // integration test now pins dispatch and structured invalid-audio handling.-- // The permission-denied and missing-device outcomes are asserted by the- // current Playwright voice-mode UI cases; beep-placeholder behavior has its- // own Playwright regression. Those browser-API copies were removed here so- // this desktop suite only keeps its current native surface and the- // unsupported real-audio round-trip below.-- // ---------------------------------------------------------------------------- // 6.6 — Actual transcription round-trip with mocked audio device (SKIPPED).- //- // A full round-trip — speak → MediaRecorder captures audio → STT RPC →- // transcript appears as user message → agent replies — requires:- // a) A real or virtual audio device (unavailable in headless docker).- // b) The ability to inject PCM frames into MediaRecorder (not possible- // via WebDriver — WDIO has no W3C audio injection API for CEF).- // c) The mock server to handle /openai/v1/audio/transcriptions (it does).- //- // The malformed-audio contract is tested at the host boundary by- // `tests/json_rpc_e2e.rs::voice_stt_dispatch_reaches_handler_and_rejects_invalid_audio_structurally`.- // MicComposer.test.tsx separately covers its transcribeWithFactory behavior.- // This skip records the gap: there is no E2E path that drives real audio- // through MediaRecorder in the CI headless environment.- //- // Tracked: issue #435. Remove skip when the test harness supports audio- // injection (e.g. via a virtual ALSA device + pre-recorded WAV replayer, or- // a fake getUserMedia implementation that returns a pre-seeded MediaStream).- // ---------------------------------------------------------------------------- it.skip(// https://github.com/senamakel/openhuman/issues/435- '6.6 — spoken prompt round-trip: mic → STT → user bubble → agent reply (requires real/virtual audio device)', async () => {- // When unblocked:- // 1. Navigate to /human.- // 2. Inject a pre-recorded WAV as a fake MediaStream via getUserMedia mock- // (or use a virtual ALSA loopback device seeded by the test harness).- // 3. Click "Start recording", let the recorder run for ~500 ms, click again.- // 4. Wait for the STT RPC to complete (mock returns known transcript text).- // 5. Assert the known transcript text appears as a user bubble in the thread.- // 6. Assert the agent responds (at minimum: a non-empty agent message bubble).- // 7. Assert the user bubble does not contain "beep" or other placeholder text.- });-});diff --git a/app/test/e2e/specs/webhooks-ingress-flow.spec.ts b/app/test/e2e/specs/webhooks-ingress-flow.spec.tsdeleted file mode 100644index ca66bb4a0f..0000000000--- a/app/test/e2e/specs/webhooks-ingress-flow.spec.ts+++ /dev/null@@ -1,95 +0,0 @@-// @ts-nocheck-import { expect } from '@wdio/globals';--import { waitForApp } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { resetApp } from '../helpers/reset-app';-import { clearRequestLog, startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-webhooks-ingress';--function stepLog(message: string, context?: unknown): void {- const stamp = new Date().toISOString();- if (context === undefined) {- console.log(`[WebhooksIngressE2E][${stamp}] ${message}`);- return;- }- console.log(`[WebhooksIngressE2E][${stamp}] ${message}`, JSON.stringify(context, null, 2));-}--describe('Webhooks ingress surface (stub-level)', () => {- before(async function () {- // resetApp bring-up (waitForApp + onboarding walk + home confirm) can run- // ~25-30s and race the default 30s Mocha hook budget; raise it.- this.timeout(90_000);- await startMockServer();- await waitForApp();- await resetApp(USER_ID);- clearRequestLog();- });-- after(async () => {- await stopMockServer();- });-- it('reaches the app shell after onboarding', async () => {- // The assistant-ui chat view intentionally has no fixed greeting copy.- // The authenticated sidebar is the stable shell marker after onboarding.- const atShell = await browser.execute(- () => document.querySelector('[data-testid="root-shell-sidebar"]') !== null- );- expect(atShell).toBe(true);- });-- // No Rust owner test exercises this RPC wire surface against its router;- // retain these assertions until that integration coverage exists.- it('exposes the stub webhook RPC surface with stable result and log shapes', async () => {- const tunnelUuid = 'e2e-webhooks-ingress-tunnel';-- const registrations = await callOpenhumanRpc('openhuman.webhooks_list_registrations', {});- expect(registrations.ok).toBe(true);- expect(registrations.result?.result?.registrations).toEqual([]);- expect(registrations.result?.logs?.[0]).toContain('webhooks.list_registrations returned 0');-- const logs = await callOpenhumanRpc('openhuman.webhooks_list_logs', { limit: 5 });- expect(logs.ok).toBe(true);- expect(logs.result?.result?.logs).toEqual([]);- expect(logs.result?.logs?.[0]).toContain('webhooks.list_logs returned 0');-- const register = await callOpenhumanRpc('openhuman.webhooks_register_echo', {- tunnel_uuid: tunnelUuid,- tunnel_name: 'E2E Tunnel',- backend_tunnel_id: 'backend-e2e-webhooks-ingress',- });- stepLog('register_echo result', { ok: register.ok, error: register.error });-- // register_echo requires the socket-backed webhook router to be- // initialized. In E2E the socket may not be connected, so the router- // is uninitialized and the call returns an error. When ok=false, skip- // the write-path assertions and only validate the read-only surface.- if (register.ok) {- const regs = register.result?.result?.registrations ?? [];- expect(Array.isArray(regs)).toBe(true);- expect(regs.length).toBeGreaterThanOrEqual(1);- expect(register.result?.logs?.[0]).toContain(- `webhooks.register_echo registered tunnel ${tunnelUuid}`- );-- const clear = await callOpenhumanRpc('openhuman.webhooks_clear_logs', {});- expect(clear.ok).toBe(true);- expect(clear.result?.result?.cleared).toBe(0);- expect(clear.result?.logs?.[0]).toContain('webhooks.clear_logs removed 0');-- const unregister = await callOpenhumanRpc('openhuman.webhooks_unregister_echo', {- tunnel_uuid: tunnelUuid,- });- expect(unregister.ok).toBe(true);- expect(unregister.result?.result?.registrations).toEqual([]);- expect(unregister.result?.logs?.[0]).toContain(- `webhooks.unregister_echo removed tunnel ${tunnelUuid}`- );- } else {- stepLog('register_echo failed (router not initialized) — skipping write-path assertions');- }- });-});diff --git a/app/test/e2e/specs/webhooks-tunnel-flow.spec.ts b/app/test/e2e/specs/webhooks-tunnel-flow.spec.tsdeleted file mode 100644index b436e6b53b..0000000000--- a/app/test/e2e/specs/webhooks-tunnel-flow.spec.ts+++ /dev/null@@ -1,59 +0,0 @@-/**- * End-to-end: webhook controller surface and compatibility-route coverage.- *- * The backend tunnel CRUD surface is available through OpenHuman. Echo-registration- * behavior is exercised separately in webhooks-ingress-flow.spec.ts.- */-import { waitForApp } from '../helpers/app-helpers';-import { callOpenhumanRpc } from '../helpers/core-rpc';-import { resetApp } from '../helpers/reset-app';-import { navigateViaHash } from '../helpers/shared-flows';-import { resetMockBehavior, startMockServer, stopMockServer } from '../mock-server';--const USER_ID = 'e2e-webhooks-tunnel';--describe('Webhook controller surface and retired-route coverage', () => {- before(async function () {- // resetApp bring-up can run ~25-30s and race the default 30s Mocha hook- // budget; raise it.- this.timeout(90_000);- await startMockServer();- await resetMockBehavior();- await waitForApp();- await resetApp(USER_ID);- });-- after(async () => {- await stopMockServer();- });-- it('reached the logged-in shell after onboarding', async () => {- // The assistant-ui chat view intentionally has no fixed greeting copy.- // The authenticated sidebar is the stable shell marker after onboarding.- const atShell = await browser.execute(- () => document.querySelector('[data-testid="root-shell-sidebar"]') !== null- );- expect(atShell).toBe(true);- });-- // Rust coverage does not exercise tunnel RPCs through the router/backend.- it('exposes backend tunnel CRUD', async () => {- const listed = await callOpenhumanRpc('openhuman.webhooks_list_tunnels', {});- expect(listed.ok).toBe(true);- });-- it('legacy Webhooks route lands on Connections', async () => {- // The dedicated Webhooks UI was retired. Keep the compatibility route- // covered so old links land on the canonical Connections surface.- await navigateViaHash('/webhooks');-- await browser.waitUntil(- async () =>- String(await browser.execute(() => window.location.hash)).includes('/connections'),- { timeout: 10_000, interval: 500, timeoutMsg: 'Webhooks route did not reach Connections' }- );-- const hash = await browser.execute(() => window.location.hash);- expect(String(hash)).toContain('/connections');- });-});diff --git a/app/test/playwright/specs/core-port-conflict-recovery.spec.ts b/app/test/playwright/specs/core-port-conflict-recovery.spec.tsdeleted file mode 100644index feccb63334..0000000000--- a/app/test/playwright/specs/core-port-conflict-recovery.spec.ts+++ /dev/null@@ -1,17 +0,0 @@-import { expect, test } from '@playwright/test';--import { bootAuthenticatedPage, waitForAppReady } from '../helpers/core-rpc';--test.describe('Core port conflict recovery', () => {- test.beforeEach(async ({ page }, testInfo) => {- const testSlug = testInfo.title.toLowerCase().replace(/[^a-z0-9]+/g, '-');- await bootAuthenticatedPage(page, 'pw-core-port-conflict-' + testSlug, '/home');- });-- test('startup-integrity check reaches a usable screen', async ({ page }) => {- await waitForAppReady(page);- await expect(- page.locator('[data-testid="chat-message-input"], [data-testid="onboarding-welcome-step"]')- ).toBeVisible();- });-});diff --git a/app/test/playwright/specs/tauri-commands.spec.ts b/app/test/playwright/specs/tauri-commands.spec.tsdeleted file mode 100644index 8ba048ef97..0000000000--- a/app/test/playwright/specs/tauri-commands.spec.ts+++ /dev/null@@ -1,40 +0,0 @@-import { expect, test } from '@playwright/test';--import { bootAuthenticatedPage, callCoreRpc, waitForAppReady } from '../helpers/core-rpc';--test.describe('Tauri commands', () => {- test.beforeEach(async ({ page }, testInfo) => {- const slug = testInfo.title.toLowerCase().replace(/[^a-z0-9]+/g, '-');- await bootAuthenticatedPage(page, `pw-tauri-commands-${slug}`, '/home');- });-- test('app chrome is visible', async ({ page }) => {- await waitForAppReady(page);- const text = await page.locator('#root').innerText();- expect(['New Conversation', 'Threads', 'Chat'].some(marker => text.includes(marker))).toBe(- true- );- });-- test('browser lane exposes the core RPC URL and token bootstrap values', async ({ page }) => {- const values = await page.evaluate(() => ({- rpcUrl: window.localStorage.getItem('openhuman_core_rpc_url'),- rpcToken: window.localStorage.getItem('openhuman_core_rpc_token'),- }));- expect(String(values.rpcUrl)).toMatch(/^http:\/\/127\.0\.0\.1:\d+\/rpc$/);- expect((values.rpcToken ?? '').length).toBeGreaterThanOrEqual(16);- });-- test('core.ping succeeds through the same core RPC helper the web lane uses', async () => {- const ping = await callCoreRpc<{ ok?: boolean }>('core.ping', {});- expect(ping.ok).toBe(true);- });-- test('openhuman.about_app_list round-trips over core RPC', async () => {- const res = await callCoreRpc<unknown>('openhuman.about_app_list', {});- const root = (res ?? {}) as Record<string, unknown>;- const payload = root && typeof root === 'object' && 'result' in root ? root.result : root;- expect(Array.isArray(payload)).toBe(true);- expect((payload as unknown[]).length).toBeGreaterThan(0);- });-});