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
fix: stabilize merged E2E suite
Steven Enamakel82efdab03e10
diff --git a/app/src/features/conversations/Conversations.tsx b/app/src/features/conversations/Conversations.tsxindex cc16013b63..af2fa551e2 100644--- a/app/src/features/conversations/Conversations.tsx+++ b/app/src/features/conversations/Conversations.tsx@@ -357,6 +357,10 @@ const Conversations = ({const persistedFailedMessageByThreadRef = useRef<Map<string, ThreadMessage>>(new Map());const createThreadErrorRef = useRef(createThreadError);createThreadErrorRef.current = createThreadError;+ // Startup thread restoration is asynchronous. If the user chooses a thread+ // while its initial `loadThreads` is in flight, that older callback must not+ // overwrite the newer selection when it resolves.+ const threadSelectionIntentRef = useRef(0);const displayedSendError = deriveChatErrorBanner(sendError,createThreadError,@@ -735,9 +739,12 @@ const Conversations = ({// foreground turn's timer alive.const turnSignatureByThreadRef = useRef<Map<string, readonly unknown[]>>(new Map());- const handleCreateNewThread = async () => {+ const handleCreateNewThread = async (fromInitialLoad = false) => {+ if (!fromInitialLoad) threadSelectionIntentRef.current += 1;+ const selectionIntentAtCreate = threadSelectionIntentRef.current;try {const thread = await dispatch(createNewThread()).unwrap();+ if (threadSelectionIntentRef.current !== selectionIntentAtCreate) return;dispatch(setSelectedThread(thread.id));void dispatch(loadThreadMessages(thread.id));if (shouldSyncChatRoute) {@@ -834,11 +841,12 @@ const Conversations = ({useEffect(() => {let cancelled = false;+ const selectionIntentAtLoad = threadSelectionIntentRef.current;void dispatch(loadThreads()).unwrap().then(data => {- if (cancelled) return;+ if (cancelled || threadSelectionIntentRef.current !== selectionIntentAtLoad) return;// Match the sidebar's default General filter here so initial/resume// selection can't auto-pick a thread hidden by the selected tab.const visibleThreads = data.threads.filter(t => isThreadVisibleInTab(t, GENERAL_TAB_VALUE));@@ -891,7 +899,7 @@ const Conversations = ({dispatch(setSelectedThread(emptyThread.id));void dispatch(loadThreadMessages(emptyThread.id));} else {- void handleCreateNewThread();+ void handleCreateNewThread(true);}}).catch(err => {@@ -1932,6 +1940,7 @@ const Conversations = ({selectedThreadId={selectedThreadId ?? null}onCreateThread={() => void handleCreateNewThread()}onSelectThread={id => {+ threadSelectionIntentRef.current += 1;dispatch(setSelectedThread(id));void dispatch(loadThreadMessages(id));if (shouldSyncChatRoute) {@@ -2345,6 +2354,7 @@ const Conversations = ({type="button"data-analytics-id="chat-header-back-to-parent-thread"onClick={() => {+ threadSelectionIntentRef.current += 1;dispatch(setSelectedThread(selectedThreadParent.id));void dispatch(loadThreadMessages(selectedThreadParent.id));navigate(chatThreadPath(selectedThreadParent.id));diff --git a/app/src/pages/onboarding/pages/CustomInferencePage.tsx b/app/src/pages/onboarding/pages/CustomInferencePage.tsxindex 14e1148016..6134c5f89c 100644--- a/app/src/pages/onboarding/pages/CustomInferencePage.tsx+++ b/app/src/pages/onboarding/pages/CustomInferencePage.tsx@@ -1,6 +1,7 @@import { useState } from 'react';import AIPanel from '../../../components/settings/panels/AIPanel';+import WhatLeavesLink from '../../../features/privacy/WhatLeavesLink';import { useT } from '../../../lib/i18n/I18nContext';import CustomWizardConfigPage from './CustomWizardConfigPage';@@ -25,7 +26,14 @@ const CustomInferencePage = () => {backRoute="/"continueDisabled={dirty}continueHint={dirty ? t('onboarding.custom.unsavedChanges') : undefined}- configureContent={<AIPanel embedded hideTabChrome onDirtyChange={setDirty} />}+ configureContent={+ <div className="space-y-4">+ <AIPanel embedded hideTabChrome onDirtyChange={setDirty} />+ <div className="flex justify-center">+ <WhatLeavesLink />+ </div>+ </div>+ }/>);};diff --git a/app/test/e2e/specs/japanese-locale.browser.ts b/app/test/e2e/specs/japanese-locale.browser.tsindex dff5ca5653..d94fc63f79 100644--- a/app/test/e2e/specs/japanese-locale.browser.ts+++ b/app/test/e2e/specs/japanese-locale.browser.ts@@ -24,6 +24,9 @@ async function localSettings(page: BrowserPage, user: string) {userId: 'local',user: { _id: 'local', id: 'local', name: 'Local User', email: '[email protected]' },});+ // Installing a local credential intentionally returns onboarding to its+ // incomplete state. This test starts from an established local session.+ await callCoreRpc('openhuman.config_set_onboarding_completed', { value: true });await page.reload();await waitForAppReady(page);await dismissWalkthroughIfPresent(page);@@ -88,37 +91,33 @@ test.describe('Japanese UI locale', () => {}) => {const fixtures: Record<string, unknown> = {'openhuman.memory_engine_get': {- result: { engine: 'tinycortex', has_key: true, status: 'ready', fetch_modes: [] },- logs: [],+ engine: 'tinycortex',+ has_key: true,+ status: 'ready',+ fetch_modes: [],},- 'openhuman.memory_engines_list': { result: { engines: [] }, logs: [] },+ 'openhuman.memory_engines_list': { engines: [] },'openhuman.memory_explore': {- result: {- facet: 'kind',- buckets: [{ value: 'document', count: 7 }],- total: 7,- missing: 0,- more_buckets: 0,- truncated: false,- },- logs: [],+ facet: 'kind',+ buckets: [{ value: 'document', count: 7 }],+ total: 7,+ missing: 0,+ more_buckets: 0,+ truncated: false,},- 'openhuman.memory_items_list': { result: { items: [] }, logs: [] },+ 'openhuman.memory_items_list': { items: [] },'openhuman.tokenjuice_savings_stats': {- result: {- attributionModel: 'Qwen3.8-Flash-Next',- total: {- events: 3,- originalTokens: 1000,- compactedTokens: 500,- tokensSaved: 500,- costSavedUsd: 0,- },- byModel: {},- byCompressor: {},- cache: { entries: 0, bytes: 0 },+ attributionModel: 'Qwen3.8-Flash-Next',+ total: {+ events: 3,+ originalTokens: 1000,+ compactedTokens: 500,+ tokensSaved: 500,+ costSavedUsd: 0,},- logs: [],+ byModel: {},+ byCompressor: {},+ cache: { entries: 0, bytes: 0 },},};// Only data-dependent read results are fixtures; authentication, localediff --git a/app/test/playwright/helpers/chat-drive.ts b/app/test/playwright/helpers/chat-drive.tsindex aeab733a9e..6ab6ffc68c 100644--- a/app/test/playwright/helpers/chat-drive.ts+++ b/app/test/playwright/helpers/chat-drive.ts@@ -255,9 +255,9 @@ export async function startNewThread(page: Page): Promise<string> {const previous = await selectedThreadId(page);const sidebar = page.getByTestId('new-thread-sidebar-button');if (await sidebar.isVisible().catch(() => false)) {- await sidebar.click({ force: true });+ await sidebar.click();} else {- await page.getByTestId('new-thread-button').click({ force: true });+ await page.getByTestId('new-thread-button').click();}await expect.poll(async () => selectedThreadId(page), { timeout: 20_000 }).not.toBe(previous);return waitForSelectedThreadId(page);diff --git a/app/test/playwright/helpers/core-rpc.ts b/app/test/playwright/helpers/core-rpc.tsindex 005fa02a06..6f536c4512 100644--- a/app/test/playwright/helpers/core-rpc.ts+++ b/app/test/playwright/helpers/core-rpc.ts@@ -246,6 +246,41 @@ export async function waitForAppReady(page: Page): Promise<void> {page.evaluate(() => document.querySelector('[data-testid="boot-check-picker"]') !== null)).toBe(false);++ // Harness setup can install runtimes on a cold core. It deliberately blocks+ // user input behind a full-screen dialog until the user chooses to continue+ // in the background, so settle that product flow before a spec drives UI.+ const init = await callCoreRpc<{ snapshot?: { overall?: string; started_at?: string | null } }>(+ 'openhuman.harness_init_status'+ );+ if (init.snapshot?.overall === 'running' || init.snapshot?.overall === 'failed') {+ const alreadyDismissed = await page.evaluate(+ startedAt =>+ window.sessionStorage.getItem('harness-init-dismissed-run') === (startedAt ?? 'unkeyed'),+ init.snapshot.started_at+ );+ if (alreadyDismissed) return;++ const continueButton = page.getByRole('button', { name: /Run in background|Continue anyway/ });+ await expect+ .poll(+ async () => {+ if (await continueButton.isVisible().catch(() => false)) return true;+ const current = await callCoreRpc<{ snapshot?: { overall?: string } }>(+ 'openhuman.harness_init_status'+ );+ return current.snapshot?.overall === 'done' || current.snapshot?.overall === 'idle';+ },+ { timeout: 10_000 }+ )+ .toBe(true);+ if (await continueButton.isVisible().catch(() => false)) {+ await continueButton.click();+ await expect(page.getByRole('dialog', { name: 'Setting things up' })).toBeHidden({+ timeout: 5_000,+ });+ }+ }}export async function dismissWalkthroughIfPresent(page: Page): Promise<void> {diff --git a/app/test/playwright/specs/chat-composer-primary-slot.spec.ts b/app/test/playwright/specs/chat-composer-primary-slot.spec.tsindex 38963983c7..81d05cbc7d 100644--- a/app/test/playwright/specs/chat-composer-primary-slot.spec.ts+++ b/app/test/playwright/specs/chat-composer-primary-slot.spec.ts@@ -20,19 +20,20 @@* <AuiIf condition={s => !s.thread.isRunning}>* {showIdleAction ? <ComposerIdleAction/> : <Send/>} thread.tsx:548-594* </AuiIf>- * <AuiIf condition={s => s.thread.isRunning}>- * <Stop/> thread.tsx:596-608+ * <AuiIf condition={s => s.thread.isRunning && s.composer.text.trim().length > 0}>+ * <Queue/> thread.tsx:1392-1404+ * </AuiIf>+ * <AuiIf condition={s => s.thread.isRunning && s.composer.text.trim().length === 0}>+ * <Stop/> thread.tsx:1408-1422* </AuiIf>** showIdleAction = !!ComposerIdleAction* && composerText.trim().length === 0* && !hasComposerAttachments thread.tsx:494-495*- * Note what is NOT there: the live Stop condition has **no typed-content- * term**. The legacy composer reverts Stop to Send once a follow-up is typed- * (`ChatComposer.tsx:252-253`); the shipped one does not. This spec asserts the- * shipped behaviour, and says so, so a future reader does not "fix" the test- * toward the legacy rule.+ * While a turn is running, typed text is a queued follow-up, so Queue takes the+ * primary slot and Stop is hidden. With an empty composer, Stop owns the slot.+ * The tests below pin both states on the shipped assistant-ui composer.** Assertions are on which control is mounted and on the contenteditable's* rendered text — never on a mock call. `toHaveValue()` is unusable here: the@@ -180,19 +181,14 @@ test.describe('Chat composer primary slot', () => {await expect(idleAction(page)).toHaveCount(0);});- test('Stop stays mounted while a follow-up is typed mid-stream', async ({ page }) => {- // The behavioural difference from the legacy composer, pinned deliberately.- // `ChatComposer.tsx:252-253` reverts Stop to Send once `hasTypedContent`;- // the shipped composer's Stop is `AuiIf(isRunning)` with no typed-content- // term, so typing must NOT disarm it. If this ever starts failing, the app- // has adopted the legacy rule — which may be desirable, but is a product- // change and should not be absorbed by editing this expectation quietly.+ test('a follow-up is queued while the turn runs', async ({ page }) => {await openChat(page);await beginStreamingTurn(page, 'Count slowly for me');await typeIntoComposer(page, 'and then summarise it');- await expect(stopButton(page)).toBeVisible();+ await expect(page.getByTestId('queue-message-button')).toBeVisible();+ await expect(stopButton(page)).toHaveCount(0);await expect(sendButton(page)).toHaveCount(0);});diff --git a/app/test/playwright/specs/chat-tool-error-recovery.spec.ts b/app/test/playwright/specs/chat-tool-error-recovery.spec.tsindex 45f60de124..51292ae3f8 100644--- a/app/test/playwright/specs/chat-tool-error-recovery.spec.ts+++ b/app/test/playwright/specs/chat-tool-error-recovery.spec.ts@@ -100,7 +100,6 @@ async function sendMessage(page: Page, prompt: string): Promise<void> {await waitForSocketConnected(page);await dismissWalkthroughIfPresent(page);await page.getByTestId('chat-message-input').fill(prompt);- await dismissWalkthroughIfPresent(page);await expect(page.getByTestId('send-message-button')).toBeEnabled();await page.getByTestId('send-message-button').click();}@@ -116,14 +115,14 @@ test.describe('Chat Tool Error Recovery', () => {await setMockBehavior('llmKeywordRules',JSON.stringify([- {- keyword: 'Tell me something important.',- streamScript: [{ text: 'Starting to answer', delayMs: 30 }, { error: 'invalid API key' }],- },{keyword: 'Please try again with a fresh answer.',streamScript: [{ text: `Recovery successful: ${RECOVERY_CANARY}` }, { finish: 'stop' }],},+ {+ keyword: 'Tell me something important.',+ streamScript: [{ text: 'Starting to answer', delayMs: 30 }, { error: 'invalid API key' }],+ },]));diff --git a/app/test/playwright/specs/chat-user-message-edit-affordance.spec.ts b/app/test/playwright/specs/chat-user-message-edit-affordance.spec.tsindex d7d05c745a..ccb1e947ab 100644--- a/app/test/playwright/specs/chat-user-message-edit-affordance.spec.ts+++ b/app/test/playwright/specs/chat-user-message-edit-affordance.spec.ts@@ -144,7 +144,7 @@ test.describe('User-message action bar — capability-gated affordances (#5897)'// behaviour is a separate feature this PR does not touch, and testing it// here would need clipboard permissions and would not make the control any// stronger.- await expect(page.getByRole('button', { name: 'Copy response' })).toBeVisible();+ await expect(page.getByRole('button', { name: 'Copy message' })).toBeVisible();});test.skip('no branch picker is offered while the runtime cannot switch branches', async ({diff --git a/app/test/playwright/specs/connector-session-guard-matrix.spec.ts b/app/test/playwright/specs/connector-session-guard-matrix.spec.tsindex e62091cef4..1b913fad3d 100644--- a/app/test/playwright/specs/connector-session-guard-matrix.spec.ts+++ b/app/test/playwright/specs/connector-session-guard-matrix.spec.ts@@ -116,7 +116,7 @@ test.describe('Connector session guard matrix', () => {page,}) => {const card = page.getByTestId(`skill-install-composio-${toolkit.slug}`);- await expect(card).toContainText(toolkit.name);+ await expect(card).toContainText(toolkit.name, { timeout: 30_000 });await card.click();await expect(page.getByRole('dialog', { name: new RegExp(toolkit.name, 'i') })).toBeVisible();await page.keyboard.press('Escape');diff --git a/app/test/playwright/specs/gmail-flow.spec.ts b/app/test/playwright/specs/gmail-flow.spec.tsindex a6a1379d62..33c630f925 100644--- a/app/test/playwright/specs/gmail-flow.spec.ts+++ b/app/test/playwright/specs/gmail-flow.spec.ts@@ -65,11 +65,13 @@ async function bootSkillsPage(page: Page, userId: string) {localStorage.setItem('openhuman:walkthrough_completed', 'true');localStorage.removeItem('openhuman:walkthrough_pending');} catch {}- // Phase 2: /skills → /connections- window.location.hash = '/connections';});await waitForAppReady(page);await dismissWalkthroughIfPresent(page);+ // Navigate through the shell after sign-in: startup route restoration can+ // otherwise replace a hash assigned during the authenticated boot.+ await page.getByRole('button', { name: 'Connections' }).click();+ await expect(page).toHaveURL(/#\/connections/);// Tab is "Apps"; the grid renders in the composio-integrations-card container.await page.getByTestId('two-pane-nav-composio').click();// Wait for the Apps tab grid container to be visible.diff --git a/app/test/playwright/specs/onboarding-config-functional.spec.ts b/app/test/playwright/specs/onboarding-config-functional.spec.tsindex c7883e301c..2aaa4ed31e 100644--- a/app/test/playwright/specs/onboarding-config-functional.spec.ts+++ b/app/test/playwright/specs/onboarding-config-functional.spec.ts@@ -1,35 +1,31 @@import { expect, type Page, test } from '@playwright/test';import {+ bootRuntimeReadyGuestPage,callCoreRpc,dismissWalkthroughIfPresent,- seedBrowserCoreMode,waitForAppReady,} from '../helpers/core-rpc';-async function resetOnboarding(userId: string): Promise<void> {- await callCoreRpc('openhuman.auth_clear_session', {});- await callCoreRpc('openhuman.config_set_onboarding_completed', { value: false });+async function bootIntoOnboarding(page: Page, userId: string): Promise<void> {+ await bootRuntimeReadyGuestPage(page);await callCoreRpc('openhuman.auth_store_session', {token: `eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.${Buffer.from(JSON.stringify({ sub: userId, userId, exp: Math.floor(Date.now() / 1000) + 3600 })- ).toString('base64url')}.sig`,+ ).toString('base64url')}.local`,+ userId,+ user: { _id: 'local', id: 'local', name: 'Local User', email: '[email protected]' },});+ await callCoreRpc('openhuman.config_set_onboarding_completed', { value: false });+ await page.goto('/#/onboarding/custom/inference');+ await page.reload();+ await waitForAppReady(page);+ await dismissWalkthroughIfPresent(page);}test.describe('Onboarding custom configuration flow', () => {test('advanced path supports back navigation through final setup', async ({ page }) => {- await resetOnboarding('pw-onboarding-config');- await seedBrowserCoreMode(page);- await page.goto('/#/onboarding/welcome');- await waitForAppReady(page);- await dismissWalkthroughIfPresent(page);-- await expect(page.getByTestId('onboarding-welcome-step')).toBeVisible();- await page.getByRole('button', { name: 'Get Started' }).click();- await expect(page.getByTestId('onboarding-runtime-choice-step')).toBeVisible();- await page.getByTestId('onboarding-runtime-choice-custom').click();- await page.getByTestId('onboarding-next-button').click();+ await bootIntoOnboarding(page, 'pw-onboarding-config');await expect(page.getByTestId('onboarding-custom-inference-step')).toBeVisible();await page.getByTestId('onboarding-next-button').click();diff --git a/app/test/playwright/specs/onboarding-modes.spec.ts b/app/test/playwright/specs/onboarding-modes.spec.tsindex 124133aac1..f1f6868196 100644--- a/app/test/playwright/specs/onboarding-modes.spec.ts+++ b/app/test/playwright/specs/onboarding-modes.spec.ts@@ -1,6 +1,6 @@import { expect, type Page, test } from '@playwright/test';-import { bootAuthenticatedPage, callCoreRpc, waitForAppReady } from '../helpers/core-rpc';+import { bootRuntimeReadyGuestPage, callCoreRpc, waitForAppReady } from '../helpers/core-rpc';const MOCK_ADMIN_BASE = `http://127.0.0.1:${process.env.E2E_MOCK_PORT || '18473'}`;@@ -12,10 +12,6 @@ async function resetMock(): Promise<void> {});}-async function clickOnboardingNext(page: Page): Promise<void> {- await page.getByTestId('onboarding-next-button').click();-}-async function clickTestId(page: Page, testId: string, timeout = 10_000): Promise<boolean> {const locator = page.getByTestId(testId);try {@@ -28,15 +24,24 @@ async function clickTestId(page: Page, testId: string, timeout = 10_000): Promis}}-async function bootIntoOnboarding(page: Page, userId: string): Promise<void> {+async function bootLocalOnboarding(page: Page, userId: string): Promise<void> {await resetMock().catch(() => undefined);- await bootAuthenticatedPage(page, userId, '/home');+ await bootRuntimeReadyGuestPage(page);+ const payload = Buffer.from(+ JSON.stringify({ sub: userId, userId, exp: Math.floor(Date.now() / 1000) + 3600 })+ ).toString('base64url');+ await callCoreRpc('openhuman.auth_store_session', {+ token: `eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.${payload}.local`,+ userId,+ user: { _id: 'local', id: 'local', name: 'Local User', email: '[email protected]' },+ });await callCoreRpc('openhuman.config_set_onboarding_completed', { value: false });- await page.goto('/#/onboarding/welcome');+ await page.goto('/#/onboarding/custom/inference');+ await page.reload();await waitForAppReady(page);await expect.poll(async () => page.evaluate(() => window.location.hash), { timeout: 20_000 })- .toMatch(/^#\/onboarding/);+ .toMatch(/^#\/onboarding\/custom\/inference/);}async function expectOnboardingCompleted(): Promise<void> {@@ -75,43 +80,40 @@ async function ensureHomeOrForceComplete(page: Page): Promise<void> {}test.describe('Onboarding modes', () => {- test('simple cloud path goes welcome -> runtime choice -> home', async ({ page }) => {- await bootIntoOnboarding(page, 'pw-onboarding-cloud');-- await expect(page.getByTestId('onboarding-welcome-step')).toBeVisible();- expect(await clickTestId(page, 'onboarding-next-button')).toBe(true);-- await expect(page.getByTestId('onboarding-runtime-choice-step')).toBeVisible();- expect(await clickTestId(page, 'onboarding-runtime-choice-cloud')).toBe(true);- await expect(page.getByTestId('onboarding-runtime-choice-cloud')).toHaveAttribute(- 'aria-pressed',- 'true'- );- expect(await clickTestId(page, 'onboarding-next-button')).toBe(true);-- await ensureHomeOrForceComplete(page);- await expectOnboardingCompleted();+ test('TinyHumans sessions land directly in chat', async ({ page }) => {+ await resetMock().catch(() => undefined);+ await bootRuntimeReadyGuestPage(page);+ const payload = Buffer.from(+ JSON.stringify({+ sub: 'pw-onboarding-cloud',+ userId: 'pw-onboarding-cloud',+ exp: Math.floor(Date.now() / 1000) + 3600,+ })+ ).toString('base64url');+ await callCoreRpc('openhuman.auth_store_session', {+ token: `eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.${payload}.sig`,+ userId: 'pw-onboarding-cloud',+ user: {+ _id: 'pw-onboarding-cloud',+ id: 'pw-onboarding-cloud',+ displayName: 'Playwright User',+ },+ });+ await page.goto('/#/home');+ await waitForAppReady(page);+ await expect.poll(() => page.evaluate(() => window.location.hash)).toMatch(/^#\/chat/);});test('advanced custom path walks the three custom wizard steps and finishes on home', async ({page,}) => {- await bootIntoOnboarding(page, 'pw-onboarding-custom');-- expect(await clickTestId(page, 'onboarding-next-button')).toBe(true);- await expect(page.getByTestId('onboarding-runtime-choice-step')).toBeVisible();- expect(await clickTestId(page, 'onboarding-runtime-choice-custom')).toBe(true);- await expect(page.getByTestId('onboarding-runtime-choice-custom')).toHaveAttribute(- 'aria-pressed',- 'true'- );- expect(await clickTestId(page, 'onboarding-next-button')).toBe(true);+ await bootLocalOnboarding(page, 'pw-onboarding-custom');await expect(page.getByTestId('onboarding-custom-inference-step')).toBeVisible();expect(await clickTestId(page, 'onboarding-next-button')).toBe(true);await expect(page.getByTestId('onboarding-custom-search-step')).toBeVisible();- expect(await clickTestId(page, 'onboarding-next-button')).toBe(true);+ expect(await clickTestId(page, 'onboarding-search-skip')).toBe(true);await expect(page.getByTestId('onboarding-custom-vault-step')).toBeVisible();// Voice, OAuth and embeddings are no longer wizard steps.diff --git a/app/test/playwright/specs/privacy-what-leaves-sheet.spec.ts b/app/test/playwright/specs/privacy-what-leaves-sheet.spec.tsindex 523a3b7e59..0c7d7cf323 100644--- a/app/test/playwright/specs/privacy-what-leaves-sheet.spec.ts+++ b/app/test/playwright/specs/privacy-what-leaves-sheet.spec.ts@@ -1,6 +1,6 @@import { expect, type Page, test } from '@playwright/test';-import { bootAuthenticatedPage, callCoreRpc, waitForAppReady } from '../helpers/core-rpc';+import { bootRuntimeReadyGuestPage, callCoreRpc, waitForAppReady } from '../helpers/core-rpc';/*** The "what leaves my computer" sheet, driven in a real browser.@@ -27,8 +27,8 @@ import { bootAuthenticatedPage, callCoreRpc, waitForAppReady } from '../helpers/* the description wiring alongside whatever else it drives, so that each one* fails if the rewrite is reverted rather than merely re-passing.*- * The sheet is reachable from exactly one place — `WelcomeStep.tsx:28`, the- * onboarding welcome step — so these boot into onboarding rather than settings.+ * The sheet is reachable during provider setup in local onboarding, so these+ * boot into that step rather than the managed-session chat shell.*/const HEADLINE = 'Local by default. Cloud when you ask.';@@ -36,14 +36,25 @@ const SUBHEAD = "For full transparency, here's exactly what does, and when.";const TRIGGER = 'What leaves my computer?';async function bootIntoOnboardingWelcome(page: Page, userId: string): Promise<void> {- await bootAuthenticatedPage(page, userId, '/home');+ await bootRuntimeReadyGuestPage(page);+ const payload = Buffer.from(+ JSON.stringify({ sub: userId, userId, exp: Math.floor(Date.now() / 1000) + 3600 })+ ).toString('base64url');+ await callCoreRpc('openhuman.auth_store_session', {+ token: `eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.${payload}.local`,+ userId,+ user: { _id: 'local', id: 'local', name: 'Local User', email: '[email protected]' },+ });await callCoreRpc('openhuman.config_set_onboarding_completed', { value: false });- await page.goto('/#/onboarding/welcome');+ await page.goto('/#/onboarding/custom/inference');+ await page.reload();await waitForAppReady(page);await expect.poll(async () => page.evaluate(() => window.location.hash), { timeout: 20_000 })- .toMatch(/^#\/onboarding/);- await expect(page.getByTestId('onboarding-welcome-step')).toBeVisible({ timeout: 20_000 });+ .toMatch(/^#\/onboarding\/custom\/inference/);+ await expect(page.getByTestId('onboarding-custom-inference-step')).toBeVisible({+ timeout: 20_000,+ });}const sheet = (page: Page) => page.getByRole('dialog');@@ -90,7 +101,7 @@ test.describe('Privacy — the "what leaves my computer" sheet', () => {// library swap loses quietly.await page.keyboard.press('Escape');await expect(sheet(page)).toHaveCount(0, { timeout: 10_000 });- await expect(page.getByTestId('onboarding-welcome-step')).toBeVisible();+ await expect(page.getByTestId('onboarding-custom-inference-step')).toBeVisible();});test('clicking the overlay outside the panel closes it', async ({ page }) => {@@ -101,6 +112,6 @@ test.describe('Privacy — the "what leaves my computer" sheet', () => {// and capped at `max-w-lg`.await page.mouse.click(5, 5);await expect(sheet(page)).toHaveCount(0, { timeout: 10_000 });- await expect(page.getByTestId('onboarding-welcome-step')).toBeVisible();+ await expect(page.getByTestId('onboarding-custom-inference-step')).toBeVisible();});});diff --git a/app/test/playwright/specs/skills-registry.spec.ts b/app/test/playwright/specs/skills-registry.spec.tsindex 4f0530732f..51aedd9111 100644--- a/app/test/playwright/specs/skills-registry.spec.ts+++ b/app/test/playwright/specs/skills-registry.spec.ts@@ -16,9 +16,9 @@ async function openSkillsPage(page: Page, userId: string) {localStorage.setItem('openhuman:walkthrough_completed', 'true');localStorage.removeItem('openhuman:walkthrough_pending');} catch {}- // /skills redirects to /connections (Phase 2 rename)- window.location.hash = '/connections';});+ // Startup route restoration can replace a hash assigned during sign-in.+ await page.getByRole('button', { name: 'Connections' }).click();await expect.poll(async () => page.evaluate(() => window.location.hash), { timeout: 10_000 }).toContain('/connections');diff --git a/app/test/playwright/specs/skills-search-install.spec.ts b/app/test/playwright/specs/skills-search-install.spec.tsindex 83a4dfece3..3f60b35298 100644--- a/app/test/playwright/specs/skills-search-install.spec.ts+++ b/app/test/playwright/specs/skills-search-install.spec.ts@@ -218,7 +218,9 @@ test.describe('Skills explorer — the install button', () => {async function firstInstallButton(page: import('@playwright/test').Page) {const button = page.locator('[data-testid^="registry-install-"]').first();await expect(button).toBeVisible({ timeout: 20_000 });- return button;+ const testId = await button.getAttribute('data-testid');+ expect(testId).toBeTruthy();+ return page.getByTestId(testId!);}test('offers Install, and the button is enabled before it is pressed', async ({ page }) => {@@ -238,6 +240,9 @@ test.describe('Skills explorer — the install button', () => {release = resolve;});+ await openSkillsTab(page, 'pw-skills-install-inflight');+ const button = await firstInstallButton(page);+await page.route('**/rpc', async (route, request) => {let method = '';try {@@ -251,8 +256,6 @@ test.describe('Skills explorer — the install button', () => {await route.continue();});- await openSkillsTab(page, 'pw-skills-install-inflight');- const button = await firstInstallButton(page);await button.click();await expect(button).toBeDisabled({ timeout: 10_000 });@@ -277,6 +280,10 @@ test.describe('Skills explorer — the install button', () => {});let installBody: { id?: unknown } = {};+ await openSkillsTab(page, 'pw-skills-install-fail');+ const button = await firstInstallButton(page);+ await expect(button).toBeEnabled();+await page.route('**/rpc', async (route, request) => {let body: { method?: string; id?: unknown } = {};try {@@ -301,9 +308,6 @@ test.describe('Skills explorer — the install button', () => {await route.continue();});- await openSkillsTab(page, 'pw-skills-install-fail');- const button = await firstInstallButton(page);- await expect(button).toBeEnabled();await button.click();// The pending state must actually be reached before the failure.diff --git a/app/test/playwright/specs/zz-onboarding-screens.spec.ts b/app/test/playwright/specs/zz-onboarding-screens.spec.tsindex eb7417945a..8ca84f3aad 100644--- a/app/test/playwright/specs/zz-onboarding-screens.spec.ts+++ b/app/test/playwright/specs/zz-onboarding-screens.spec.ts@@ -6,7 +6,7 @@*/import { type Page, test } from '@playwright/test';-import { bootAuthenticatedPage, callCoreRpc, waitForAppReady } from '../helpers/core-rpc';+import { bootRuntimeReadyGuestPage, callCoreRpc, waitForAppReady } from '../helpers/core-rpc';/*** A local ("Continue Locally") session token: three segments whose last is@@ -31,13 +31,15 @@ function localSessionToken(): string {const OUT = 'test-results/onboarding-screens';async function bootIntoOnboarding(page: Page, userId: string): Promise<void> {- await bootAuthenticatedPage(page, userId, '/home');+ await bootRuntimeReadyGuestPage(page);+ await callCoreRpc('openhuman.auth_store_session', {+ token: localSessionToken(),+ userId,+ user: { _id: 'local', id: 'local', name: 'Local User', email: '[email protected]' },+ });await callCoreRpc('openhuman.config_set_onboarding_completed', { value: false });- const token = localSessionToken();- await page.evaluate(t => {- window.localStorage.setItem('openhuman_session_token', t);- }, token);await page.goto('/#/onboarding/custom/inference');+ await page.reload();await waitForAppReady(page);}