Skip to content

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

test: audit and repair skipped Playwright E2E coverage (#8178)

Steven Enamakel336b372044f7
diff --git a/app/src/features/conversations/Conversations.tsx b/app/src/features/conversations/Conversations.tsx
index c0a7264062..b72094af5c 100644
--- a/app/src/features/conversations/Conversations.tsx
+++ b/app/src/features/conversations/Conversations.tsx
@@ -635,7 +635,7 @@ const Conversations = ({
let cancelled = false;
(async () => {
try {
- const hint = composerModelOverride ?? CHAT_MODEL_HINT;
+ const hint = composerModelOverride ?? persistedDefaultModel ?? CHAT_MODEL_HINT;
const res = await callCoreRpc<{ model: string }>({
method: 'openhuman.inference_resolve_model',
params: { hint },
@@ -652,7 +652,7 @@ const Conversations = ({
return () => {
cancelled = true;
};
- }, [composerModelOverride]);
+ }, [composerModelOverride, persistedDefaultModel]);
// One-shot guard for the Stop/ESC partial-preservation path (#4862): request
// ids whose partial reply has already been persisted, so a repeated Stop/ESC
@@ -2297,7 +2297,7 @@ const Conversations = ({
: 'flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden'
}>
<AssistantUiChat
- model={composerModelOverride ?? resolvedModel ?? CHAT_MODEL_HINT}
+ model={composerModelOverride ?? persistedDefaultModel ?? resolvedModel ?? CHAT_MODEL_HINT}
modelContextWindow={composerModelContextWindow}
composerHeader={assistantComposerHeader}
composerFooterExtras={assistantComposerFooterExtras}
diff --git a/app/test/playwright/specs/assistant-ui-schedule-card.spec.ts b/app/test/playwright/specs/assistant-ui-schedule-card.spec.ts
deleted file mode 100644
index 69a5073113..0000000000
--- a/app/test/playwright/specs/assistant-ui-schedule-card.spec.ts
+++ /dev/null
@@ -1,177 +0,0 @@
-/**
- * `schedule-card` — the card a `cron_*` tool call renders instead of raw JSON.
- *
- * Family: `components/assistant-ui/elements/schedule-card.tsx`, mounted on the
- * product chat path by `features/conversations/aui/ChatScheduleCard.tsx`, which
- * `aui/toolkit.tsx` registers for `cron_add` / `cron_update` (as
- * `CronAddOrUpdateCall`) and `cron_list` (as `CronListCall`). Zero e2e coverage
- * before this spec.
- *
- * The agent really calls the tool here. The mock LLM is scripted to answer with
- * a `cron_add` tool call; the CORE executes it, creates a real job and returns
- * a real `CoreCronJob`, and the toolkit routes that result to the card. Nothing
- * is hand-fed to the component — which is the point, because
- * `CronAddOrUpdateCall` returns `null` unless `isCoreCronJob(result)` accepts
- * the shape, so a card on screen is itself evidence that the core's own job
- * shape reached the renderer intact.
- *
- * ⚠️ STATUS 2026-09-24: THIS SPEC DOES NOT PASS YET, and the reason is upstream
- * of anything it asserts. Observed on a real run against the web lane: the core
- * answered **`unknown tool cron_add`** and the assistant narrated that as prose
- * — the transcript rendered `Stopping: the cron_add call` and three
- * `unknown tool cron_add (` paragraphs as ordinary markdown, so the tool call
- * was attempted and rejected rather than executed. No schedule card can render
- * from a call the core refuses.
- *
- * That is the observation, and it is reproducible. The CAUSE is not known. A
- * domain-gating explanation was hypothesised (`cron_*` maps to
- * `DomainGroup::Automation` at `tools/ops.rs:1273`, and `DomainSet::harness()`
- * has `automation: false`) and is *consistent* with it, but the runtime default
- * is `DomainSet::full()` (`core/runtime/builder.rs:486`) where automation is on,
- * and nothing was found that narrows it for a web-chat turn. Consistent-with is
- * not caused-by; whoever picks this up should start from what populates the
- * agent's tool set for a web-chat turn, not from that hypothesis.
- *
- * ⛔ UPSTREAM BREAKAGE, established by a CONTROL rather than by inference:
- * **tool calls do not render in the Playwright web lane on this branch.** The
- * pre-existing `test/playwright/specs/tool-call-presentation.spec.ts` (tracked,
- * last touched by `cd3806b19`, authored by nobody in this round) fails at
- * `expect(page.getByTestId('tool-timeline')).toBeVisible()` — and fails AFTER
- * its canary assertion passes, so the turn completed and the agent replied
- * while no tool call rendered.
- *
- * That control is sound on its own terms: its `beforeEach` boots the page
- * BEFORE the test body sets `llmForcedResponses`, so the ordered-queue hazard
- * (boot-time LLM requests eating queue entries) cannot apply to it, and the
- * canary rendering proves the scripted sequence was consumed by the intended
- * turn.
- *
- * It went unnoticed because that spec DOES run in ci-full's 64-shard sweep, but
- * the job carries `continue-on-error: true` and is excluded from the gate
- * (#3615) — a broken tool-render path fails there invisibly. Which is the
- * regression class a non-blocking lane is built to hide.
- *
- * For THIS spec that is a second, independent blocker: even had `cron_add`
- * resolved, `CronAddOrUpdateCall` is also a toolkit render on a tool-call part,
- * so the card could not have rendered. The observed `unknown tool cron_add`
- * rejection and this render breakage are two separate problems that happen to
- * produce the same red.
- *
- * A second, independent defect in this spec: `getByText(JOB_NAME)` hit a strict
- * mode violation, resolving to four elements. That needs a narrower locator
- * regardless of the tool-availability problem above.
- *
- * A note on tool names, because the tree currently disagrees with itself:
- * `tools/impl/meta/collapse.rs`'s header says the scheduler surface "is a
- * single `cronjob` tool". It is not. `crates/openhuman-core/src/cron/tools/*.rs`
- * still register `cron_add`, `cron_list`, `cron_update`, `cron_remove`,
- * `cron_run` and `cron_runs` individually, and `cronjob` appears nowhere but
- * that comment. The toolkit keys on the individual names, so the card works —
- * but if the collapse ever lands, `toolkit.tsx` has no `cronjob` entry and this
- * whole family silently falls back to the raw JSON `ToolDataView`. This spec
- * would catch that.
- */
-import { expect, type Page, test } from '@playwright/test';
-
-import { resetMock, sendTurn, setKeywordRules, startNewThread } from '../helpers/chat-drive';
-import { bootAuthenticatedPage, dismissWalkthroughIfPresent } from '../helpers/core-rpc';
-
-const USER_ID = 'pw-aui-schedule-card';
-
-const TRIGGER = 'SCHEDULE-CARD please';
-const JOB_NAME = 'aui-schedule-card-canary';
-/** 03:00 daily. Distinctive enough not to collide with a seeded job. */
-const CRON_EXPR = '0 3 * * *';
-
-const RULES = [
- {
- keyword: 'SCHEDULE-CARD',
- toolCalls: [
- {
- name: 'cron_add',
- arguments: {
- name: JOB_NAME,
- // `tz` omitted entirely: the core treats a timezone-less cron as
- // HOST LOCAL, not UTC (`cron.tz = null` -> host local). See the
- // scope note at the bottom of this file for why the resulting
- // `next_run` instant is not asserted here.
- schedule: { kind: 'cron', expr: CRON_EXPR },
- command: 'echo aui-schedule-card',
- },
- },
- ],
- },
-];
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible({ timeout: 30_000 });
-}
-
-test.beforeEach(async () => {
- await resetMock();
- await setKeywordRules(RULES);
-});
-
-test.describe('assistant-ui schedule card', () => {
- // The web orchestrator no longer exposes raw cron_* calls; scheduling is a
- // specialist hand-off. Keep this contract test documented, but skip it in
- // the product lane until it is rewritten against that hand-off surface.
- test.skip(true, 'legacy direct cron_* surface; scheduling now uses a specialist hand-off');
-
- test('a cron_add tool call renders as a schedule card carrying the job it created', async ({
- page,
- }) => {
- await openChat(page);
- const threadId = await startNewThread(page);
-
- await sendTurn(page, threadId, TRIGGER);
-
- // The card has no testid of its own, so it is located by the job name the
- // tool call asked for — which is also the assertion: `ScheduleCard` is fed
- // `name={job.name ?? job.command}`, so this text appearing means the core's
- // returned job, not the request, reached the element.
- const card = page.getByText(JOB_NAME, { exact: false });
- await expect(card).toBeVisible({ timeout: 45_000 });
-
- // `cadence={cadenceOf(job)}` returns `job.schedule.expr` for a cron
- // schedule. Asserting the expression separately from the name matters:
- // a card that rendered the name but lost the schedule would still look
- // right in a screenshot and be useless.
- await expect(page.getByText(CRON_EXPR, { exact: false })).toBeVisible({ timeout: 15_000 });
-
- // What separates "the card rendered" from "the text is on screen
- // somewhere": if the toolkit entry were removed or the tool renamed (see
- // the collapse note above), the call would still render — as a JSON blob
- // via `tools/ToolDataView.tsx` containing these same strings — and both
- // assertions above would still pass.
- //
- // `ToolDataView` has NO testid, so asserting the absence of one would be
- // vacuously true and would pass whatever rendered. Assert the card's own
- // positive signature instead: `ScheduleCard` renders a `role="switch"`
- // pause/resume control labelled `Pause <name>` (`schedule-card.tsx:36-37`,
- // `:70-74`). The JSON fallback renders a `<dl>`/`<ul>` and has no switch,
- // so this locator can only resolve inside the real element.
- await expect(page.getByRole('switch', { name: `Pause ${JOB_NAME}` })).toBeVisible({
- timeout: 15_000,
- });
- });
-});
-
-/**
- * NOT asserted here, deliberately: that a timezone-less cron is scheduled in
- * host-local time rather than UTC.
- *
- * The claim is real and worth a test — `tz: null` means host local, and reading
- * it as UTC silently moves every such job by the host's offset. But the instant
- * is computed by the CORE, from the core process's own timezone. A Playwright
- * spec can set the BROWSER's timezone (`test.use({ timezoneId })`) and that has
- * no bearing on it, and CI runners commonly sit at UTC — where host-local and
- * UTC are the same instant and the assertion passes whatever the code does.
- * Writing it here would produce a test that is green on the machine it runs on
- * and blind to the bug it names.
- *
- * It belongs in a Rust test that can control the process timezone and assert
- * `next_run` directly. Reported rather than written.
- */
diff --git a/app/test/playwright/specs/assistant-ui-subagent-list.spec.ts b/app/test/playwright/specs/assistant-ui-subagent-list.spec.ts
deleted file mode 100644
index e29ac4058f..0000000000
--- a/app/test/playwright/specs/assistant-ui-subagent-list.spec.ts
+++ /dev/null
@@ -1,199 +0,0 @@
-/**
- * `subagent-list` — the fan-out roster a parallel delegation renders.
- *
- * Family: `components/assistant-ui/elements/subagent-list.tsx`, mounted on the
- * product chat path by `features/conversations/aui/ParallelAgentsCard.tsx`,
- * which `aui/toolkit.tsx` registers for `spawn_parallel_agents`. Zero e2e
- * coverage before this spec.
- *
- * This element is worth an e2e specifically because it is NOT fed by its own
- * tool result. `ParallelAgentsCard` reads the thread's live tool timeline and
- * keeps only rows whose `subagent.parentCallId` equals this call's
- * `toolCallId` (`selectSubagentChildrenByParentCallId`), because parallel
- * workers arrive as independent `subagent:*` timeline rows rather than inside
- * the call's own nested transcript. So the card joins two separate streams —
- * the tool-call part and the per-worker progress events — on an id. A unit test
- * hands both sides to the component already correlated; only an end-to-end run
- * can show the core actually stamps `parent_call_id` with the id the renderer
- * is looking for. If that correlation breaks, `children.length === 0` and the
- * card returns `null` — the fan-out renders as nothing at all, silently.
- *
- * ⚠️ STATUS 2026-09-24: THIS SPEC DOES NOT PASS YET, and the failure is NOT
- * isolated. Observed: `assistant-ui-parallel-agents-call` never appeared within
- * 60s. That is all that is known. The page snapshot in the Playwright artifact
- * was truncated before the transcript, and the artifact directory was later
- * overwritten by another agent's run (`app/test-results/` is shared, unlocked
- * state), so there is no evidence of what the transcript contained.
- *
- * Three candidate causes, none confirmed here, recorded so the next person does
- * not re-derive them. The third is the best supported:
- *
- * (a) The core-side rejection the sibling schedule-card spec observed for
- * `cron_add`, which would mean `spawn_parallel_agents` never ran.
- * (b) A rendering-side absence: another agent's scripted `memory_store` call
- * completed a turn while the DOM held zero tool-call wrappers of any kind.
- * (c) **Socket events not reaching the browser on this lane.** This card's rows
- * come from `state.chatRuntime.toolTimelineByThread`, populated by the
- * `subagent_spawned` SOCKET event (`ChatRuntimeProvider.tsx:890-930`, whose
- * own comment calls it "this socket ... event"). No events, no children,
- * and `ParallelAgentsCard` returns `null` for `children.length === 0` —
- * exactly the observed symptom. A third agent measured 11 of 11 failures on
- * surfaces fed this way (plan review, elicitation), with the page snapshot
- * showing the non-pending branch rendering because
- * `pendingPlanReviewByThread` was never populated.
- *
- * Two hypotheses were raised and BOTH are now dead, recorded because the
- * reasoning is the useful part:
- *
- * - "Streamed text arrives, so only specific event types fail." The CONCLUSION
- * survives, but the evidence originally offered for it did not: it rested on
- * settled markdown in the transcript, and a finished assistant message looks
- * identical whether it streamed in or was refetched afterwards. The DOM does
- * not record how content arrived.
- * - "No live socket events arrive at all; everything seen was refetched from the
- * transcript after the turn." Measured and killed: `chat-thread-isolation`
- * passes 3/3, and its case 2 asserts a token visible WHILE the turn is still
- * streaming. Live `text_delta` demonstrably arrives on this lane.
- *
- * So streaming works. That makes this spec's failure HARDER to explain, not
- * easier, and rules out the tidy "one cause, four slices" story:
- * `subagent_spawned` is published by `web_chat/progress_bridge_subagent_events.rs`
- * (`on_subagent_spawned` -> `publish_seq_stamped`) — the progress bridge, the
- * same publisher as the streaming that works. It does NOT share a publisher with
- * `plan_review_request`, which is bridged separately by `ApprovalSurfaceSubscriber`
- * off the DomainEvent bus (`web_chat/event_bus.rs:41`, `:594-686`). A
- * plan-review-shaped explanation therefore does not transfer here, and these
- * should be filed as two findings with a noted resemblance rather than one.
- *
- * ⛔ UPSTREAM BREAKAGE, established by a CONTROL rather than by inference:
- * **tool calls do not render in the Playwright web lane on this branch.** The
- * pre-existing `test/playwright/specs/tool-call-presentation.spec.ts` (tracked,
- * last touched by `cd3806b19`, authored by nobody in this round) fails at
- * `expect(page.getByTestId('tool-timeline')).toBeVisible()` — and fails AFTER
- * its canary assertion passes, so the turn completed and the agent replied
- * while no tool call rendered.
- *
- * That control is sound on its own terms: its `beforeEach` boots the page
- * BEFORE the test body sets `llmForcedResponses`, so the ordered-queue hazard
- * (boot-time LLM requests eating queue entries) cannot apply to it, and the
- * canary rendering proves the scripted sequence was consumed by the intended
- * turn.
- *
- * It went unnoticed because that spec DOES run in ci-full's 64-shard sweep, but
- * the job carries `continue-on-error: true` and is excluded from the gate
- * (#3615) — a broken tool-render path fails there invisibly. Which is the
- * regression class a non-blocking lane is built to hide.
- *
- * Bisect window for that breakage, since the obvious suspects are innocent:
- * the control was restored by `cd3806b19` at 06:14 on 2026-09-24 and the
- * breakage was observed the same evening. Two commits on this branch SOUND like
- * the cause — `71d8874af` "handle missing toolkit in AUI conversation" and
- * `d5e81a916` "handle missing toolkit state on initial render" — and are not:
- * their complete diffs add this very `spawn_parallel_agents` toolkit entry and
- * its import, nothing else. Auto-generated subjects describing a fix that is not
- * in the diff. `7e1f5d90a` (18:12, desktop shell + chat chrome) touches
- * `thread.tsx` but its only tool/part change there is a comment. One entry in
- * the window was NOT examined at all: `58407ea53`, the 15:51 upstream merge.
- * That is a gap in the search, not a suspicion about the commit — it is
- * recorded so the next person knows which stone is unturned, and nothing here
- * should be read as nominating it.
- *
- * This supersedes the by-elimination reasoning that preceded it. `ParallelAgentsCard`
- * is a toolkit render ON a tool-call part, so if no tool call renders this card
- * cannot render regardless of whether `spawn_parallel_agents` ran, whether its
- * workers spawned, or whether `subagent_spawned` was delivered. The spec is
- * blocked upstream of everything it asserts.
- *
- * Deciding between them needs one run that captures the transcript. Copy the
- * artifact out of the tree before releasing the ci-slot: `e2e-web-session.sh`
- * wipes `test-results/` at start, its wrapper exits 0 even when tests fail, and
- * the directory is shared with every other agent's run.
- *
- * Two workers because the tool's own schema sets `minItems: 2` on `tasks`
- * (`spawn_parallel_agents_policy_tests.rs:11`); one task is not a valid call.
- */
-import { expect, type Page, test } from '@playwright/test';
-
-import { resetMock, sendTurn, setKeywordRules, startNewThread } from '../helpers/chat-drive';
-import { bootAuthenticatedPage, dismissWalkthroughIfPresent } from '../helpers/core-rpc';
-
-const USER_ID = 'pw-aui-subagent-list';
-
-const TRIGGER = 'PARALLEL-FANOUT please';
-
-/** `conversations.tools.parallelAgentsAggregating` (en.ts:3793). */
-const AGGREGATING = 'Aggregating results';
-
-const RULES = [
- {
- keyword: 'PARALLEL-FANOUT',
- toolCalls: [
- {
- name: 'spawn_parallel_agents',
- arguments: {
- tasks: [
- { agent_id: 'researcher', prompt: 'Summarise branch ALPHA and stop.' },
- { agent_id: 'researcher', prompt: 'Summarise branch BRAVO and stop.' },
- ],
- },
- },
- ],
- },
- // The workers themselves reach the same mock; keep their turns short so both
- // settle inside the spec's budget rather than streaming for its duration.
- { keyword: 'branch ALPHA', streamScript: [{ text: 'alpha done' }, { finish: 'stop' }] },
- { keyword: 'branch BRAVO', streamScript: [{ text: 'bravo done' }, { finish: 'stop' }] },
-];
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible({ timeout: 30_000 });
-}
-
-test.beforeEach(async () => {
- await resetMock();
- await setKeywordRules(RULES);
-});
-
-test.describe('assistant-ui subagent list', () => {
- // `spawn_parallel_agents` was removed from the chat orchestrator's direct
- // tool belt; the supported path is async delegation. This legacy direct-call
- // contract remains as documentation until its replacement is landed.
- test.skip(true, 'legacy spawn_parallel_agents surface; async delegation is the supported path');
-
- test('a parallel fan-out renders both workers and settles when both finish', async ({ page }) => {
- test.setTimeout(120_000);
-
- await openChat(page);
- const threadId = await startNewThread(page);
-
- await sendTurn(page, threadId, TRIGGER);
-
- // The card renders at all only if `parentCallId` correlation succeeded —
- // `children.length === 0` returns null. So its presence is the join
- // assertion, not decoration.
- const card = page.getByTestId('assistant-ui-parallel-agents-call');
- await expect(card).toBeVisible({ timeout: 60_000 });
-
- // Terminal state, observed through the element's own logic rather than a
- // sleep: `showSummary={anyRunning}`, and `anyRunning` is
- // `completedCount < children.length`. The aggregating summary row is
- // present exactly while at least one worker is live and disappears when
- // the last one settles, so waiting for it to go is waiting for both
- // workers to reach a non-active status.
- await expect(card.getByText(AGGREGATING, { exact: false })).toHaveCount(0, { timeout: 90_000 });
-
- // One progressbar per worker (`subagent-list.tsx:66-67`), counted AFTER the
- // summary row has gone so the count is workers only — `showSummary` adds a
- // progressbar of its own (`:95-96`) and would otherwise inflate it.
- //
- // Counted rather than name-matched on purpose. The label is
- // `${agent.name} progress` where `name` is `displayName || agentId ||
- // 'sub-agent'`, so matching on "researcher" would bind this spec to which
- // of those three the core happened to populate. The count is the claim
- // anyway: exactly two, because a fan-out that correlated only its first
- // worker still renders a card and still looks plausible.
- await expect(card.getByRole('progressbar')).toHaveCount(2, { timeout: 30_000 });
- });
-});
diff --git a/app/test/playwright/specs/aui-tool-result-elements.spec.ts b/app/test/playwright/specs/aui-tool-result-elements.spec.ts
deleted file mode 100644
index 7dcca92efd..0000000000
--- a/app/test/playwright/specs/aui-tool-result-elements.spec.ts
+++ /dev/null
@@ -1,356 +0,0 @@
-/**
- * assistant-ui tool-result presentation elements, end to end.
- *
- * Covers three vendored element families that had **zero** e2e coverage before
- * this file (`git grep -l 'code-diff\|data-table\|artifact-card'` over
- * `test/playwright/specs` and `test/e2e/specs` returned nothing):
- *
- * | Element | Real importer on the product chat path | What makes it appear |
- * |---|---|---|
- * | `elements/code-diff.tsx` | `features/conversations/tools/ToolBodies.tsx` `FileBody` | an `edit` tool call carrying `old_string` / `new_string` |
- * | `elements/data-table.tsx` | `features/conversations/tools/ToolDataView.tsx` | a tool result that is a flat, uniform object array |
- * | `elements/artifact-card.tsx` | `features/conversations/aui/MediaAndDocumentCalls.tsx` `DocumentArtifactCall` | a `generate_document` / `generate_presentation` call |
- *
- * **Not** driven through the dev-only gallery at `/dev/tools`
- * (`pages/dev/ToolCallGallery.tsx`, "Registered only in dev builds"). That
- * route imports several of these families and is the easy way to make them
- * render, but it proves nothing about the product: it mounts the elements with
- * hand-written props instead of letting a tool result reach them. Every
- * assertion below goes through a real turn — the mock LLM emits a tool call,
- * the core runs it, and the chat renders the result.
- *
- * Turns go over `openhuman.channel_web_chat` via `helpers/chat-drive.ts`, never
- * the composer: `ComposerTextBridge` used to take the chat surface to its error
- * boundary when driven at speed, and a spec about a tool result should not be
- * able to fail for a composer reason.
- *
- * No real backend or third-party calls: the mock LLM is scripted with
- * `llmKeywordRules`, and the Composio action's payload comes from the mock's own
- * `composioExecuteResponse_<ACTION>` behaviour knob.
- *
- * ## STATUS 2026-09-24: these cases are RED, and not because of what they assert
- *
- * Every case here fails at `openToolCall`, before reaching a single element
- * assertion: the round settles, the agent replies, and no `assistant-ui-tool-call`
- * card appears. Three independent legs say that is not a claim about this file.
- *
- * 1. **A control on a spec this file does not touch.**
- * `test/playwright/specs/tool-call-presentation.spec.ts` — restored hours
- * earlier in `cd3806b19` — fails at its line 151,
- * `expect(page.getByTestId('tool-timeline')).toBeVisible()`, AFTER its canary
- * assertion passes. It drives via the COMPOSER (`sendMessage`, lines 108-115:
- * `chat-message-input.fill` then `send-message-button.click`), not this file's
- * RPC driver, so it exercises the real send path.
- *
- * 2. **The `chat-drive.ts` lifecycle bug is NOT the cause.** A peer session found
- * that `sendTurn` never dispatched `chatRuntime/beginInferenceTurn`, which a
- * real composer send does (`Conversations.tsx:1161`), leaving `isRunning`
- * false for RPC-driven turns. That was a genuine harness defect and it is
- * fixed (`armTurnLifecycle`). **These four cases were re-run on the fixed
- * driver and are still red, with the same message.** Leg 1 was never affected
- * by it either, being composer-driven.
- *
- * 3. **A second element family, confound removed.** The same peer's `todo` spec
- * is still red on the fixed driver with its UPSTREAM stage passing —
- * `upstreamBodies()` grew past `before + 1`, so the tool call went out, the
- * result came back, and the harness called the model again. Tool round trip
- * yes, render no.
- *
- * ### Scope: wider than "tool calls do not render"
- *
- * That framing is narrower than the evidence. The peer's pinned `todo-checklist`
- * also failed, and it is not a tool-call part at all — it renders off the
- * `thread_todos_changed` socket event via `useThreadTodos` (`useThreadTodos.ts:3`;
- * `TodoListPart.tsx:68` contrasts the two paths explicitly). So **at least two
- * independent render paths fail: tool-call parts, and a socket-event-driven
- * pinned surface.** Whether they share a root cause is UNKNOWN and is not
- * asserted here.
- *
- * What CAN be said bounds the search without inventing a cause: the two paths
- * converge at exactly one place. `ChatRuntimeProvider.tsx` handles both the
- * tool-call stream (`:806-1050`, `toolCallReceived`) and `thread_todos_changed`
- * (`:1461`), and they share nothing below it — the tool-call part renders
- * through the assistant-ui toolkit, the checklist through `useThreadTodos`. So
- * IF one defect explains both, it is at or above that handler; if it is below,
- * there are two. That is a constraint on where to look, not a claim about which
- * is true. (Bound suggested by a peer session, verified here against the
- * provider source.)
- *
- * **These cases are therefore written but UNVERIFIED, and none is revert-proven.**
- * Proving a fault against an already-red spec establishes nothing, so that was not
- * attempted. When the lane renders tool calls again, run this file first: if a case
- * still fails it will fail at its own assertion rather than at `openToolCall`, and
- * that failure is then about the element.
- */
-import { expect, type Locator, type Page, test } from '@playwright/test';
-
-import {
- resetMock,
- sendTurn,
- setKeywordRules,
- setMockBehavior,
- startNewThread,
- waitForConnectedSocketId,
-} from '../helpers/chat-drive';
-import {
- bootAuthenticatedPage,
- dismissWalkthroughIfPresent,
- waitForAppReady,
-} from '../helpers/core-rpc';
-
-const USER_ID = 'pw-aui-tool-result-elements';
-
-async function openChat(page: Page): Promise<string> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await page.goto('/#/chat');
- await waitForAppReady(page);
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible();
- await waitForConnectedSocketId(page);
- return startNewThread(page);
-}
-
-/**
- * Script the mock LLM to answer ONE prompt with a tool call.
- *
- * Keyword-matched (`llmKeywordRules`), deliberately not the `llmForcedResponses`
- * queue. The queue is consumed in order by *every* LLM request the process
- * makes, and booting a page and opening a thread makes some of its own before
- * the turn under test — so entry #1 (the tool call) gets eaten and the turn
- * receives entry #2. The symptom is nasty: the round completes, a reply
- * appears, and no tool call ever happens. The first revision of this file used
- * the queue and all four cases failed that way. A keyword rule fires on the
- * prompt text instead, so it cannot be consumed by an unrelated request.
- *
- * No canary: the follow-up response falls through to the mock's default
- * (`llm.mjs:505-516`), and waiting for the rendered body is the better settle
- * signal anyway — `AssistantUiToolCall` mounts `richBody` only once the call is
- * no longer running.
- */
-async function scriptToolCall(
- keyword: string,
- toolCalls: { name: string; arguments: Record<string, unknown> }[]
-): Promise<void> {
- await setKeywordRules([{ keyword, toolCalls }]);
- await setMockBehavior('llmStreamChunkDelayMs', '10');
-}
-
-/**
- * Wait for the round to have produced a tool card at all, then open it.
- *
- * Staged deliberately. The bodies below live inside a Radix
- * `CollapsibleContent` (`elements/tool-call.tsx:77-119`), which UNMOUNTS its
- * children while closed, and a settled tool card starts closed —
- * `useDisclosure(key, awaitingUser)` defaults to `awaitingUser`, which is
- * `false` for an ordinary call (`AssistantUiToolCall.tsx:100-102`). So "element
- * not found" has two very different causes: the tool never ran, or it ran and
- * the card is shut. Asserting the card first separates them, instead of
- * reporting a core problem as a rendering one.
- *
- * The trigger is identified by `aria-expanded`, which Radix owns, rather than
- * "the first button in the card" — an earlier revision clicked by button order
- * and silently opened nothing.
- */
-async function openToolCall(page: Page, expectedLabel: string | RegExp): Promise<Locator> {
- const card = page.getByTestId('assistant-ui-tool-call').filter({ hasText: expectedLabel });
- await expect(
- card.first(),
- `the round settled but produced no tool card matching ${String(expectedLabel)} — ` +
- 'the core did not run the scripted tool call, so nothing downstream can be about rendering'
- ).toBeVisible({ timeout: 30_000 });
-
- const target = card.last();
- const trigger = target.locator('[aria-expanded]').first();
- if ((await trigger.getAttribute('aria-expanded')) === 'false') {
- await trigger.click({ force: true });
- }
- // Positive confirmation that the click landed. Without it a missed trigger
- // reads downstream as "the element does not render".
- await expect(trigger).toHaveAttribute('aria-expanded', 'true', { timeout: 10_000 });
- return target;
-}
-
-test.describe('assistant-ui tool-result elements', () => {
- // These cases target the retired per-tool assistant-ui cards. The shipped
- // chat surface now groups tool activity behind the Agentic task-insights
- // disclosure; keep the scenarios for migration, but do not run stale
- // selectors in the blocking browser lane.
- test.skip(true, 'legacy per-tool cards replaced by the Agentic task-insights surface');
-
- test.beforeEach(async () => {
- await resetMock();
- // The Composio case below calls a GitHub action. Without a seeded toolkit
- // and an ACTIVE connection the action is not reachable and the round would
- // settle on an error body rather than a tabular result — the same seeding
- // `harness-composio-tool-flow.spec.ts` does.
- await setMockBehavior('composioToolkits', JSON.stringify(['github']));
- await setMockBehavior(
- 'composioConnections',
- JSON.stringify([{ id: 'conn-github', toolkit: 'github', status: 'ACTIVE' }])
- );
- });
-
- // ── elements/code-diff.tsx ────────────────────────────────────────────
-
- test('an edit renders its added and removed lines through the code-diff element', async ({
- page,
- }) => {
- const threadId = await openChat(page);
- const PROMPT = 'AUI-DIFF-CASE raise the retry count and the timeout';
- await scriptToolCall('AUI-DIFF-CASE', [
- {
- name: 'edit',
- arguments: {
- path: 'e2e/aui/diff-subject.ts',
- old_string: 'const retries = 1;\nconst timeoutMs = 500;',
- new_string: 'const retries = 5;\nconst timeoutMs = 2000;',
- },
- },
- ]);
-
- await sendTurn(page, threadId, PROMPT);
- const card = await openToolCall(page, /Edit|edit/);
-
- const diff = card.getByTestId('tool-body-file-diff').first();
- await expect(diff).toBeVisible({ timeout: 20_000 });
-
- // The filename, shortened by `shortenPath`, identifies which file changed.
- await expect(diff).toContainText('diff-subject.ts');
-
- // Both sides render, and each carries its own text. A diff that dropped
- // the removed side, or rendered the old text on both, still shows a card.
- await expect(diff).toContainText('const retries = 1;');
- await expect(diff).toContainText('const retries = 5;');
- await expect(diff).toContainText('const timeoutMs = 500;');
- await expect(diff).toContainText('const timeoutMs = 2000;');
-
- // The counts must agree with the payload: two lines removed, two added.
- // `FileBody` derives them from the args it was handed
- // (`ToolBodies.tsx:214-226`), so a header that disagrees with the body is
- // the miscount this pins.
- await expect(diff).toContainText('+2');
- await expect(diff).toContainText('−2');
- });
-
- test('an edit that changes nothing still reports a diff of its own size', async ({ page }) => {
- const threadId = await openChat(page);
- const PROMPT = 'AUI-NOOP-CASE rewrite that line to the same thing';
- const unchanged = 'export const VERSION = 3;';
- await scriptToolCall('AUI-NOOP-CASE', [
- {
- name: 'edit',
- arguments: {
- path: 'e2e/aui/noop-subject.ts',
- old_string: unchanged,
- new_string: unchanged,
- },
- },
- ]);
-
- await sendTurn(page, threadId, PROMPT);
- const card = await openToolCall(page, /Edit|edit/);
-
- const diff = card.getByTestId('tool-body-file-diff').first();
- await expect(diff).toBeVisible({ timeout: 20_000 });
-
- // This pins CURRENT behaviour, which is worth being explicit about: an
- // edit whose old and new text are identical is rendered as a full
- // removal plus a full re-addition (`+1 −1`), not as unchanged context.
- // `FileBody` never compares the two sides — it maps `old_string` to
- // removed lines and `new_string` to added lines unconditionally
- // (`ToolBodies.tsx:213-217`), so there is no "no change" branch to reach.
- //
- // I am pinning it rather than asserting what it arguably should do,
- // because a spec that asserted "renders as context" would be red against
- // shipped code and would be describing a feature request. The judgement
- // that this reads wrong is in the W5 report as a candidate issue, not
- // encoded here as a failing test.
- await expect(diff).toContainText('+1');
- await expect(diff).toContainText('−1');
- await expect(diff).toContainText(unchanged);
- });
-
- // ── elements/data-table.tsx ───────────────────────────────────────────
-
- test('a tabular tool result renders its rows and columns through the data-table element', async ({
- page,
- }) => {
- const threadId = await openChat(page);
- // `ToolDataView` renders `DataTable` only for a non-empty array of plain
- // objects that share one key set and hold only primitives
- // (`ToolDataView.tsx:isFlatObjectArray`). `result` is one of the semantic
- // keys it unwraps to before deciding, so this payload reaches the table.
- await setMockBehavior(
- 'composioExecuteResponse_GITHUB_LIST_REPOS',
- JSON.stringify({
- result: [
- { repo_name: 'openhuman', open_issues: 42, archived: false },
- { repo_name: 'tinybus', open_issues: 7, archived: false },
- ],
- })
- );
- await scriptToolCall('AUI-TABLE-CASE', [
- { name: 'GITHUB_LIST_REPOS', arguments: { limit: 2 } },
- ]);
-
- await sendTurn(page, threadId, 'AUI-TABLE-CASE list my repositories');
- const card = await openToolCall(page, /GITHUB_LIST_REPOS|repositor/i);
-
- const table = card.locator('[data-slot="data-table"]').first();
- await expect(table).toBeVisible({ timeout: 20_000 });
-
- // Columns come from the first row's keys, run through `friendlyLabel`
- // (`ToolDataView.tsx:flatRowColumns`), so the header is derived from the
- // payload rather than hard-coded: `repo_name` must render as "Repo name".
- await expect(table).toContainText('Repo name');
- await expect(table).toContainText('Open issues');
- await expect(table).toContainText('Archived');
-
- // Both rows, with their own cell values. Asserting both is what catches a
- // table that renders only the first row.
- await expect(table).toContainText('openhuman');
- await expect(table).toContainText('42');
- await expect(table).toContainText('tinybus');
- await expect(table).toContainText('7');
-
- // A boolean cell is stringified by `flatRowColumns`, not dropped.
- await expect(table).toContainText('false');
- });
-
- // ── elements/artifact-card.tsx ────────────────────────────────────────
-
- test('a generated document shows its own title, not the generic kind placeholder', async ({
- page,
- }) => {
- const threadId = await openChat(page);
- const DOC_TITLE = 'Q3 Infrastructure Review';
- await scriptToolCall('AUI-DOC-CASE', [
- {
- name: 'generate_document',
- arguments: { title: DOC_TITLE, prompt: 'summarise the infrastructure work this quarter' },
- },
- ]);
-
- await sendTurn(page, threadId, 'AUI-DOC-CASE write up the infrastructure review');
- const toolCard = await openToolCall(page, /Document|document/);
-
- const card = toolCard.locator('[data-slot="artifact-card"]').first();
- await expect(card).toBeVisible({ timeout: 20_000 });
-
- // The point of this assertion. `DocumentArtifactCall` resolves the title as
- // `result.title ?? args.title ?? kindTitle` (`MediaAndDocumentCalls.tsx:131-140`),
- // where `kindTitle` is the generic "Document" / "Presentation" string. If
- // both lookups break the card still renders, still looks right, and shows a
- // placeholder — which is exactly the failure a "does the card appear" spec
- // cannot see. So: the artifact's own title must be present, and the bare
- // placeholder must not be the card's title.
- await expect(card).toContainText(DOC_TITLE);
-
- // `toHaveText('Document')` on the card would never fail — the card's full
- // text also carries the meta line, so it can never equal the placeholder.
- // The title is its own node (`artifact-card.tsx:110`), so assert on that:
- // it must read the artifact's title and not the generic kind string.
- const cardTitle = card.locator('p.truncate').first();
- await expect(cardTitle).toHaveText(DOC_TITLE);
- });
-});
diff --git a/app/test/playwright/specs/chat-agent-plan.spec.ts b/app/test/playwright/specs/chat-agent-plan.spec.ts
deleted file mode 100644
index bb24a56703..0000000000
--- a/app/test/playwright/specs/chat-agent-plan.spec.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * `elements/agent-plan.tsx` on the product chat path — the rendered surface of
- * a parked plan review.
- *
- * `chat-plan-review.spec.ts` (#6612) covers the GATE: that the turn really
- * parks on an in-memory oneshot and that approve / reject / revise each route
- * the resolution back to the model. It asserts the card exists and says
- * nothing about what the card shows. This file is the other half: the plan the
- * user is being asked to approve has to be the plan the agent proposed, and
- * its progress has to mean something.
- *
- * The real importer is `features/conversations/aui/PlanReviewPart.tsx`, which
- * feeds `AgentPlan` from the live `plan_review_request` payload. There is a
- * dev-only gallery at `/dev/tools` that mounts `AgentPlan` directly; asserting
- * through it would prove the element renders an array, which nobody doubts,
- * and nothing about whether the product ever hands it the right array.
- *
- * ## What a real run showed, and what this file therefore asserts
- *
- * Written first against `activeIndexFromTodos` (`PlanReviewPart.tsx:29-37`),
- * which derives `activeIndex` from the thread's live todo list and is strict
- * about it: same length as the plan, and every item's `content` equal to the
- * step at the same position. Three cases were written around that.
- *
- * **They failed, and the failure is the finding.** Against the built web lane
- * the plan renders — steps and all — but it renders through
- * `PlanReviewPart`'s NON-pending branch (`:197-204`, a bare `AgentPlan` at
- * `activeIndex: steps.length`), not through `PlanReviewCardCore`. The page
- * showed `Review plan 3 of 3` with the three steps as list items and no
- * `plan-review-card` anywhere. `pendingPlanReviewByThread[threadId]` was empty,
- * so the review never parked, so `activeIndex` never came from the todo list
- * and there was nothing for those three cases to observe. All five cases of
- * `chat-plan-review.spec.ts` (#6612) failed in the same run for the same
- * reason — that file had never been executed before this one was written.
- *
- * So the todo-progress cases are NOT here. They would have to assert a branch
- * this lane cannot reach, and a spec that can only fail is no better than one
- * that can only pass. The parking gap is reported as an issue instead; when it
- * is fixed, `activeIndexFromTodos` is worth exactly the three cases that were
- * cut, and this comment is the record of what they were.
- *
- * What IS reachable is the element's own job: rendering the steps the agent
- * proposed, in the order it proposed them, and showing a settled call as
- * complete. Both are asserted below, and both are on the product path — the
- * dev-only gallery at `/dev/tools` mounts `AgentPlan` directly, and asserting
- * there would prove a component renders an array, not that the product ever
- * hands it the right one.
- */
-import { expect, type Locator, type Page, test } from '@playwright/test';
-
-import {
- resetMock,
- sendTurn,
- setMockBehavior,
- waitForSelectedThreadId,
-} from '../helpers/chat-drive';
-import { bootAuthenticatedPage, dismissWalkthroughIfPresent } from '../helpers/core-rpc';
-
-const USER_ID = 'pw-chat-agent-plan';
-const PROMPT = 'AGENT-PLAN-PROMPT';
-
-const STEPS = ['Read the changelog', 'Draft the notes', 'Publish the post'];
-const SUMMARY = 'AGENT-PLAN-SUMMARY-MARKER';
-
-function toolCall(id: string, name: string, args: string) {
- return { content: '', toolCalls: [{ id, name, arguments: args }] };
-}
-
-const planReviewCall = toolCall(
- 'call_plan_review_1',
- 'request_plan_review',
- JSON.stringify({ summary: SUMMARY, steps: STEPS })
-);
-
-/**
- * `llmForcedResponses` is a queue drained one entry per upstream call, so this
- * is one turn: the agent writes its todo list, the harness runs the tool and
- * calls upstream again, and the second entry parks the review. Keyword rules
- * would not do — both calls happen inside a single turn with different latest
- * messages, and only the queue guarantees the order.
- */
-async function scriptTurn(entries: unknown[]): Promise<void> {
- await setMockBehavior('llmForcedResponses', JSON.stringify(entries));
-}
-
-const agentPlan = (page: Page): Locator => page.locator('[data-slot="agent-plan"]').first();
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible({ timeout: 30_000 });
-}
-
-/** Drive a turn and wait until the plan surface is actually on screen. */
-async function parkAndWaitForPlan(page: Page): Promise<void> {
- const threadId = await waitForSelectedThreadId(page);
- await sendTurn(page, threadId, PROMPT);
- await expect(agentPlan(page), 'the parked review never rendered its plan').toBeVisible({
- timeout: 60_000,
- });
-}
-
-/**
- * The element's `{completed} of {total}` counter, read as text.
- *
- * Read from the DOM rather than through a tolerant helper on purpose: this
- * file is a test ABOUT that number, so anything that normalised a missing or
- * malformed counter into a default would make every assertion below
- * unfalsifiable.
- */
-async function progressCounter(page: Page): Promise<string> {
- return (await agentPlan(page).locator('span.tabular-nums').first().innerText()).trim();
-}
-
-/** The plan's step rows, in render order. */
-async function renderedSteps(page: Page): Promise<string[]> {
- const items = await agentPlan(page).locator('li').allInnerTexts();
- return items.map(text => text.trim());
-}
-
-// Same cold-start reasoning as chat-thread-isolation.spec.ts: the first spec of
-// a shard pays the app's first paint, and these turns additionally run a tool
-// round before parking. The assertions are unchanged.
-test.describe.configure({ timeout: 120_000 });
-
-test.describe('Agent plan surface', () => {
- test.skip(true, 'request_plan_review is no longer on the chat orchestrator belt');
-
- test.beforeEach(async () => {
- await resetMock();
- });
-
- test('the plan renders the agent’s own steps, in order', async ({ page }) => {
- await scriptTurn([planReviewCall]);
- await openChat(page);
- await parkAndWaitForPlan(page);
-
- // Order is the assertion, not membership: a plan whose steps are shuffled
- // is a different plan, and a per-step `toContainText` would pass on one.
- expect(await renderedSteps(page)).toEqual(STEPS);
- });
-
- test('a settled call renders the plan complete rather than mid-flight', async ({ page }) => {
- // `PlanReviewPart.tsx:197-204` renders a call with no pending review at
- // `activeIndex: steps.length` — deliberately, because it is "not this
- // render's job to re-offer a decision that was already made". The counter
- // is how a user sees that, so this pins the documented branch, not an
- // accident of it.
- await scriptTurn([planReviewCall]);
- await openChat(page);
- await parkAndWaitForPlan(page);
-
- expect(await progressCounter(page)).toBe(`${STEPS.length} of ${STEPS.length}`);
- // Still the same plan — "complete" must not have rewritten the steps.
- expect(await renderedSteps(page)).toEqual(STEPS);
- });
-});
diff --git a/app/test/playwright/specs/chat-composer-attachment-gate.spec.ts b/app/test/playwright/specs/chat-composer-attachment-gate.spec.ts
index 731aca8ffc..49d2dae8eb 100644
--- a/app/test/playwright/specs/chat-composer-attachment-gate.spec.ts
+++ b/app/test/playwright/specs/chat-composer-attachment-gate.spec.ts
@@ -255,10 +255,6 @@ test.describe('Chat composer attachment gate', () => {
}
test('pasting an image attaches it', async ({ page }) => {
- test.fixme(
- true,
- 'Playwright synthetic ClipboardEvent cannot expose image DataTransfer to Lexical; picker coverage remains active'
- );
// The control for the case below: without this, "paste did not attach
// while streaming" would be true of an idle composer too, and would be
// testing nothing.
@@ -274,10 +270,6 @@ test.describe('Chat composer attachment gate', () => {
});
test('pasting an image while a turn streams does not attach it', async ({ page }) => {
- test.fixme(
- true,
- 'Playwright synthetic ClipboardEvent cannot expose image DataTransfer to Lexical; picker gate coverage remains active'
- );
// The bypass this file was chartered to check. `canAcceptComposerFiles`
// folds in `attachmentInteractionBlocked`, so the paste path has to refuse
// for the same reason the `[+]` button is disabled — a gate enforced on one
diff --git a/app/test/playwright/specs/chat-harness-subagent.spec.ts b/app/test/playwright/specs/chat-harness-subagent.spec.ts
deleted file mode 100644
index 829f5006ee..0000000000
--- a/app/test/playwright/specs/chat-harness-subagent.spec.ts
+++ /dev/null
@@ -1,407 +0,0 @@
-import { expect, type Page, test } from '@playwright/test';
-
-import { agentMessageText } from '../helpers/chat-locators';
-import {
- bootAuthenticatedPage,
- callCoreRpc,
- dismissWalkthroughIfPresent,
- waitForAppReady,
-} from '../helpers/core-rpc';
-
-const MOCK_ADMIN_BASE = `http://127.0.0.1:${process.env.E2E_MOCK_PORT || '18473'}`;
-const USER_ID = 'pw-chat-subagent';
-const PROMPT = 'Research the answer to life and tell me a marker phrase.';
-const CANARY_FINAL = 'subagent-canary-final-7afe2';
-const RESEARCHER_REPLY = 'The researcher answer is 42.';
-const PARENT_THINKING = 'Parent trace: delegate the factual lookup before synthesizing.';
-const PARENT_NARRATION = 'I am delegating the factual lookup now.';
-const CHILD_THINKING = 'Child trace: isolate the requested marker before replying.';
-const KEYWORD_RESPONSES = [
- { keyword: "Search the user's memory tree", content: 'No relevant memory.' },
- {
- keyword: PROMPT,
- streamScript: [
- { thinking: PARENT_THINKING },
- { text: PARENT_NARRATION },
- {
- toolCall: {
- id: 'call_research_1',
- name: 'spawn_async_subagent',
- arguments: JSON.stringify({ agent_id: 'researcher', prompt: 'Tell me a marker phrase' }),
- },
- },
- { finish: 'tool_calls' },
- ],
- },
- {
- // `spawn_async_subagent` wraps the requested task in its background-run
- // contract, so the latest child user message is the rendered handoff, not
- // the raw tool argument.
- keyword: 'Run this task without requiring attention from the parent or user',
- streamScript: [{ thinking: CHILD_THINKING }, { text: RESEARCHER_REPLY }, { finish: 'stop' }],
- },
- {
- // Detached completion is delivered to the parent as a fresh background
- // notification turn; match that stable framing rather than depending on
- // exactly how the result body is quoted inside it.
- keyword: 'background sub-agent finished while you were busy',
- streamScript: [
- { thinking: 'Parent trace: verify the delegated finding and answer.' },
- { text: `Done. The result is: ${CANARY_FINAL}` },
- { finish: 'stop' },
- ],
- },
-];
-
-interface MockRequest {
- body?: string;
- method: string;
- url: string;
-}
-
-async function resetMock(): Promise<void> {
- await fetch(`${MOCK_ADMIN_BASE}/__admin/reset`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({}),
- });
-}
-
-async function setMockBehavior(key: string, value: string): Promise<void> {
- await fetch(`${MOCK_ADMIN_BASE}/__admin/behavior`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ key, value }),
- });
-}
-
-async function requests(): Promise<MockRequest[]> {
- const response = await fetch(`${MOCK_ADMIN_BASE}/__admin/requests`);
- const payload = (await response.json()) as { data?: MockRequest[] };
- return Array.isArray(payload.data) ? payload.data : [];
-}
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await page.goto('/#/chat');
- await waitForAppReady(page);
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible();
-}
-
-async function selectedThreadId(page: Page): Promise<string | null> {
- return page.evaluate(() => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => { thread?: { selectedThreadId?: string | null } };
- };
- }
- ).__OPENHUMAN_STORE__;
- return store?.getState?.().thread?.selectedThreadId ?? null;
- });
-}
-
-async function createNewThread(page: Page): Promise<string> {
- const before = await selectedThreadId(page);
- await dismissWalkthroughIfPresent(page);
- const sidebarButton = page.getByTestId('new-thread-sidebar-button');
- if (await sidebarButton.isVisible().catch(() => false)) {
- await sidebarButton.click({ force: true });
- } else {
- await page.getByTestId('new-thread-button').click({ force: true });
- }
- const changed = await expect
- .poll(
- async () => {
- const current = await selectedThreadId(page);
- return current && current !== before ? current : null;
- },
- { timeout: 10_000 }
- )
- .not.toBeNull()
- .then(
- () => true,
- () => false
- );
- const id = await selectedThreadId(page);
- if (changed && id) return id;
- if (id) return id;
- if (before) return before;
- throw new Error('selectedThreadId was not populated');
-}
-
-async function waitForSocketConnected(page: Page): Promise<void> {
- await expect
- .poll(
- async () =>
- page.evaluate(() => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => { socket?: { byUser?: Record<string, { status?: string }> } };
- };
- }
- ).__OPENHUMAN_STORE__;
- const byUser = store?.getState?.().socket?.byUser ?? {};
- return Object.values(byUser).some(entry => entry?.status === 'connected');
- }),
- { timeout: 30_000 }
- )
- .toBe(true);
-}
-
-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();
-}
-
-async function llmCompletionRequests(): Promise<MockRequest[]> {
- const log = await requests();
- return log.filter(
- entry => entry.method === 'POST' && entry.url.includes('/openai/v1/chat/completions')
- );
-}
-
-async function completionRequestCount(): Promise<number> {
- return (await llmCompletionRequests()).length;
-}
-
-interface DiagnosticsSnapshot {
- completionRequests: Array<{ probe: string; index: number }>;
- matchedKeywords: string[];
- selectedThreadId: string | null;
- runtime: {
- phase: string | null;
- toolTimelineNames: string[];
- toolTimelineIds: string[];
- turnTranscriptTexts: Record<string, string[]>;
- messageCount: number;
- lastAssistantText: string | null;
- };
-}
-
-// Captures the harness state the moment a strong assertion is about to time
-// out so future CI failures expose request counts, consumed keyword matches,
-// the active thread, and the chat runtime — instead of just "element not
-// found." Required by issue #3469's RCA acceptance criteria.
-async function diagnosticsSnapshot(page: Page): Promise<DiagnosticsSnapshot> {
- const llmRequests = await llmCompletionRequests();
- const completionRequests = llmRequests.map((entry, index) => {
- let probe = '';
- try {
- const parsed = JSON.parse(entry.body ?? '{}') as {
- messages?: Array<{ role?: string; content?: unknown }>;
- };
- const messages = Array.isArray(parsed.messages) ? parsed.messages : [];
- for (let i = messages.length - 1; i >= 0; i -= 1) {
- const m = messages[i];
- if (!m || (m.role !== 'user' && m.role !== 'tool')) continue;
- if (typeof m.content === 'string') {
- probe = m.content;
- break;
- }
- if (Array.isArray(m.content)) {
- probe = m.content
- .filter(
- (c): c is { type: 'text'; text: string } =>
- !!c &&
- typeof c === 'object' &&
- (c as { type?: string }).type === 'text' &&
- typeof (c as { text?: unknown }).text === 'string'
- )
- .map(c => c.text)
- .join(' ');
- break;
- }
- }
- } catch {
- probe = '';
- }
- return { probe: probe.slice(0, 240), index };
- });
-
- const matchedKeywords = completionRequests
- .map(({ probe }) =>
- KEYWORD_RESPONSES.find(rule => probe.toLowerCase().includes(rule.keyword.toLowerCase()))
- )
- .map(rule => (rule ? rule.keyword : '<no-match>'));
-
- const threadId = await selectedThreadId(page);
-
- const runtime = await page.evaluate(currentThreadId => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => {
- chatRuntime?: {
- inferenceStatusByThread?: Record<string, { phase?: string }>;
- toolTimelineByThread?: Record<string, Array<{ id?: string; name?: string }>>;
- turnTranscriptsByThread?: Record<string, Record<string, Array<{ text?: string }>>>;
- };
- thread?: {
- messagesByThread?: Record<string, Array<{ role?: string; content?: string }>>;
- };
- };
- };
- }
- ).__OPENHUMAN_STORE__;
- const state = store?.getState?.();
- const phase =
- currentThreadId && state?.chatRuntime?.inferenceStatusByThread?.[currentThreadId]?.phase
- ? (state.chatRuntime.inferenceStatusByThread[currentThreadId].phase ?? null)
- : null;
- const timeline =
- currentThreadId && state?.chatRuntime?.toolTimelineByThread?.[currentThreadId]
- ? state.chatRuntime.toolTimelineByThread[currentThreadId]
- : [];
- const turnTranscripts =
- currentThreadId && state?.chatRuntime?.turnTranscriptsByThread?.[currentThreadId]
- ? state.chatRuntime.turnTranscriptsByThread[currentThreadId]
- : {};
- const messages =
- currentThreadId && state?.thread?.messagesByThread?.[currentThreadId]
- ? state.thread.messagesByThread[currentThreadId]
- : [];
- const lastAssistant = [...messages].reverse().find(m => m?.role === 'assistant');
- return {
- phase,
- toolTimelineNames: timeline.map(entry => entry?.name ?? ''),
- toolTimelineIds: timeline.map(entry => entry?.id ?? ''),
- turnTranscriptTexts: Object.fromEntries(
- Object.entries(turnTranscripts).map(([requestId, items]) => [
- requestId,
- items.map(item => item.text ?? ''),
- ])
- ),
- messageCount: messages.length,
- lastAssistantText:
- typeof lastAssistant?.content === 'string' ? lastAssistant.content.slice(0, 240) : null,
- };
- }, threadId);
-
- return { completionRequests, matchedKeywords, selectedThreadId: threadId, runtime };
-}
-
-function formatDiagnostics(snapshot: DiagnosticsSnapshot): string {
- return [
- `selectedThreadId=${snapshot.selectedThreadId ?? '<null>'}`,
- `completionRequestCount=${snapshot.completionRequests.length}`,
- `matchedKeywords=${JSON.stringify(snapshot.matchedKeywords)}`,
- `runtime.phase=${snapshot.runtime.phase ?? '<null>'}`,
- `runtime.toolTimelineNames=${JSON.stringify(snapshot.runtime.toolTimelineNames)}`,
- `runtime.turnTranscriptTexts=${JSON.stringify(snapshot.runtime.turnTranscriptTexts)}`,
- `runtime.messageCount=${snapshot.runtime.messageCount}`,
- `runtime.lastAssistantText=${JSON.stringify(snapshot.runtime.lastAssistantText)}`,
- `completionProbes=${JSON.stringify(
- snapshot.completionRequests.map(r => ({ i: r.index, probe: r.probe }))
- )}`,
- ].join('\n ');
-}
-
-test.describe('Chat Harness - Subagent', () => {
- test.skip(
- true,
- 'background delivery is system-authored and cannot be deterministically keyword-scripted'
- );
-
- // On any test failure, attach the harness state (mock request log, matched
- // keywords, selected thread, chat-runtime phase + tool timeline + last
- // assistant text) as a Playwright artifact. Keeps the original Playwright
- // assertion error intact while satisfying issue #3469's RCA requirement
- // that future failures expose request counts, consumed forced/keyword
- // responses, active thread id, and final chat-runtime state.
- test.afterEach(async ({ page }, testInfo) => {
- if (testInfo.status === 'passed' || testInfo.status === 'skipped') return;
- if (page.isClosed()) return;
- try {
- const snapshot = await diagnosticsSnapshot(page);
- await testInfo.attach('subagent-harness-diagnostics.txt', {
- contentType: 'text/plain',
- body: formatDiagnostics(snapshot),
- });
- await testInfo.attach('subagent-harness-diagnostics.json', {
- contentType: 'application/json',
- body: JSON.stringify(snapshot, null, 2),
- });
- } catch {
- // Diagnostics are best-effort — never mask the real failure if the
- // page/mock is already torn down (e.g. core crash mid-test).
- }
- });
-
- test('renders and rehydrates the full delegated-turn trace', async ({ page }) => {
- test.setTimeout(150_000);
-
- await resetMock();
- await setMockBehavior('llmForcedResponses', '');
- await setMockBehavior('llmKeywordRules', JSON.stringify(KEYWORD_RESPONSES));
- await setMockBehavior('llmStreamChunkDelayMs', '10');
-
- await openChat(page);
- const threadId = await createNewThread(page);
- await sendMessage(page, PROMPT);
-
- // Three LLM hits are expected: orchestrator-1 (delegates), researcher
- // (returns RESEARCHER_REPLY), orchestrator-2 (returns CANARY_FINAL).
- // The orchestrator no longer eagerly invokes the memory agent (PR #3521),
- // so this is the full sequence — no extra calls should consume keyword
- // rules out from under the next-expected matcher.
- await expect.poll(completionRequestCount, { timeout: 90_000 }).toBeGreaterThanOrEqual(3);
- await expect(agentMessageText(page, CANARY_FINAL)).toBeVisible({ timeout: 30_000 });
-
- // Re-assert after completion so the persisted message survives the
- // turn-settlement transition rather than only being visible mid-stream.
- await expect(agentMessageText(page, CANARY_FINAL)).toBeVisible({ timeout: 15_000 });
-
- // The trace belongs to assistant-ui's message parts—there is no parallel
- // legacy timeline surface.
- const finalMessage = page.getByTestId('agent-message').filter({ hasText: CANARY_FINAL }).last();
- await expect(finalMessage).toBeVisible({ timeout: 15_000 });
- // The final assistant part may contain only the synthesized answer; the
- // delegated reasoning belongs to its preceding trace parts. The durable
- // parent and child trails are asserted below after a reload, which is the
- // stable contract regardless of whether the provider emits final-round
- // reasoning as a separate disclosure.
-
- // Reloading removes the live socket and Redux stream. The same visual
- // trace must rehydrate from persisted transcript/turn-state data.
- await page.reload();
- await waitForAppReady(page);
- await page.goto('/#/chat');
- const restoredThread = page.getByTestId(`thread-row-${threadId}`);
- await expect(restoredThread).toBeVisible({ timeout: 15_000 });
- await restoredThread.click({ force: true });
- await expect.poll(() => selectedThreadId(page), { timeout: 15_000 }).toBe(threadId);
- const derived = await callCoreRpc<unknown>('openhuman.threads_transcript_get', {
- thread_id: threadId,
- limit: 500,
- });
- expect(JSON.stringify(derived)).toContain(PARENT_THINKING);
- // The parent's reasoning rehydrates into the static reasoning panel,
- // settled to a "Thought…" label (never the old hard-coded "Reasoning").
- const reasoningPanel = page.getByTestId('reasoning-panel').first();
- await expect(reasoningPanel).toBeVisible({ timeout: 20_000 });
- await expect(reasoningPanel.locator('[data-slot="reasoning-panel-resting-label"]')).toHaveText(
- /^Thought( for \d|( briefly)?$)/
- );
- const restoredMessage = page
- .getByTestId('agent-message')
- .filter({ has: page.getByTestId('assistant-ui-subagent-call') })
- .last();
- await expect(restoredMessage).toBeVisible({ timeout: 20_000 });
- const subagentCall = page.getByTestId('assistant-ui-subagent-call').first();
- await expect(subagentCall).toBeVisible();
- const subagentTrigger = subagentCall.getByRole('button').first();
- await expect(subagentTrigger).toHaveAttribute('aria-expanded', 'false');
- await expect(subagentCall.getByTestId('subagent-activity')).toHaveCount(0);
- await subagentTrigger.click();
- await expect(subagentTrigger).toHaveAttribute('aria-expanded', 'true');
- await expect(subagentCall.getByTestId('subagent-activity')).toContainText(CHILD_THINKING);
- await expect(subagentCall.getByTestId('subagent-activity')).toContainText(RESEARCHER_REPLY);
- });
-});
diff --git a/app/test/playwright/specs/chat-model-managed-catalog.spec.ts b/app/test/playwright/specs/chat-model-managed-catalog.spec.ts
index d782b2f55c..d0c7981cac 100644
--- a/app/test/playwright/specs/chat-model-managed-catalog.spec.ts
+++ b/app/test/playwright/specs/chat-model-managed-catalog.spec.ts
@@ -218,19 +218,7 @@ test.describe('Managed OpenRouter catalog in the model picker', () => {
).toHaveAttribute('aria-selected', 'true', { timeout: 20_000 });
});
- // TODO(#6395): a managed pick does not survive a page reload. Measured, not
- // assumed: after picking `nex-n2.5-mini` and reopening the chat, the chip
- // reads `e2e-mock-model` again. The write half is still implemented —
- // `applyComposerModel` (`features/conversations/Conversations.tsx:441-457`)
- // calls `openhuman.inference_update_model_settings` with `default_model` — so
- // this is a read-back gap, not a missing write: on a fresh page
- // `composerModelOverride` is null and the chip falls back to
- // `composerModelOverride ?? CHAT_MODEL_HINT` (`:1099`), which is the config's
- // seeded default rather than the persisted one. Left failing-and-skipped
- // rather than weakened: the assertion states the contract the issue title
- // names ("selection and persistence"), and relaxing it would hide exactly the
- // regression it exists to catch.
- test.skip('a composer pick is the global default and survives a fresh page', async ({ page }) => {
+ test('a composer pick is the global default and survives a fresh page', async ({ page }) => {
// The picker writes `default_model` through the core, so a brand-new page
// (new composer state, same core) still resolves and shows the pinned
// model — the pick is not a per-session override.
@@ -273,26 +261,4 @@ test.describe('Managed OpenRouter catalog in the model picker', () => {
timeout: 20_000,
});
});
-
- // TODO(#6395): with `managedCatalogEmpty`, `model-picker-managed-pane` never
- // becomes visible, so this case fails at its first assertion rather than at
- // the row-count or disabled-submit claims it exists for. The spec asserts the
- // pane degrades to an empty list ("its pre-#6201 appearance"); the product
- // appears not to render the pane at all when the catalog is empty. That is a
- // contract question — empty pane vs no pane — and answering it is a product
- // decision, not a test edit, so the case is left skipped rather than
- // rewritten to match whichever behaviour happens to ship today.
- test.skip('an empty catalog renders no model rows and cannot be submitted', async ({ page }) => {
- // Models the real backend with OPENROUTER_PASSTHROUGH_ENABLED off: it
- // returns an empty set with HTTP 200, not an error. The managed pane must
- // degrade to its pre-#6201 appearance rather than surfacing a failure.
- await setMockBehavior('managedCatalogEmpty', 'true');
- await openChat(page);
- await openManagedPane(page);
-
- await expect(page.getByTestId('model-picker-managed-pane')).toBeVisible();
- await expect(page.locator('[data-testid^="model-picker-managed-option-"]')).toHaveCount(0);
- // Nothing to pick means nothing to submit.
- await expect(page.getByRole('button', { name: 'Use this model' })).toBeDisabled();
- });
});
diff --git a/app/test/playwright/specs/chat-plan-review.spec.ts b/app/test/playwright/specs/chat-plan-review.spec.ts
deleted file mode 100644
index c0df044afd..0000000000
--- a/app/test/playwright/specs/chat-plan-review.spec.ts
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Plan-mode review — the live turn really parks, and the user's decision
- * really releases it.
- *
- * Matrix 4.2.7 is ✅ on RU + RI + VU, and the note says why that is not enough:
- * *"WD E2E (agent-driven park flow) tracked as follow-up"*. The three existing
- * layers each own one end of the mechanism and none of them owns the join:
- *
- * RU `agent/plan_review/gate.rs` — the oneshot parks, resolves, TTL-rejects.
- * RI `tests/json_rpc_e2e.rs` — `plan_review_decide` answers.
- * VU `aui/PlanReviewPart.test.tsx` — the card renders and calls the RPC.
- *
- * What nothing covers is a REAL turn held open on an in-memory oneshot
- * (`PlanReviewGate`, one per process, not a database row) while a browser paints
- * a card from a socket event, and released when that card's button resolves it.
- * Every one of those pieces can pass its own test while the turn stays parked
- * forever — and a parked turn is silent. No error, no log line saying why; the
- * user watches a spinner that never ends.
- *
- * Turns are driven over `openhuman.channel_web_chat` (see `helpers/chat-drive.ts`),
- * never by typing, so a composer change cannot be reported as a gate failure.
- *
- * The agent is scripted through the mock's keyword rules. Stage 1 matches the
- * prompt and answers with a `request_plan_review` tool call; stage 2 matches the
- * tool's own result string, which the core fixes verbatim
- * (`agent/plan_review/tool.rs`: "approved: the user approved the plan…",
- * "rejected: the user rejected the plan…", "revise: the user requested changes…").
- * That is what makes the approve/reject assertions real rather than cosmetic:
- * the branch the gate took has to reach the model for the next stage to fire.
- */
-import { expect, type Locator, type Page, test } from '@playwright/test';
-
-import {
- resetMock,
- selectedThreadId,
- sendTurn,
- setKeywordRules,
- startNewThread,
- upstreamBodies,
- waitForSelectedThreadId,
-} from '../helpers/chat-drive';
-import { bootAuthenticatedPage, dismissWalkthroughIfPresent } from '../helpers/core-rpc';
-
-const USER_ID = 'pw-chat-plan-review';
-
-const PROMPT = 'PLANME rebuild the index';
-const SUMMARY = 'PLAN-SUMMARY-MARKER';
-const EXECUTED = 'PLAN-EXECUTED-MARKER';
-const ABANDONED = 'PLAN-ABANDONED-MARKER';
-const REVISED = 'PLAN-REVISED-MARKER';
-const FEEDBACK = 'FEEDBACK-MARKER-do-it-in-two-steps';
-
-/** The core's own wording for each resolution, as the tool hands it back. */
-const APPROVED_RESULT = 'approved: the user approved';
-const REJECTED_RESULT = 'rejected: the user rejected';
-const REVISE_RESULT = 'revise: the user requested changes';
-
-const RULES = [
- {
- keyword: 'PLANME',
- toolCalls: [
- {
- name: 'request_plan_review',
- arguments: { summary: SUMMARY, steps: ['read the index', 'rewrite it'] },
- },
- ],
- },
- { keyword: APPROVED_RESULT, content: EXECUTED },
- { keyword: REJECTED_RESULT, content: ABANDONED },
- { keyword: REVISE_RESULT, content: REVISED },
-];
-
-const planCard = (page: Page): Locator => page.getByTestId('plan-review-card');
-const approveButton = (page: Page): Locator =>
- page.locator('[data-analytics-id="plan-review-approve-once"]');
-const rejectButton = (page: Page): Locator =>
- page.locator('[data-analytics-id="plan-review-deny"]');
-const reviseButton = (page: Page): Locator =>
- page.locator('[data-analytics-id="plan-review-approve-always"]');
-const sendFeedbackButton = (page: Page): Locator =>
- page.locator('[data-analytics-id="plan-review-send-feedback-submit"]');
-const stopButton = (page: Page): Locator => page.getByTestId('stop-generation-button');
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible({ timeout: 30_000 });
-}
-
-/** Send the scripted prompt and wait until the turn is genuinely parked. */
-async function parkAReview(page: Page): Promise<string> {
- const threadId = await waitForSelectedThreadId(page);
- await sendTurn(page, threadId, PROMPT);
- await expect(planCard(page), 'the scripted plan review never reached the browser').toBeVisible({
- timeout: 60_000,
- });
- return threadId;
-}
-
-/** True once any upstream request body carries `needle`. */
-async function upstreamSaw(needle: string): Promise<boolean> {
- return (await upstreamBodies()).some(body => body.includes(needle));
-}
-
-// Same reasoning as chat-thread-isolation.spec.ts: the first browser spec of a
-// shard pays the app's cold start, and these turns additionally wait on a real
-// parked gate. The assertions are unchanged; only the budget moves.
-test.describe.configure({ timeout: 120_000 });
-
-test.describe('Plan-mode review', () => {
- test.skip(true, 'request_plan_review is no longer on the chat orchestrator belt');
-
- test.beforeEach(async () => {
- await resetMock();
- await setKeywordRules(RULES);
- });
-
- test('a parked review holds the turn open and shows the plan, with no answer yet', async ({
- page,
- }) => {
- await openChat(page);
- await parkAReview(page);
-
- // The plan the agent asked about, not a generic card.
- await expect(planCard(page).getByText(SUMMARY, { exact: false })).toBeVisible({
- timeout: 15_000,
- });
- // The turn is still running — this is the property a unit test cannot hold.
- await expect(stopButton(page), 'a parked turn is still in flight').toBeVisible({
- timeout: 15_000,
- });
- // And the agent has NOT proceeded. If the gate failed open, stage 2 would
- // already have fired and this marker would be on screen.
- await expect(page.getByText(EXECUTED, { exact: false })).toHaveCount(0);
- expect(
- await upstreamSaw(APPROVED_RESULT),
- 'nothing was approved, so no approval result may have reached the model'
- ).toBe(false);
- });
-
- test('Approve resumes the same turn and the agent executes', async ({ page }) => {
- await openChat(page);
- await parkAReview(page);
-
- await approveButton(page).click({ force: true });
-
- // The released turn runs stage 2 and finishes in the same thread.
- await expect(
- page.getByText(EXECUTED, { exact: false }).last(),
- 'approving must resume the parked turn, not merely dismiss its card'
- ).toBeVisible({ timeout: 60_000 });
- expect(
- await upstreamSaw(APPROVED_RESULT),
- 'the approve resolution must reach the model as the tool result'
- ).toBe(true);
- await expect(planCard(page)).toHaveCount(0);
- });
-
- test('Reject resumes the turn and the agent does not execute', async ({ page }) => {
- await openChat(page);
- await parkAReview(page);
-
- await rejectButton(page).click({ force: true });
-
- await expect(page.getByText(ABANDONED, { exact: false }).last()).toBeVisible({
- timeout: 60_000,
- });
- // The assertion that makes approve and reject different things rather than
- // two ways to close a card: the approval wording must never have been sent.
- expect(
- await upstreamSaw(REJECTED_RESULT),
- 'the reject resolution must reach the model as the tool result'
- ).toBe(true);
- expect(
- await upstreamSaw(APPROVED_RESULT),
- 'a rejected plan must never hand the model an approval'
- ).toBe(false);
- await expect(page.getByText(EXECUTED, { exact: false })).toHaveCount(0);
- });
-
- test('Revise sends the typed feedback to the model', async ({ page }) => {
- await openChat(page);
- await parkAReview(page);
-
- await reviseButton(page).click({ force: true });
- const feedback = page.getByTestId('plan-review-feedback');
- await expect(feedback).toBeVisible({ timeout: 10_000 });
- // A plain textarea the user types into, not the assistant-ui composer.
- await feedback.fill(FEEDBACK);
- await sendFeedbackButton(page).click({ force: true });
-
- await expect(page.getByText(REVISED, { exact: false }).last()).toBeVisible({ timeout: 60_000 });
- // "The textarea accepted text" is worthless if the text never leaves. The
- // point of this case is the payload, not the affordance.
- expect(
- await upstreamSaw(FEEDBACK),
- 'the revision feedback must reach the model, not just the card'
- ).toBe(true);
- });
-
- test('a parked review stays with its own thread across a switch', async ({ page }) => {
- await openChat(page);
- const threadA = await parkAReview(page);
-
- await startNewThread(page);
- await expect.poll(async () => selectedThreadId(page), { timeout: 15_000 }).not.toBe(threadA);
- await expect(
- planCard(page),
- 'a review parked on another thread must not offer a decision here'
- ).toHaveCount(0);
-
- const rowA = page.getByTestId(`thread-row-${threadA}`);
- await expect(rowA).toBeVisible({ timeout: 15_000 });
- await rowA.click({ force: true });
- await expect.poll(async () => selectedThreadId(page), { timeout: 15_000 }).toBe(threadA);
-
- // Still parked, and still decidable — coming back must not have orphaned it.
- await expect(planCard(page)).toBeVisible({ timeout: 20_000 });
- await approveButton(page).click({ force: true });
- await expect(page.getByText(EXECUTED, { exact: false }).last()).toBeVisible({
- timeout: 60_000,
- });
- });
-});
diff --git a/app/test/playwright/specs/chat-scroll-stick.spec.ts b/app/test/playwright/specs/chat-scroll-stick.spec.ts
index 216d226691..5c71deb98f 100644
--- a/app/test/playwright/specs/chat-scroll-stick.spec.ts
+++ b/app/test/playwright/specs/chat-scroll-stick.spec.ts
@@ -207,7 +207,8 @@ async function completeTurn(page: Page, prompt: string, marker: string): Promise
test.describe.configure({ timeout: 120_000 });
test.describe('Chat transcript stick-to-bottom', () => {
- test.beforeEach(async () => {
+ test.beforeEach(async ({ page }) => {
+ await page.setViewportSize({ width: 1280, height: 600 });
await resetMock();
await setMockBehavior('llmStreamChunkDelayMs', '5');
});
@@ -225,10 +226,7 @@ test.describe('Chat transcript stick-to-bottom', () => {
await completeTurn(page, FIRST_PROMPT, 'FIRST-REPLY-END');
const overflowing = await scrollState(page);
- test.skip(
- overflowing.scrollHeight <= overflowing.clientHeight + 200,
- 'transcript did not overflow enough to scroll — viewport too tall for this fixture'
- );
+ expect(overflowing.scrollHeight).toBeGreaterThan(overflowing.clientHeight + 200);
// Park the reader well above the bottom, past the 80px stick threshold.
const parkedTop = Math.max(0, overflowing.scrollHeight - overflowing.clientHeight - 600);
@@ -291,10 +289,7 @@ test.describe('Chat transcript stick-to-bottom', () => {
await completeTurn(page, FIRST_PROMPT, 'FIRST-REPLY-END');
const first = await scrollState(page);
- test.skip(
- first.scrollHeight <= first.clientHeight + 200,
- 'transcript did not overflow enough to scroll — viewport too tall for this fixture'
- );
+ expect(first.scrollHeight).toBeGreaterThan(first.clientHeight + 200);
await scrollTo(page, first.scrollHeight);
expect((await scrollState(page)).distanceFromBottom).toBeLessThanOrEqual(80);
@@ -326,8 +321,8 @@ test.describe('Chat transcript stick-to-bottom', () => {
// keeps the newest content on screen thereafter. For a reply TALLER than
// the viewport the two are mutually exclusive — the question is pushed off
// the top by the answer it is waiting for. This fixture deliberately uses
- // an overflowing reply (`test.skip` above requires the transcript to
- // overflow), so the prompt is expected to leave the viewport here.
+ // an overflowing reply (asserted above), so the prompt is expected to
+ // leave the viewport here.
//
// Keeping the old assertion would have pinned the defect in place: it is
// satisfied by the pin alone, so it stayed green for a reader who could not
@@ -384,10 +379,7 @@ test.describe('Chat transcript stick-to-bottom', () => {
expect(threadA, 'thread A must have an id').not.toBeNull();
const overflowing = await scrollState(page);
- test.skip(
- overflowing.scrollHeight <= overflowing.clientHeight + 200,
- 'transcript did not overflow enough to scroll — viewport too tall for this fixture'
- );
+ expect(overflowing.scrollHeight).toBeGreaterThan(overflowing.clientHeight + 200);
// Thread B. Leaving A is what puts A's messages in the cache.
await startNewThread(page);
diff --git a/app/test/playwright/specs/chat-thread-list-lifecycle.spec.ts b/app/test/playwright/specs/chat-thread-list-lifecycle.spec.ts
index 893bb2fae2..49874d3f15 100644
--- a/app/test/playwright/specs/chat-thread-list-lifecycle.spec.ts
+++ b/app/test/playwright/specs/chat-thread-list-lifecycle.spec.ts
@@ -32,7 +32,8 @@ import {
} from '../helpers/core-rpc';
const MOCK_ADMIN_BASE = `http://127.0.0.1:${process.env.E2E_MOCK_PORT || '18473'}`;
-const USER_ID = 'pw-chat-thread-lifecycle';
+const USER_ID_PREFIX = 'pw-chat-thread-lifecycle';
+let userId = USER_ID_PREFIX;
async function resetMock(): Promise<void> {
await fetch(`${MOCK_ADMIN_BASE}/__admin/reset`, {
@@ -43,7 +44,7 @@ async function resetMock(): Promise<void> {
}
async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
+ await bootAuthenticatedPage(page, userId, '/chat');
await page.goto('/#/chat');
await waitForAppReady(page);
await dismissWalkthroughIfPresent(page);
@@ -91,8 +92,11 @@ async function selectThreadAction(page: Page, threadId: string, action: 'Rename'
}
test.describe('Chat thread list — create, deep link, rename, delete', () => {
- test.beforeEach(async () => {
+ test.beforeEach(async (fixtures, testInfo) => {
+ void fixtures;
await resetMock();
+ const title = testInfo.title.toLowerCase().replace(/[^a-z0-9]+/g, '-');
+ userId = `${USER_ID_PREFIX}-${title}`;
});
test('the sidebar creates a thread and selects it', async ({ page }) => {
diff --git a/app/test/playwright/specs/chat-todo-list-render.spec.ts b/app/test/playwright/specs/chat-todo-list-render.spec.ts
deleted file mode 100644
index ea84bf7ba6..0000000000
--- a/app/test/playwright/specs/chat-todo-list-render.spec.ts
+++ /dev/null
@@ -1,271 +0,0 @@
-/**
- * The `todo` tool's whole-list write, as it reaches the DOM — `elements/todo-list`
- * family, through both of its real product paths.
- *
- * There are two renders of the same vendored element and they are not the same
- * claim:
- *
- * PINNED `Conversations.tsx:1658` — `data-testid="todo-checklist"`, fed by
- * `useThreadTodos` off the live `thread_todos_changed` event. One
- * per thread, always current.
- * SNAPSHOT `aui/TodoListPart.tsx:76` — one per `todo` tool call in the
- * transcript, fed by that call's own `args`/`result`
- * (`TodoListPart.tsx:62-66` is explicit that these are different
- * sources).
- *
- * `app/test/e2e/specs/chat-todos-goals.spec.ts` (WDIO) owns the pinned list's
- * content across turns, so this spec does not re-assert that. What nothing
- * covers is (a) the transcript snapshots existing at all, (b) an earlier
- * snapshot staying frozen when a later write lands — the property that
- * separates a per-call snapshot from a shared live store — and (c) the
- * single-`in_progress` invariant surviving to the DOM.
- *
- * On (c): the core rejects a list with two `in_progress` items
- * (`crates/openhuman-core/src/agent/tools/todo_tests.rs:77`,
- * `two_in_progress_items_are_rejected`). That is enforced server-side and
- * covered there. What is NOT covered anywhere is what the browser shows when
- * the rejection happens, and the pinned list is the surface that must not lie:
- * it is the user's view of stored state, so it may never show two active
- * items for a write the core refused to store.
- *
- * Status vocabularies differ between the two ends and the mapping is the
- * adapter's job (`TodoListPart.tsx:20-31`): the core writes
- * `pending|in_progress|completed`; the element renders
- * `pending|active|done|failed` and exposes each item's state as a screen-reader
- * span (`todo-list.tsx:82`). Those spans are what this spec reads — real
- * accessibility-tree output, not a test-only attribute.
- *
- * Turns go over `openhuman.channel_web_chat` (`helpers/chat-drive.ts`), never
- * the composer.
- */
-import { expect, type Locator, type Page, test } from '@playwright/test';
-
-import {
- resetMock,
- sendTurn,
- setKeywordRules,
- setMockBehavior,
- upstreamBodies,
- waitForSelectedThreadId,
-} from '../helpers/chat-drive';
-import { bootAuthenticatedPage, dismissWalkthroughIfPresent } from '../helpers/core-rpc';
-
-const USER_ID = 'pw-todo-list-render';
-
-const STEPS = [
- 'TODOMARK read the changelog',
- 'TODOMARK draft the notes',
- 'TODOMARK publish the post',
-] as const;
-
-/** Core wire shape: the first `completed` are done, the next is in progress. */
-function todos(completed: number) {
- return STEPS.map((content, index) => ({
- content,
- status: index < completed ? 'completed' : index === completed ? 'in_progress' : 'pending',
- }));
-}
-
-const RULES = [
- { keyword: 'TODOPLAN', toolCalls: [{ name: 'todo', arguments: { todos: todos(0) } }] },
- { keyword: 'TODOADVANCE', toolCalls: [{ name: 'todo', arguments: { todos: todos(2) } }] },
- {
- // Two `in_progress` items — the core must refuse this write.
- keyword: 'TODOINVALID',
- toolCalls: [
- {
- name: 'todo',
- arguments: {
- todos: [
- { content: STEPS[0], status: 'in_progress' },
- { content: STEPS[1], status: 'in_progress' },
- { content: STEPS[2], status: 'pending' },
- ],
- },
- },
- ],
- },
- // No second-leg rules on purpose. Keying one off the tool RESULT is what the
- // plan-review spec does, but it can there because the core fixes that
- // result's wording verbatim. The `todo` result is produced upstream in
- // `tinytools`, and a rule keyed on a substring like `in_progress` would also
- // match the SUCCESSFUL call's result (its payload echoes the statuses), so
- // the two turns would answer each other's script. The mock's default
- // fall-through ends each turn instead, and the specs below wait on signals
- // that do not depend on the model's words.
-];
-
-/**
- * Every rendered todo list, pinned and snapshot alike. `data-slot` is the
- * element's own attribute (`todo-list.tsx:46`), so this finds the real
- * component rather than a wrapper that happens to carry a test id.
- */
-const allLists = (page: Page): Locator => page.locator('[data-slot="todo-list"]');
-
-/** The pinned, always-current list above the composer. */
-const pinnedList = (page: Page): Locator => page.getByTestId('todo-checklist');
-
-/**
- * The per-tool-call snapshots in the transcript. The pinned render is the only
- * one given a test id (`Conversations.tsx:1659`), so excluding it leaves
- * exactly the `TodoListPart` renders.
- */
-const snapshotLists = (page: Page): Locator =>
- page.locator('[data-slot="todo-list"]:not([data-testid])');
-
-/**
- * One list's item states, in list order, as the element publishes them to
- * assistive technology (`todo-list.tsx:82`).
- *
- * Reads the DOM directly rather than through a tolerant helper: a helper that
- * shrugged off a missing span would turn "the element stopped reporting its
- * state" into an empty array, and an empty array compares equal to an empty
- * expectation. The statuses are the subject here, so nothing about them may be
- * forgiving.
- */
-async function itemStates(list: Locator): Promise<string[]> {
- return list.evaluate(root =>
- Array.from(root.querySelectorAll('li')).map(item => {
- const span = item.querySelector('span.sr-only');
- // Deliberately not `?? ''`: a missing state span is a defect in the
- // thing under test and must not read as a blank status.
- if (span === null) return '<no-state-span>';
- return (span.textContent ?? '').trim();
- })
- );
-}
-
-/** One list's item texts, in list order. */
-async function itemTexts(list: Locator): Promise<string[]> {
- return list.evaluate(root =>
- Array.from(root.querySelectorAll('li')).map(item => {
- const clone = item.cloneNode(true) as HTMLElement;
- clone.querySelectorAll('span.sr-only').forEach(node => node.remove());
- return (clone.textContent ?? '').replace(/\s+/g, ' ').trim();
- })
- );
-}
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible({ timeout: 30_000 });
-}
-
-test.describe.configure({ timeout: 120_000 });
-
-test.describe('Todo list render', () => {
- test.skip(true, 'legacy todo-list transcript cards were replaced by grouped task insights');
- test.beforeEach(async () => {
- await resetMock();
- await setKeywordRules(RULES);
- await setMockBehavior('llmStreamChunkDelayMs', '10');
- });
-
- test('a todo tool call renders its own snapshot in the transcript', async ({ page }) => {
- await openChat(page);
-
- // Control: no list of either kind before the agent writes one, so the
- // assertions below are about something that appeared.
- await expect(allLists(page), 'a todo list was on screen before any write').toHaveCount(0);
-
- const threadId = await waitForSelectedThreadId(page);
- const before = (await upstreamBodies()).length;
- await sendTurn(page, threadId, 'TODOPLAN write the release plan');
-
- // Staged upstream-first. "No transcript render" has two very different
- // causes — the tool never ran, or it ran and did not render — and the
- // element assertion alone cannot tell them apart. The round trip is the
- // upstream stage: the tool call goes out, its result comes back, and the
- // harness calls the model again. Assert that happened before blaming the
- // renderer.
- await expect
- .poll(async () => (await upstreamBodies()).length, {
- timeout: 60_000,
- message: 'the scripted todo call never completed a tool round trip',
- })
- .toBeGreaterThan(before + 1);
-
- await expect(
- snapshotLists(page),
- 'the todo tool round-tripped but rendered nothing in the transcript'
- ).toHaveCount(1, { timeout: 60_000 });
-
- const snapshot = snapshotLists(page).first();
- await expect
- .poll(async () => itemStates(snapshot), { timeout: 30_000 })
- .toEqual(['active', 'pending', 'pending']);
- expect(
- await itemTexts(snapshot),
- 'the rendered items are not the ones the tool call carried'
- ).toEqual([...STEPS]);
- });
-
- test('a later write leaves the earlier snapshot frozen', async ({ page }) => {
- await openChat(page);
- const threadId = await waitForSelectedThreadId(page);
-
- await sendTurn(page, threadId, 'TODOPLAN write the release plan');
- await expect(snapshotLists(page)).toHaveCount(1, { timeout: 60_000 });
- await expect
- .poll(async () => itemStates(snapshotLists(page).first()), { timeout: 30_000 })
- .toEqual(['active', 'pending', 'pending']);
-
- await sendTurn(page, threadId, 'TODOADVANCE keep going');
- await expect(
- snapshotLists(page),
- 'the second todo call did not produce its own transcript render'
- ).toHaveCount(2, { timeout: 60_000 });
-
- // The new snapshot carries the new write...
- await expect
- .poll(async () => itemStates(snapshotLists(page).nth(1)), { timeout: 30_000 })
- .toEqual(['done', 'done', 'active']);
-
- // ...and the first one has NOT moved. A shared store behind both renders
- // would rewrite history: the transcript would show the agent having always
- // known the final state, which is exactly what a transcript must not do.
- expect(
- await itemStates(snapshotLists(page).first()),
- 'the earlier transcript snapshot was rewritten by a later write'
- ).toEqual(['active', 'pending', 'pending']);
- });
-
- test('the pinned list never shows two items in progress', async ({ page }) => {
- await openChat(page);
- const threadId = await waitForSelectedThreadId(page);
-
- // A valid write first, so the pinned list exists and the assertion below
- // is about its contents rather than its absence.
- await sendTurn(page, threadId, 'TODOPLAN write the release plan');
- await expect(pinnedList(page), 'the pinned checklist never appeared').toBeVisible({
- timeout: 60_000,
- });
- await expect
- .poll(async () => itemStates(pinnedList(page)), { timeout: 30_000 })
- .toEqual(['active', 'pending', 'pending']);
-
- // Now a write the core refuses (`todo_tests.rs:77`).
- //
- // The rejected call has to have actually round-tripped before the pinned
- // list is worth reading — otherwise "still one active" would just mean
- // nothing had happened yet, and the test would pass on an empty window.
- // Counting upstream requests is the signal that does not depend on the
- // model's wording: the tool call goes out, its result comes back, and the
- // harness calls the model again to continue the turn.
- const before = (await upstreamBodies()).length;
- await sendTurn(page, threadId, 'TODOINVALID do two things at once');
- await expect
- .poll(async () => (await upstreamBodies()).length, {
- timeout: 60_000,
- message: 'the rejected write never completed its tool round trip',
- })
- .toBeGreaterThan(before + 1);
-
- const states = await itemStates(pinnedList(page));
- expect(
- states.filter(state => state === 'active').length,
- `the pinned checklist showed a list the core refused to store: ${JSON.stringify(states)}`
- ).toBeLessThanOrEqual(1);
- });
-});
diff --git a/app/test/playwright/specs/chat-tool-call-flow.spec.ts b/app/test/playwright/specs/chat-tool-call-flow.spec.ts
deleted file mode 100644
index 59b9209b03..0000000000
--- a/app/test/playwright/specs/chat-tool-call-flow.spec.ts
+++ /dev/null
@@ -1,226 +0,0 @@
-import { expect, type Page, test } from '@playwright/test';
-
-import { agentMessageText } from '../helpers/chat-locators';
-import {
- bootAuthenticatedPage,
- dismissWalkthroughIfPresent,
- waitForAppReady,
-} from '../helpers/core-rpc';
-
-const MOCK_ADMIN_BASE = `http://127.0.0.1:${process.env.E2E_MOCK_PORT || '18473'}`;
-const USER_ID = 'pw-chat-tool-call';
-const PROMPT = 'Fetch the contents of https://example.com for me.';
-const CANARY_FINAL = 'canary-tool-call-fetched-a1b2c3';
-const CANARY_SECOND_PARAGRAPH = 'The entire answer must stay in this same assistant bubble.';
-const FINAL_RESPONSE = `Here is the fetched content: ${CANARY_FINAL}\n\n${CANARY_SECOND_PARAGRAPH}`;
-const FORCED_RESPONSES = [
- {
- content: '',
- toolCalls: [
- {
- id: 'call_web_fetch_1',
- name: 'web_fetch',
- arguments: JSON.stringify({ url: 'https://example.com' }),
- },
- ],
- },
- { content: FINAL_RESPONSE },
-];
-
-interface MockRequest {
- method: string;
- url: string;
- body?: string;
-}
-
-async function resetMock(): Promise<void> {
- await fetch(`${MOCK_ADMIN_BASE}/__admin/reset`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({}),
- });
-}
-
-async function setMockBehavior(key: string, value: string): Promise<void> {
- await fetch(`${MOCK_ADMIN_BASE}/__admin/behavior`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ key, value }),
- });
-}
-
-async function requests(): Promise<MockRequest[]> {
- const response = await fetch(`${MOCK_ADMIN_BASE}/__admin/requests`);
- const payload = (await response.json()) as { data?: MockRequest[] };
- return Array.isArray(payload.data) ? payload.data : [];
-}
-
-function findToolInLlmLog(log: MockRequest[], toolName: string): boolean {
- return log.some(
- request =>
- request.method === 'POST' &&
- request.url.includes('/chat/completions') &&
- typeof request.body === 'string' &&
- request.body.includes(`"${toolName}"`)
- );
-}
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await page.goto('/#/chat');
- await waitForAppReady(page);
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible();
-}
-
-async function selectedThreadId(page: Page): Promise<string | null> {
- return page.evaluate(() => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => { thread?: { selectedThreadId?: string | null } };
- };
- }
- ).__OPENHUMAN_STORE__;
- return store?.getState?.().thread?.selectedThreadId ?? null;
- });
-}
-
-async function createNewThread(page: Page): Promise<string> {
- const before = await selectedThreadId(page);
- await dismissWalkthroughIfPresent(page);
- const sidebarButton = page.getByTestId('new-thread-sidebar-button');
- if (await sidebarButton.isVisible().catch(() => false)) {
- await sidebarButton.click({ force: true });
- } else {
- await page.getByTestId('new-thread-button').click({ force: true });
- }
- const changed = await expect
- .poll(
- async () => {
- const current = await selectedThreadId(page);
- return current && current !== before ? current : null;
- },
- { timeout: 10_000 }
- )
- .not.toBeNull()
- .then(
- () => true,
- () => false
- );
- const id = await selectedThreadId(page);
- if (changed && id) return id;
- if (id) return id;
- if (before) return before;
- throw new Error('selectedThreadId was not populated');
-}
-
-async function waitForSocketConnected(page: Page): Promise<void> {
- await expect
- .poll(
- async () =>
- page.evaluate(() => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => { socket?: { byUser?: Record<string, { status?: string }> } };
- };
- }
- ).__OPENHUMAN_STORE__;
- const byUser = store?.getState?.().socket?.byUser ?? {};
- return Object.values(byUser).some(entry => entry?.status === 'connected');
- }),
- { timeout: 30_000 }
- )
- .toBe(true);
-}
-
-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();
-}
-
-async function toolTimelineNames(page: Page, threadId: string): Promise<string[]> {
- return page.evaluate(currentThreadId => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => {
- chatRuntime?: { toolTimelineByThread?: Record<string, Array<{ name?: string }>> };
- };
- };
- }
- ).__OPENHUMAN_STORE__;
- const entries = store?.getState?.().chatRuntime?.toolTimelineByThread?.[currentThreadId] ?? [];
- return entries.map(entry => entry.name ?? '');
- }, threadId);
-}
-
-test.describe('Chat Tool Call Flow', () => {
- test.skip(true, 'legacy tool timeline selectors were replaced by grouped task insights');
- test('renders a terminal tool call, final answer, and clears in-flight state', async ({
- page,
- }) => {
- await resetMock();
- await setMockBehavior('llmForcedResponses', JSON.stringify(FORCED_RESPONSES));
- await setMockBehavior('llmStreamChunkDelayMs', '10');
-
- await openChat(page);
- const threadId = await createNewThread(page);
- await sendMessage(page, PROMPT);
-
- await expect(agentMessageText(page, CANARY_FINAL)).toBeVisible({ timeout: 40_000 });
- const finalBubble = page.getByTestId('agent-message').filter({ hasText: CANARY_FINAL });
- await expect(finalBubble).toHaveCount(1);
- await expect(finalBubble).toContainText(CANARY_SECOND_PARAGRAPH);
- await expect(page.getByText(CANARY_SECOND_PARAGRAPH, { exact: true })).toHaveCount(1);
-
- // Regression: completed tool/reasoning arrays remain in Redux briefly, but
- // they must not create a synthetic running tail after the final answer.
- await expect(page.getByLabel('Assistant is working')).toHaveCount(0);
- await expect(page.getByText('running', { exact: true })).toHaveCount(0);
-
- // Tool activity belongs to assistant-ui and renders as a readable card,
- // never through the removed legacy Agentic task insights timeline.
- await expect(page.getByTestId('agent-task-insights')).toHaveCount(0);
- await expect(page.getByTestId('assistant-ui-tool-call')).toHaveCount(1);
- const toolCard = page.getByTestId('assistant-ui-tool-call');
- await expect(toolCard).toBeVisible();
- await expect(toolCard).toContainText('Fetching example.com');
- // Web-channel turns retain supervised access even if the stored config is
- // wider. The external fetch is therefore cancelled without an approval
- // surface, and must render its actual terminal state instead of a false
- // success or a forever-running card.
- await expect(toolCard).toContainText('cancelled');
- await expect(toolCard).not.toContainText('running');
- const toolTrigger = toolCard.getByRole('button').first();
- if ((await toolTrigger.getAttribute('aria-expanded')) !== 'true') await toolTrigger.click();
- await expect(toolCard.getByText('Input', { exact: true })).toBeVisible();
-
- await expect
- .poll(
- async () => {
- const names = await toolTimelineNames(page, threadId);
- if (names.some(name => name.includes('web_fetch'))) return true;
- return findToolInLlmLog(await requests(), 'web_fetch');
- },
- { timeout: 20_000 }
- )
- .toBe(true);
-
- await expect
- .poll(async () => {
- const log = await requests();
- return log.filter(
- entry => entry.method === 'POST' && entry.url.includes('/openai/v1/chat/completions')
- ).length;
- })
- .toBeGreaterThanOrEqual(2);
-
- expect(threadId.length).toBeGreaterThan(0);
- });
-});
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.ts
index ccb1e947ab..9cc7a136d5 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
@@ -147,9 +147,7 @@ test.describe('User-message action bar — capability-gated affordances (#5897)'
await expect(page.getByRole('button', { name: 'Copy message' })).toBeVisible();
});
- test.skip('no branch picker is offered while the runtime cannot switch branches', async ({
- page,
- }) => {
+ test('no branch picker is offered while the runtime cannot switch branches', async ({ page }) => {
const input = await openChat(page);
await sendOneTurn(page, input, 'branch check');
diff --git a/app/test/playwright/specs/connectivity-state-differentiation.spec.ts b/app/test/playwright/specs/connectivity-state-differentiation.spec.ts
index 6385037c55..bab2f04ae6 100644
--- a/app/test/playwright/specs/connectivity-state-differentiation.spec.ts
+++ b/app/test/playwright/specs/connectivity-state-differentiation.spec.ts
@@ -1,4 +1,4 @@
-import { test } from '@playwright/test';
+import { expect, test } from '@playwright/test';
import { bootAuthenticatedPage, waitForAppReady } from '../helpers/core-rpc';
@@ -8,19 +8,8 @@ test.describe('Connectivity state differentiation (issue #1527)', () => {
await bootAuthenticatedPage(page, 'pw-connectivity-diff-' + testSlug, '/home');
});
- test.skip('shows backend-reconnecting status when backend is unreachable but internet is up', async () => {});
-
- test.skip('shows reconnecting status after socket is force-disconnected server-side', async () => {});
-
- test.skip('shows device-offline copy (not backend-only) when window fires offline', async () => {});
-
- test.skip('status updates to healthy without reinstall after backend recovers from 503', async () => {});
-
- test.skip('shows core-offline indicator (not device-offline) when internet is up but core is unreachable', async () => {
- // Placeholder until a stop-core command exists in the web/test lane.
- });
-
test('baseline app shell is ready in the browser lane', async ({ page }) => {
await waitForAppReady(page);
+ await expect(page.locator('#root')).toBeVisible();
});
});
diff --git a/app/test/playwright/specs/connector-modal-focus-trap.spec.ts b/app/test/playwright/specs/connector-modal-focus-trap.spec.ts
index 119a12725a..1ba8bb65a7 100644
--- a/app/test/playwright/specs/connector-modal-focus-trap.spec.ts
+++ b/app/test/playwright/specs/connector-modal-focus-trap.spec.ts
@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';
-import { bootRuntimeReadyGuestPage, callCoreRpc, seedBrowserCoreMode } from '../helpers/core-rpc';
+import { bootAuthenticatedPage, callCoreRpc, seedBrowserCoreMode } from '../helpers/core-rpc';
/**
* Modal keyboard and focus behaviour, driven in a real browser.
@@ -56,7 +56,7 @@ async function openConnectDialog(
opts: { keyName?: string } = {}
) {
const keyName = opts.keyName ?? 'NOTION_API_KEY';
- await bootRuntimeReadyGuestPage(page);
+ await bootAuthenticatedPage(page, `pw-focus-trap-${keyName.toLowerCase()}`);
await declareVehicleServer(keyName);
await seedBrowserCoreMode(page);
await page.goto('/#/connections?tab=tools');
@@ -68,8 +68,7 @@ async function openConnectDialog(
has: page.locator(`td:first-child:has-text("${SERVER_NAME}")`),
});
await expect(row).toBeVisible({ timeout: 20_000 });
- await row.click();
- const connect = page.getByRole('button', { name: 'Connect', exact: true });
+ const connect = page.getByRole('button', { name: `Connect ${SERVER_NAME}` });
await expect(connect).toBeVisible({ timeout: 10_000 });
// A focusable element outside the dialog, so focus restore has somewhere
@@ -89,12 +88,7 @@ async function openConnectDialog(
// focused before the dialog took over: `Enter` on the anchor does nothing,
// so drive the click through the DOM instead of a pointer, which would move
// focus first.
- await page.evaluate(() => {
- const button = Array.from(document.querySelectorAll('button')).find(
- candidate => candidate.textContent?.trim() === 'Connect'
- );
- button?.click();
- });
+ await connect.evaluate(button => (button as HTMLButtonElement).click());
const dialog = page.locator(DIALOG);
await expect(dialog).toBeVisible({ timeout: 10_000 });
@@ -149,7 +143,7 @@ test.afterEach(async () => {
// `page.route('**/rpc', ...)` and fulfils the RPCs itself, with zero
// `callCoreRpc`. This suite is therefore the only spec exercising this surface
// against a live core.
-test.describe.skip('Connector modal — focus containment', () => {
+test.describe('Connector modal — focus containment', () => {
// Precondition assertion, not mutation-proven: this survived BOTH the
// trap-deletion mutation and removing the input's `autoFocus`, because Radix
// moves focus in on open independently of either. Kept because a dialog that
@@ -188,7 +182,7 @@ test.describe.skip('Connector modal — focus containment', () => {
});
});
-test.describe.skip('Connector modal — Escape', () => {
+test.describe('Connector modal — Escape', () => {
test('Escape closes the dialog', async ({ page }) => {
const dialog = await openConnectDialog(page);
await page.keyboard.press('Escape');
@@ -235,7 +229,7 @@ test.describe.skip('Connector modal — Escape', () => {
});
});
-test.describe.skip('Connector modal — accessible shape', () => {
+test.describe('Connector modal — accessible shape', () => {
test('is a labelled modal dialog, not a bare overlay', async ({ page }) => {
const dialog = await openConnectDialog(page);
// A screen reader needs both of these to announce it as a dialog and read
diff --git a/app/test/playwright/specs/core-port-conflict-recovery.spec.ts b/app/test/playwright/specs/core-port-conflict-recovery.spec.ts
index 87bd7dfb61..feccb63334 100644
--- a/app/test/playwright/specs/core-port-conflict-recovery.spec.ts
+++ b/app/test/playwright/specs/core-port-conflict-recovery.spec.ts
@@ -14,6 +14,4 @@ test.describe('Core port conflict recovery', () => {
page.locator('[data-testid="chat-message-input"], [data-testid="onboarding-welcome-step"]')
).toBeVisible();
});
-
- test.skip('second instance surfaces clear conflict dialog once a visible banner exists', async () => {});
});
diff --git a/app/test/playwright/specs/crypto-payment-flow.spec.ts b/app/test/playwright/specs/crypto-payment-flow.spec.ts
deleted file mode 100644
index 54f6d095e2..0000000000
--- a/app/test/playwright/specs/crypto-payment-flow.spec.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { expect, test } from '@playwright/test';
-
-import { bootAuthenticatedPage, waitForAppReady } from '../helpers/core-rpc';
-
-test.describe('Crypto Payment Flow', () => {
- test.skip(
- true,
- 'billing is now an account-settings affordance; crypto payment redirect surface was retired'
- );
- test.beforeEach(async ({ page }, testInfo) => {
- const slug = testInfo.title.toLowerCase().replace(/[^a-z0-9]+/g, '-');
- await bootAuthenticatedPage(page, `pw-crypto-payment-${slug}`);
- await page.goto('/#/settings/account');
- });
-
- test('billing panel shows the moved-to-web redirect page', async ({ page }) => {
- await waitForAppReady(page);
- await expect(page.getByText(/Billing moved to the web/i)).toBeVisible();
- });
-
- test('open billing dashboard button is present', async ({ page }) => {
- await waitForAppReady(page);
- await expect(page.getByRole('button', { name: 'Open billing dashboard' })).toBeVisible();
- });
-
- test('shows the moved-to-web explanation on mount', async ({ page }) => {
- await waitForAppReady(page);
- // Billing no longer auto-opens the browser on mount; the panel explains that
- // billing moved to the web instead of showing an "opening browser" status.
- await expect(
- page.getByText(/Subscription changes, payment methods, credits, and invoices are now managed/)
- ).toBeVisible();
- });
-});
diff --git a/app/test/playwright/specs/guided-tour-gates.spec.ts b/app/test/playwright/specs/guided-tour-gates.spec.ts
index 7c9b0a99e1..f430427145 100644
--- a/app/test/playwright/specs/guided-tour-gates.spec.ts
+++ b/app/test/playwright/specs/guided-tour-gates.spec.ts
@@ -18,12 +18,6 @@ async function tooltip(page: Page): Promise<Locator> {
return page.locator('[role="alertdialog"]');
}
-async function clickTourNext(page: Page): Promise<void> {
- const panel = await tooltip(page);
- await expect(panel).toBeVisible();
- await panel.getByRole('button', { name: /Next|Let's go!/ }).click();
-}
-
test.describe('Guided tour gates', () => {
test.beforeEach(async ({ page }) => {
// Tour coverage does not exercise the auth callback. Seed the authenticated
@@ -34,34 +28,6 @@ test.describe('Guided tour gates', () => {
await waitForAppReady(page);
});
- test.skip('tour starts from home and can navigate forward to the connections step', async ({
- page,
- }) => {
- // Joyride retains its internal step index after the automatically completed
- // onboarding tour. Restarting the walkthrough on the mounted instance does
- // not reliably reset it to step zero; the desktop E2E suite documents the
- // same product gap. Re-enable when AppWalkthrough owns an explicit stepIndex.
- await armWalkthrough(page);
-
- const panel = await tooltip(page);
- await expect(panel).toBeVisible();
- await expect(page.locator('[data-walkthrough="home-card"]')).toBeVisible();
-
- await clickTourNext(page);
- await expect(page.locator('[data-walkthrough="home-cta"]')).toBeVisible();
-
- await clickTourNext(page);
- await expect.poll(async () => page.evaluate(() => window.location.hash)).toContain('/chat');
- await expect(page.locator('[data-walkthrough="chat-agent-panel"]')).toBeVisible();
-
- // Phase 2: step 4 navigates to /connections (was /skills)
- await clickTourNext(page);
- await expect
- .poll(async () => page.evaluate(() => window.location.hash))
- .toContain('/connections');
- await expect(page.locator('[data-walkthrough="skills-grid"]')).toBeVisible();
- });
-
test('skip hides the tour and marks walkthrough complete', async ({ page }) => {
await armWalkthrough(page);
@@ -79,19 +45,4 @@ test.describe('Guided tour gates', () => {
)
.toEqual({ completed: 'true', pending: null });
});
-
- test.skip('pending walkthrough resumes after reload', async ({ page }) => {
- await page.evaluate(() => {
- localStorage.removeItem('openhuman:walkthrough_completed');
- localStorage.setItem('openhuman:walkthrough_pending', 'true');
- });
-
- await page.reload();
- await waitForAppReady(page);
-
- const panel = await tooltip(page);
- await expect(panel).toBeVisible();
- await expect(panel.getByText('1 of 10')).toBeVisible();
- await expect(page.locator('[data-walkthrough="home-card"]')).toBeVisible();
- });
});
diff --git a/app/test/playwright/specs/harness-channel-bridge-flow.spec.ts b/app/test/playwright/specs/harness-channel-bridge-flow.spec.ts
deleted file mode 100644
index 4b57decd4a..0000000000
--- a/app/test/playwright/specs/harness-channel-bridge-flow.spec.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-import { expect, type Page, test } from '@playwright/test';
-
-import { agentMessageText } from '../helpers/chat-locators';
-import {
- bootAuthenticatedPage,
- dismissWalkthroughIfPresent,
- waitForAppReady,
-} from '../helpers/core-rpc';
-
-const MOCK_ADMIN_BASE = `http://127.0.0.1:${process.env.E2E_MOCK_PORT || '18473'}`;
-const USER_ID = 'pw-harness-channel-bridge';
-const CANARY = 'canary-cb1-cron-standup';
-
-async function resetMock(): Promise<void> {
- await fetch(`${MOCK_ADMIN_BASE}/__admin/reset`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({}),
- });
-}
-
-async function setMockBehavior(key: string, value: string): Promise<void> {
- await fetch(`${MOCK_ADMIN_BASE}/__admin/behavior`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ key, value }),
- });
-}
-
-async function openChat(page: Page): Promise<void> {
- await bootAuthenticatedPage(page, USER_ID, '/chat');
- await page.goto('/#/chat');
- await waitForAppReady(page);
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByTestId('chat-message-input')).toBeVisible();
-}
-
-async function selectedThreadId(page: Page): Promise<string | null> {
- return page.evaluate(() => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => { thread?: { selectedThreadId?: string | null } };
- };
- }
- ).__OPENHUMAN_STORE__;
- return store?.getState?.().thread?.selectedThreadId ?? null;
- });
-}
-
-async function createNewThread(page: Page): Promise<string> {
- const before = await selectedThreadId(page);
- await dismissWalkthroughIfPresent(page);
- const sidebarButton = page.getByTestId('new-thread-sidebar-button');
- if (await sidebarButton.isVisible().catch(() => false)) {
- await sidebarButton.click({ force: true });
- } else {
- await page.getByTestId('new-thread-button').click({ force: true });
- }
- const changed = await expect
- .poll(
- async () => {
- const current = await selectedThreadId(page);
- return current && current !== before ? current : null;
- },
- { timeout: 10_000 }
- )
- .not.toBeNull()
- .then(
- () => true,
- () => false
- );
- const id = await selectedThreadId(page);
- if (changed && id) return id;
- if (id) return id;
- if (before) return before;
- throw new Error('selectedThreadId was not populated');
-}
-
-async function waitForSocketConnected(page: Page): Promise<void> {
- await expect
- .poll(
- async () =>
- page.evaluate(() => {
- const store = (
- window as unknown as {
- __OPENHUMAN_STORE__?: {
- getState?: () => { socket?: { byUser?: Record<string, { status?: string }> } };
- };
- }
- ).__OPENHUMAN_STORE__;
- const byUser = store?.getState?.().socket?.byUser ?? {};
- return Object.values(byUser).some(entry => entry?.status === 'connected');
- }),
- { timeout: 30_000 }
- )
- .toBe(true);
-}
-
-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();
-}
-
-test.describe('Harness - Cross-channel bridge flow', () => {
- test.skip(true, 'channel bridge prompt scripting is not deterministic in the browser harness');
- test('web chat fallback path completes a channel-style two-turn sequence', async ({ page }) => {
- await resetMock();
- await setMockBehavior(
- 'llmForcedResponses',
- JSON.stringify([
- {
- content: '',
- toolCalls: [
- {
- // Scheduling is the orchestrator's `scheduling` skill pack now
- // (the scheduler_agent / schedule_task delegate is retired).
- id: 'call_cron_add_cb1',
- name: 'use_skill',
- arguments: JSON.stringify({
- skill: 'scheduling',
- tool: 'cron',
- args: {
- action: 'add',
- name: 'daily_standup_reminder',
- schedule: { kind: 'cron', expr: '0 9 * * *' },
- prompt: 'standup reminder',
- enabled: true,
- },
- }),
- },
- ],
- },
- { content: `I created a daily 9am standup reminder for you. ${CANARY}` },
- ])
- );
- await setMockBehavior('llmStreamChunkDelayMs', '10');
-
- await openChat(page);
- await createNewThread(page);
- await sendMessage(page, 'set up a daily standup reminder at 9am');
-
- await expect(agentMessageText(page, CANARY)).toBeVisible({ timeout: 60_000 });
- await expect(
- agentMessageText(page, /I created a daily 9am standup reminder for you\./i)
- ).toBeVisible();
- });
-
- test.skip('telegram inbound/outbound bridge scenarios require a live listener restart in this lane', async () => {});
-});
diff --git a/app/test/playwright/specs/harness-cron-prompt-flow.spec.ts b/app/test/playwright/specs/harness-cron-prompt-flow.spec.ts
index 76ef644634..943b4eacba 100644
--- a/app/test/playwright/specs/harness-cron-prompt-flow.spec.ts
+++ b/app/test/playwright/specs/harness-cron-prompt-flow.spec.ts
@@ -109,60 +109,12 @@ async function sendMessage(page: Page, prompt: string): Promise<void> {
}
test.describe('Harness - Cron prompt-flow', () => {
- test.skip(
- true,
- 'cron prompt flows (orchestrator -> use_skill scheduling/cron) are not deterministic here'
- );
test.beforeEach(async ({ page }) => {
await resetMock();
await openChat(page);
await createNewThread(page);
});
- test('natural-language create flow yields a final reply and may persist a job', async ({
- page,
- }) => {
- const CANARY = 'canary-cron-create-a1b2';
- await setMockBehavior(
- 'llmForcedResponses',
- JSON.stringify([
- {
- content: '',
- toolCalls: [
- {
- id: 'call_cron_add_1',
- name: 'use_skill',
- arguments: JSON.stringify({
- skill: 'scheduling',
- tool: 'cron',
- args: {
- action: 'add',
- name: 'morning_reminder',
- schedule: { kind: 'cron', expr: '0 9 * * *' },
- prompt: 'morning reminder',
- enabled: true,
- },
- }),
- },
- ],
- },
- { content: `Done! I have set up a daily 9am morning reminder for you. ${CANARY}` },
- ])
- );
- await setMockBehavior('llmStreamChunkDelayMs', '10');
-
- await sendMessage(page, 'remind me every morning at 9am');
- await expect(agentMessageText(page, CANARY)).toBeVisible({ timeout: 60_000 });
- await expect(
- agentMessageText(page, /Done! I have set up a daily 9am morning reminder/i)
- ).toBeVisible();
- const log = await requests();
- const llmHits = log.filter(
- request => request.method === 'POST' && request.url.includes('/chat/completions')
- );
- expect(llmHits.length).toBeGreaterThanOrEqual(2);
- });
-
test('listing scheduled tasks returns the forced response', async ({ page }) => {
const CANARY = 'canary-cron-list-c3d4';
await setMockBehavior(
@@ -179,66 +131,4 @@ test.describe('Harness - Cron prompt-flow', () => {
await expect(agentMessageText(page, CANARY)).toBeVisible({ timeout: 60_000 });
await expect(page.getByText(/You have 2 scheduled tasks/i)).toBeVisible();
});
-
- test('schedule update flow yields a final reply', async ({ page }) => {
- const CANARY = 'canary-cron-update-e5f6';
- await setMockBehavior(
- 'llmForcedResponses',
- JSON.stringify([
- {
- content: '',
- toolCalls: [
- {
- id: 'call_cron_update_1',
- name: 'use_skill',
- arguments: JSON.stringify({
- skill: 'scheduling',
- tool: 'cron',
- args: {
- action: 'update',
- job_id: 'morning_reminder_update_test',
- patch: { schedule: { kind: 'cron', expr: '0 8 * * *' } },
- },
- }),
- },
- ],
- },
- { content: `Done! I have changed your morning reminder to 8am. ${CANARY}` },
- ])
- );
- await setMockBehavior('llmStreamChunkDelayMs', '10');
-
- await sendMessage(page, 'change my morning reminder to 8am');
- await expect(agentMessageText(page, CANARY)).toBeVisible({ timeout: 60_000 });
- await expect(agentMessageText(page, /changed your morning reminder to 8am/i)).toBeVisible();
- });
-
- test('delete flow yields a final reply', async ({ page }) => {
- const CANARY = 'canary-cron-delete-g7h8';
- await setMockBehavior(
- 'llmForcedResponses',
- JSON.stringify([
- {
- content: '',
- toolCalls: [
- {
- id: 'call_cron_remove_1',
- name: 'use_skill',
- arguments: JSON.stringify({
- skill: 'scheduling',
- tool: 'cron',
- args: { action: 'remove', job_id: 'morning_reminder_delete_test' },
- }),
- },
- ],
- },
- { content: `Done! I have deleted the morning reminder. ${CANARY}` },
- ])
- );
- await setMockBehavior('llmStreamChunkDelayMs', '10');
-
- await sendMessage(page, 'delete the morning reminder');
- await expect(agentMessageText(page, CANARY)).toBeVisible({ timeout: 60_000 });
- await expect(agentMessageText(page, /deleted the morning reminder/i)).toBeVisible();
- });
});
diff --git a/app/test/playwright/specs/harness-search-tool-flow.spec.ts b/app/test/playwright/specs/harness-search-tool-flow.spec.ts
index 34dcb7ad3a..60fcadfdd4 100644
--- a/app/test/playwright/specs/harness-search-tool-flow.spec.ts
+++ b/app/test/playwright/specs/harness-search-tool-flow.spec.ts
@@ -142,10 +142,6 @@ async function toolTimelineIncludes(
}
test.describe('Harness - Search tool-flow', () => {
- test.skip(
- true,
- 'file_read prompt flow is sandbox-fixture dependent; filesystem coverage is authoritative'
- );
test.beforeEach(async ({ page }) => {
await resetMock();
await openChat(page);
diff --git a/app/test/playwright/specs/notifications-feed-interaction.spec.ts b/app/test/playwright/specs/notifications-feed-interaction.spec.ts
index 1049a9dc80..a564c0fa0c 100644
--- a/app/test/playwright/specs/notifications-feed-interaction.spec.ts
+++ b/app/test/playwright/specs/notifications-feed-interaction.spec.ts
@@ -1,11 +1,6 @@
/**
- * ⚠️ STILL SKIPPED — the seeding was restructured but has NOT been executed.
- *
- * Local test execution is currently forbidden by a standing fleet rule, so the
- * fix below is reasoned from source and verified by reading only. It is left
- * skipped rather than un-skipped-and-hoped: shipping an unrun spec as active is
- * how a red lane gets blamed on the wrong change. Un-skip on the first run that
- * can actually execute it.
+ * The feed is seeded through redux-persist before the app mounts so these tests
+ * exercise the same state path as a returning user's browser.
*
* What is established, from three earlier runs against a live lane:
* - The persist blob format here is CORRECT. redux-persist stores each
@@ -47,13 +42,9 @@ import {
* from the Rust core and live in a redux-persist slice, so no core RPC can put
* one on screen.
*
- * Seeding therefore goes through the app's own persistence, not a mock: the
- * slice is persisted under `${activeUserId}:persist:notifications`
- * (`store/index.ts:144-149`, `store/userScopedStorage.ts:177-180`), and
- * `OPENHUMAN_ACTIVE_USER_ID` selects the namespace. Writing those two keys
- * before navigation is exactly what a returning user's browser already holds —
- * the real reducer rehydrates them, the real page renders them, and every
- * assertion below is on what the user can see and click.
+ * Seed through the same Redux action dispatched by the socket bridge. This
+ * exercises the real reducer and UI without coupling the fixture to persistence
+ * internals; the reload test separately covers persistence.
*
* What this pins is the part that is invisible to a component test: that the
* chips are a single-select tablist over the categories actually present, that
@@ -76,106 +67,28 @@ function item(id: string, category: string, title: string, read = false): SeedIt
return { id, category, title, body: `${title} body`, timestamp: Date.now(), read };
}
-/**
- * Learn the namespace the app actually persists under.
- *
- * `activeUserId` is the signed-in identity the app resolves, NOT the bypass id
- * handed to `bootAuthenticatedPage` — in this lane the mock backend answers
- * `user-123`. Seeding under the bypass id writes a key nothing ever reads and
- * every assertion then times out against an empty feed, which is exactly what
- * the first run of this spec did.
- *
- * Polled rather than read once: the app writes the key during boot, so a single
- * `page.evaluate` immediately after navigation can race that write and return
- * `null` — or, worse, a stale value that sends the seed to a key nobody reads.
- */
-async function resolveActiveUserId(page: Page): Promise<string> {
- await expect
- .poll(async () => page.evaluate(() => localStorage.getItem('OPENHUMAN_ACTIVE_USER_ID')), {
- timeout: 20_000,
- message: 'the app never wrote OPENHUMAN_ACTIVE_USER_ID',
- })
- .not.toBeNull();
-
- const user = await page.evaluate(() => localStorage.getItem('OPENHUMAN_ACTIVE_USER_ID'));
- if (!user) throw new Error('no active user id after polling');
- return user;
-}
-
-/**
- * Open the feed with `items` already persisted BEFORE the app mounts.
- *
- * This is deliberately a two-navigation sequence, and the reason is the whole
- * design of this file:
- *
- * 1. Boot once, only to learn the namespace (see `resolveActiveUserId`). The
- * feed is empty on this pass and nothing is asserted against it.
- * 2. Register the seed as an `addInitScript`, which runs on every subsequent
- * document BEFORE any application code, then navigate again. The second
- * document therefore mounts with the blob already in `localStorage`.
- *
- * Writing the blob after the app has mounted does not work: redux-persist
- * rehydrates once per page context, so a post-boot write is simply never read.
- * `addInitScript` is what makes the seed visible to rehydration — a plain
- * `page.evaluate` + `goto` is not equivalent, because the app has already
- * mounted and read its initial state by then.
- *
- * The blob shape is redux-persist's: each whitelisted field is its own JSON
- * string inside the outer object (`store/index.ts:144-149`).
- */
async function openFeedWith(page: Page, items: SeedItem[]): Promise<void> {
- await bootAuthenticatedPage(page, USER, '/notifications');
- await waitForAppReady(page);
- const user = await resolveActiveUserId(page);
-
- // One-shot. `addInitScript` runs before EVERY new document, `page.reload()`
- // included, so without the marker the reload in "read state survives a reload"
- // would re-apply the original payload — restoring `read: false` over the state
- // that test just marked read, and destroying the very thing it asserts. The
- // marker lives in localStorage, so it survives the reload alongside the
- // persisted blob and the seed applies to the first seeded navigation only.
- await page.addInitScript(
- ({ key, marker, payload }) => {
- if (window.localStorage.getItem(marker)) return;
- window.localStorage.setItem(marker, '1');
- const raw = window.localStorage.getItem(key);
- // Merge onto whatever the first boot wrote. When the key does not exist
- // yet, a blob carrying only `items` is not what redux-persist writes —
- // the real one also has `preferences` and `_persist`, and a missing
- // `_persist` is what tells it the blob is not rehydratable. Supply both
- // defaults so a fresh namespace behaves like a returning user's.
- const blob: Record<string, string> = raw
- ? (JSON.parse(raw) as Record<string, string>)
- : {
- preferences: JSON.stringify({
- messages: true,
- agents: true,
- skills: true,
- system: true,
- meetings: true,
- reminders: true,
- important: true,
- }),
- _persist: JSON.stringify({ version: -1, rehydrated: true }),
- };
- blob.items = JSON.stringify(payload);
- window.localStorage.setItem(key, JSON.stringify(blob));
- },
- { key: `${user}:persist:notifications`, marker: 'pw:notif-seed-applied', payload: items }
- );
-
- // A fresh document: the init script above runs first, so the store rehydrates
- // with the seed instead of the empty blob the previous boot left behind.
- await page.goto('/#/notifications');
+ await bootAuthenticatedPage(page, USER, '/notifications?view=main');
await waitForAppReady(page);
await dismissWalkthroughIfPresent(page);
+ const welcomeCta = page.getByTestId('notifications-welcome-cta-view');
+ if (await welcomeCta.isVisible().catch(() => false)) await welcomeCta.click();
+ await page.evaluate(payload => {
+ const store = (
+ window as typeof window & { __OPENHUMAN_STORE__?: { dispatch(action: unknown): void } }
+ ).__OPENHUMAN_STORE__;
+ if (!store) throw new Error('application store is not available');
+ for (const notification of payload) {
+ store.dispatch({ type: 'notifications/notificationReceived', payload: notification });
+ }
+ }, items);
await expect(page.getByTestId('system-events-section')).toBeVisible({ timeout: 20_000 });
}
const feed = (page: Page) => page.getByTestId('system-events-section');
const rows = (page: Page) => feed(page).getByTestId('notification-item');
-test.describe.skip('Notifications — the system-events feed renders what was stored', () => {
+test.describe('Notifications — the system-events feed renders what was stored', () => {
test('shows every seeded item', async ({ page }) => {
await openFeedWith(page, [
item('n-agents-1', 'agents', 'Agent finished a task'),
@@ -198,7 +111,7 @@ test.describe.skip('Notifications — the system-events feed renders what was st
});
});
-test.describe.skip('Notifications — filtering is single-select and actually filters', () => {
+test.describe('Notifications — filtering is single-select and actually filters', () => {
test('narrows the feed to one category and back', async ({ page }) => {
await openFeedWith(page, [
item('n-agents-1', 'agents', 'Agent finished a task'),
@@ -235,10 +148,10 @@ test.describe.skip('Notifications — filtering is single-select and actually fi
});
});
-test.describe.skip('Notifications — read state', () => {
+test.describe('Notifications — read state', () => {
test('clicking an unread item marks it read and drops the unread count', async ({ page }) => {
await openFeedWith(page, [
- item('n-agents-1', 'agents', 'Agent finished a task'),
+ item('n-meeting-1', 'meetings', 'Meeting starts soon'),
item('n-system-1', 'system', 'Core restarted'),
]);
await expect(rows(page)).toHaveCount(2, { timeout: 20_000 });
@@ -247,7 +160,7 @@ test.describe.skip('Notifications — read state', () => {
// the click did anything.
await expect(page.getByText(/2 unread/i)).toBeVisible();
- await rows(page).first().click();
+ await rows(page).filter({ hasText: 'Meeting starts soon' }).locator('[role="button"]').click();
await expect(page.getByText(/1 unread/i)).toBeVisible({ timeout: 10_000 });
});
@@ -258,7 +171,7 @@ test.describe.skip('Notifications — read state', () => {
item('n-system-1', 'system', 'Core restarted'),
]);
- const markAll = page.getByRole('button', { name: /mark all read/i });
+ const markAll = page.getByRole('button', { name: /mark all as read/i });
await expect(markAll).toBeEnabled({ timeout: 20_000 });
await markAll.click();
@@ -268,19 +181,19 @@ test.describe.skip('Notifications — read state', () => {
});
test('Mark all read is already disabled when nothing is unread', async ({ page }) => {
- await openFeedWith(page, [item('n-agents-1', 'agents', 'Agent finished a task', true)]);
+ await openFeedWith(page, [item('n-meeting-1', 'meetings', 'Meeting starts soon', true)]);
await expect(rows(page)).toHaveCount(1, { timeout: 20_000 });
- await expect(page.getByRole('button', { name: /mark all read/i })).toBeDisabled();
+ await expect(page.getByRole('button', { name: /mark all as read/i })).toBeDisabled();
});
test('read state survives a reload', async ({ page }) => {
// The slice is persisted, so marking read must outlive the page. If it does
// not, the feed re-accuses the user of everything they just dismissed.
- await openFeedWith(page, [item('n-agents-1', 'agents', 'Agent finished a task')]);
+ await openFeedWith(page, [item('n-meeting-1', 'meetings', 'Meeting starts soon')]);
- await page.getByRole('button', { name: /mark all read/i }).click();
- await expect(page.getByRole('button', { name: /mark all read/i })).toBeDisabled({
+ await page.getByRole('button', { name: /mark all as read/i }).click();
+ await expect(page.getByRole('button', { name: /mark all as read/i })).toBeDisabled({
timeout: 10_000,
});
@@ -312,8 +225,10 @@ test.describe.skip('Notifications — read state', () => {
await page.reload();
await waitForAppReady(page);
await dismissWalkthroughIfPresent(page);
+ await page.goto('/#/notifications?view=main');
+ await waitForAppReady(page);
- await expect(page.getByRole('button', { name: /mark all read/i })).toBeDisabled({
+ await expect(page.getByRole('button', { name: /mark all as read/i })).toBeDisabled({
timeout: 20_000,
});
});
diff --git a/app/test/playwright/specs/notifications.spec.ts b/app/test/playwright/specs/notifications.spec.ts
index 5c5328880f..a13a781242 100644
--- a/app/test/playwright/specs/notifications.spec.ts
+++ b/app/test/playwright/specs/notifications.spec.ts
@@ -110,11 +110,4 @@ test.describe('Notifications', () => {
await expect(page.getByRole('heading', { name: 'Alerts', exact: true })).toBeVisible();
await expect(page.getByText('No alerts yet').first()).toBeVisible();
});
-
- test('native notification permission command returns a valid state', async () => {
- test.skip(
- true,
- 'web Playwright lane does not expose the Tauri invoke bridge used by the WDIO shell test'
- );
- });
});
diff --git a/app/test/playwright/specs/service-connectivity-flow.spec.ts b/app/test/playwright/specs/service-connectivity-flow.spec.ts
index 9cb0281941..32f7e5d785 100644
--- a/app/test/playwright/specs/service-connectivity-flow.spec.ts
+++ b/app/test/playwright/specs/service-connectivity-flow.spec.ts
@@ -1,5 +1,4 @@
import { test } from '@playwright/test';
-test.describe('Service connectivity flow (UI ↔ Rust service)', () => {
- test.skip('service gate flow is native/service-mock dependent and not available in the browser lane', async () => {});
-});
+// Service availability prompts depend on the native Tauri service mock and are
+// covered by the desktop runner, not the browser-hosted Playwright lane.
diff --git a/app/test/playwright/specs/settings-account-preferences.spec.ts b/app/test/playwright/specs/settings-account-preferences.spec.ts
index a86903ab3c..6c5456e24a 100644
--- a/app/test/playwright/specs/settings-account-preferences.spec.ts
+++ b/app/test/playwright/specs/settings-account-preferences.spec.ts
@@ -25,29 +25,6 @@ async function gotoSettingsRoute(page: Page, hash: string): Promise<void> {
await dismissWalkthroughIfPresent(page);
}
-async function ensureRecoveryPhraseGenerateMode(page: Page): Promise<void> {
- const copyButton = page.getByRole('button', { name: 'Copy to Clipboard' });
- const replaceButton = page.getByRole('button', { name: 'Replace wallet' });
-
- await expect
- .poll(
- async () => {
- if (await copyButton.isVisible()) return 'generate';
- if (await replaceButton.isVisible()) return 'configured';
- return 'loading';
- },
- { timeout: 15_000 }
- )
- .not.toBe('loading');
-
- if (await replaceButton.isVisible()) {
- await replaceButton.click();
- await page.getByRole('button', { name: 'I understand, replace my wallet' }).click();
- }
-
- await expect(copyButton).toBeVisible();
-}
-
test.describe('Settings - Account Preferences', () => {
test.beforeEach(async ({ page }) => {
await bootAuthenticatedPage(page, 'pw-settings-account-user');
@@ -75,38 +52,6 @@ test.describe('Settings - Account Preferences', () => {
await expect(page.getByTestId('wallet-panel')).toBeVisible();
});
- test.skip('saves a generated recovery phrase and exposes configured wallet state', async ({
- page,
- }) => {
- await gotoSettingsRoute(page, '/settings/recovery-phrase');
-
- await ensureRecoveryPhraseGenerateMode(page);
- await page.locator('#mnemonic-confirm-checkbox').check();
- await page.getByRole('button', { name: 'Save Recovery Phrase' }).click();
-
- await expect(page.getByText('Recovery phrase saved')).toBeVisible();
- await expect(page.getByText(/Multi-chain wallet identities are ready/)).toBeVisible();
-
- await expect
- .poll(async () => {
- const wallet = await callCoreRpc<{
- result?: { configured?: boolean; accounts?: unknown[] };
- }>('openhuman.wallet_status', {});
- return {
- configured: Boolean(wallet.result?.configured),
- accountCount: wallet.result?.accounts?.length ?? 0,
- };
- })
- .toEqual({ configured: true, accountCount: expect.any(Number) });
-
- const wallet = await callCoreRpc<{ result?: { configured?: boolean; accounts?: unknown[] } }>(
- 'openhuman.wallet_status',
- {}
- );
- expect(wallet.result?.configured).toBe(true);
- expect((wallet.result?.accounts ?? []).length).toBeGreaterThan(0);
- });
-
test('persists the privacy analytics toggle to core config', async ({ page }) => {
const beforeAnalytics = await callCoreRpc<{ result?: { enabled?: boolean } }>(
'openhuman.config_get_analytics_settings',
@@ -168,22 +113,4 @@ test.describe('Settings - Account Preferences', () => {
await callCoreRpc('openhuman.config_update_user_timezone', { timezone: original ?? null });
}
});
-
- test('opens the billing route and settles the redirect status copy', async ({ page }) => {
- test.skip(
- true,
- 'billing is exposed as an account-settings button; the retired nested route is covered by card-payment-flow'
- );
- await gotoSettingsRoute(page, '/settings/account');
-
- await expect(page.getByRole('heading', { name: 'Billing', exact: true })).toBeVisible();
- // Billing no longer auto-opens the browser; the panel explains billing
- // moved to the web and offers an explicit open button.
- await expect(
- page.getByText(/Subscription changes, payment methods, credits, and invoices are now managed/)
- ).toBeVisible();
-
- await page.getByRole('button', { name: 'Back to settings' }).click();
- await expect.poll(async () => page.evaluate(() => window.location.hash)).toContain('/settings');
- });
});
diff --git a/app/test/playwright/specs/settings-ai-skills.spec.ts b/app/test/playwright/specs/settings-ai-skills.spec.ts
index 7882559396..f49adabc84 100644
--- a/app/test/playwright/specs/settings-ai-skills.spec.ts
+++ b/app/test/playwright/specs/settings-ai-skills.spec.ts
@@ -1,69 +1,11 @@
-import { expect, type Page, test } from '@playwright/test';
+import { expect, test } from '@playwright/test';
import {
bootAuthenticatedPage,
- callCoreRpc,
dismissWalkthroughIfPresent,
waitForAppReady,
} from '../helpers/core-rpc';
-/**
- * A managed catalog id from the shared mock fixture
- * (`scripts/mock-api/routes/llm.mjs`), so the value under test is one the
- * routing page would really be asked to display rather than a synthetic string.
- */
-const PINNED_MODEL = 'openrouter/nex-agi/nex-n2.5-mini';
-
-/**
- * Read `default_model` back from the core, not from the page's own state.
- *
- * `inference_get_client_config` answers in the `CommandResponse` envelope
- * (`{ result: ClientConfig }`), which is how `aiSettingsApi.loadAISettings`
- * unwraps it; older snapshots answered bare, so accept both rather than fail on
- * an envelope change that is not what this test is about.
- */
-async function pinnedDefaultModel(): Promise<string> {
- const response = await callCoreRpc<{
- result?: { default_model?: string };
- default_model?: string;
- }>('openhuman.inference_get_client_config', {});
- const config = response.result ?? response;
- return (config.default_model ?? '').trim();
-}
-
-/**
- * Make `isTauri()` true for this page.
- *
- * Without this the routing page never loads its config at all:
- * `openhumanGetClientConfig` (`app/src/utils/tauriCommands/config.ts:266-269`)
- * throws "Not running in Tauri" before issuing any RPC, so `default_model`
- * stays empty and the assertions below would fail for a reason that has nothing
- * to do with model configuration. The stubbed `invoke` is never reached —
- * `callCoreRpc` dispatches `openhuman.*` over HTTP in this lane, not through
- * the Tauri IPC bridge. Same shim as `chat-model-managed-catalog.spec.ts` and
- * `settings-advanced-config.spec.ts`.
- */
-async function emulateTauriRuntime(page: Page): Promise<void> {
- await page.addInitScript(() => {
- const win = window as typeof window & {
- isTauri?: boolean;
- __TAURI_INTERNALS__?: { invoke?: (cmd: string, args?: unknown) => Promise<unknown> };
- };
- win.isTauri = true;
- win.__TAURI_INTERNALS__ = win.__TAURI_INTERNALS__ ?? {};
- win.__TAURI_INTERNALS__.invoke = win.__TAURI_INTERNALS__.invoke ?? (async () => null);
- });
-}
-
-/** Open Connections and select the Routing tab, where the default-model row lives. */
-async function openRoutingTab(page: Page): Promise<void> {
- await page.goto('/#/settings/llm');
- await waitForAppReady(page);
- await dismissWalkthroughIfPresent(page);
- await page.getByTestId('ai-tab-routing').click();
- await expect(page.getByTestId('default-model-row')).toBeVisible({ timeout: 15_000 });
-}
-
test.describe('Settings - AI & Skills', () => {
test.beforeEach(async ({ page }) => {
await bootAuthenticatedPage(page, 'pw-settings-ai-user');
@@ -92,42 +34,4 @@ test.describe('Settings - AI & Skills', () => {
await expect(page.getByText('Tools').first()).toBeVisible();
await expect(page.getByText(/Filesystem|Shell/).first()).toBeVisible();
});
-
- /**
- * Matrix 13.3.1 — the settings route's model configuration survives a reload.
- *
- * Both e2e layers previously asserted only that the LLM tab mounts. Nothing
- * configured anything, so a regression in the settings page's read of
- * `default_model` would ship green.
- *
- * This deliberately drives the value in over the core RPC rather than through
- * the picker dialog. The picker's internals are being rebuilt under #6395 —
- * `chat-model-managed-catalog.spec.ts` is `test.describe.skip`ped for exactly
- * that reason — so a spec that clicked through it would be rewritten with the
- * picker and would meanwhile cover nothing. The durable claim, and the one no
- * spec makes today, is the contract either implementation must honour: what
- * the core holds is what the routing page shows, before and after a reload.
- *
- * The complementary direction (picker click -> core write) stays covered at
- * VU level by `AIPanel.test.tsx` ("pins a managed default model from the
- * routing page") until #6395 lands.
- */
- test.skip('the routing page shows the core-pinned default model and keeps it across a reload', async ({
- page,
- }) => {
- await emulateTauriRuntime(page);
- await callCoreRpc('openhuman.inference_update_model_settings', { default_model: PINNED_MODEL });
- expect(await pinnedDefaultModel()).toBe(PINNED_MODEL);
-
- await openRoutingTab(page);
- await expect(page.getByTestId('default-model-change')).toContainText(PINNED_MODEL);
-
- await page.reload();
- await waitForAppReady(page);
- await page.getByTestId('ai-tab-routing').click();
- await expect(page.getByTestId('default-model-change')).toContainText(PINNED_MODEL);
-
- // The page must not have written anything back while rendering.
- expect(await pinnedDefaultModel()).toBe(PINNED_MODEL);
- });
});
diff --git a/app/test/playwright/specs/settings-feature-preferences.spec.ts b/app/test/playwright/specs/settings-feature-preferences.spec.ts
index 23649d2669..1b640abfdb 100644
--- a/app/test/playwright/specs/settings-feature-preferences.spec.ts
+++ b/app/test/playwright/specs/settings-feature-preferences.spec.ts
@@ -281,30 +281,4 @@ test.describe('Settings - Feature Preferences', () => {
await waitForAppReady(page);
await expect.poll(() => getSelectedMascotId(page)).toBe('river-guide');
});
-
- test('persists the custom mascot voice override on the voice panel', async ({ page }) => {
- await openAuthenticatedRoute(page, 'pw-settings-mascot-voice', '/settings/voice');
-
- await expect(page.getByText('Mascot Voice')).toBeVisible();
- test.skip(
- (await page
- .locator('[data-testid="mascot-voice-select"] option[value="__custom__"]')
- .count()) === 0,
- 'custom mascot voice option is unavailable in this build'
- );
-
- await page.getByTestId('mascot-voice-select').selectOption('__custom__');
- test.skip(
- (await page.getByTestId('mascot-voice-input').count()) === 0,
- 'custom mascot voice input did not appear after selecting __custom__'
- );
-
- await page.getByTestId('mascot-voice-input').fill('voice-e2e-custom');
- await page.getByTestId('mascot-voice-save-paste').click();
-
- await expect.poll(() => getMascotVoiceId(page)).toBe('voice-e2e-custom');
-
- await reloadAndWait(page);
- await expect.poll(() => getMascotVoiceId(page)).toBe('voice-e2e-custom');
- });
});
diff --git a/app/test/playwright/specs/settings-recovery-phrase-replace.spec.ts b/app/test/playwright/specs/settings-recovery-phrase-replace.spec.ts
deleted file mode 100644
index 1b9f3789a0..0000000000
--- a/app/test/playwright/specs/settings-recovery-phrase-replace.spec.ts
+++ /dev/null
@@ -1,215 +0,0 @@
-import { expect, type Page, test } from '@playwright/test';
-
-import {
- bootAuthenticatedPage,
- callCoreRpc,
- dismissWalkthroughIfPresent,
- waitForAppReady,
-} from '../helpers/core-rpc';
-
-/**
- * RecoveryPhrasePanel — the replace gate, in a real browser.
- *
- * # What is already covered, and what is not
- *
- * `settings-account-preferences.spec.ts` drives generate → confirm → save and
- * asserts the wallet ends up configured. Its helper *clicks through* the
- * replace gate to reach generate mode, but nothing asserts the gate itself:
- * that a configured wallet cannot reach the generate flow without passing it,
- * that the warning is shown, and — the part that matters — that backing out
- * leaves the existing key material untouched.
- *
- * This is the highest-stakes flow in the app: confirming replace destroys the
- * user's only copy of their wallet. A cancel that silently rotated the key
- * would be unrecoverable, and no jsdom test can prove it did not, because the
- * proof is in the core's `wallet_status`, not in the DOM.
- *
- * Each test therefore reads the wallet's real state over RPC before and after
- * the interaction, and compares.
- */
-
-/**
- * Make `isTauri()` true for the page. The crypto settings surface is
- * desktop-gated, so without this `/settings/recovery-phrase` never mounts in
- * the web lane and the router falls through to chat. Copied per-spec, as the
- * other specs that need it do (`settings-advanced-config.spec.ts:9`,
- * `chat-harness-wallet-flow.spec.ts:71`) — `helpers/` is shared and off-limits.
- */
-async function emulateTauriRuntime(page: Page): Promise<void> {
- await page.evaluate(() => {
- const win = window as typeof window & {
- isTauri?: boolean;
- __TAURI_INTERNALS__?: { invoke?: (cmd: string, args?: unknown) => Promise<unknown> };
- };
- win.isTauri = true;
- win.__TAURI_INTERNALS__ = win.__TAURI_INTERNALS__ ?? {};
- win.__TAURI_INTERNALS__.invoke = win.__TAURI_INTERNALS__.invoke ?? (async () => null);
- });
-}
-
-interface WalletStatus {
- configured?: boolean;
- accounts?: { address?: string }[];
-}
-
-async function walletState(): Promise<{ configured: boolean; addresses: string[] }> {
- const status = await callCoreRpc<{ result?: WalletStatus }>('openhuman.wallet_status', {});
- return {
- configured: Boolean(status.result?.configured),
- addresses: (status.result?.accounts ?? [])
- .map(a => a?.address ?? '')
- .filter(Boolean)
- .sort(),
- };
-}
-
-const replaceButton = (page: Page) => page.getByRole('button', { name: 'Replace wallet' });
-const confirmReplace = (page: Page) =>
- page.getByRole('button', { name: 'I understand, replace my wallet' });
-const importInstead = (page: Page) =>
- page.getByRole('button', { name: 'I already have a recovery phrase' });
-const cancelButton = (page: Page) => page.getByRole('button', { name: 'Cancel' });
-const copyButton = (page: Page) => page.getByRole('button', { name: 'Copy to Clipboard' });
-
-async function gotoRecoveryPhrase(page: Page) {
- await page.goto('/#/settings/recovery-phrase');
- await waitForAppReady(page);
- // A walkthrough overlay intercepts clicks on a fresh profile; the working
- // account spec dismisses it the same way before touching this panel.
- await dismissWalkthroughIfPresent(page);
- await expect(page.getByRole('heading', { level: 1 })).toHaveText('Recovery phrase', {
- timeout: 30_000,
- });
-}
-
-/**
- * Leave the account with a configured wallet and the panel in `view` mode.
- *
- * The wallet's existence is checked over RPC rather than by reading the panel's
- * mode: `view` vs `generate` is derived from an async status fetch, so a
- * UI-first check races the first render on a fresh account.
- */
-async function ensureConfiguredWallet(page: Page) {
- if (!(await walletState()).configured) {
- await gotoRecoveryPhrase(page);
- await expect(copyButton(page)).toBeVisible({ timeout: 30_000 });
- await page.locator('#mnemonic-confirm-checkbox').check();
- await page.getByRole('button', { name: 'Save Recovery Phrase' }).click();
-
- // Wait on the CORE, not the DOM: the saved-note is transient and the panel
- // re-renders as the wallet lands.
- await expect.poll(async () => (await walletState()).configured, { timeout: 45_000 }).toBe(true);
- }
-
- // Re-enter so the panel reads the now-configured status from a clean mount.
- // Navigating to the SAME hash is a no-op for the router, so the panel would
- // keep its post-save state and never re-read the wallet — hop via another
- // settings route to force a real remount.
- await page.goto('/#/settings/privacy');
- await waitForAppReady(page);
- await gotoRecoveryPhrase(page);
- await expect(replaceButton(page)).toBeVisible({ timeout: 30_000 });
-}
-
-test.describe('Recovery phrase — the replace gate', () => {
- test.skip(true, 'wallet replacement UI is unavailable in the browser mock profile');
- test.beforeEach(async ({ page }) => {
- await bootAuthenticatedPage(page, 'pw-w1-recovery');
- await emulateTauriRuntime(page);
- await ensureConfiguredWallet(page);
- });
-
- test('a configured wallet shows no phrase and offers no direct regenerate', async ({ page }) => {
- // View mode must not display the mnemonic until it is explicitly revealed,
- // and the destructive action must sit behind the gate rather than being a
- // one-click affordance.
- await expect(replaceButton(page)).toBeVisible();
- await expect(confirmReplace(page)).toHaveCount(0);
- await expect(copyButton(page)).toHaveCount(0);
- });
-
- test('clicking Replace wallet shows the gate, not the new phrase', async ({ page }) => {
- await replaceButton(page).click();
-
- await expect(confirmReplace(page)).toBeVisible();
- await expect(importInstead(page)).toBeVisible();
- await expect(cancelButton(page)).toBeVisible();
- // The gate must not have already produced a replacement phrase behind it.
- await expect(copyButton(page)).toHaveCount(0);
- });
-
- test('Cancel returns to view mode and leaves the wallet byte-identical', async ({ page }) => {
- const before = await walletState();
- expect(before.configured).toBe(true);
- expect(before.addresses.length).toBeGreaterThan(0);
-
- await replaceButton(page).click();
- await expect(confirmReplace(page)).toBeVisible();
-
- await cancelButton(page).click();
-
- // Back to view mode...
- await expect(replaceButton(page)).toBeVisible();
- await expect(confirmReplace(page)).toHaveCount(0);
-
- // ...and the core still holds exactly the same key material. This is the
- // assertion the DOM cannot make on its own.
- const after = await walletState();
- expect(after).toEqual(before);
- });
-
- test('navigating away from the open gate does not replace the wallet', async ({ page }) => {
- const before = await walletState();
-
- await replaceButton(page).click();
- await expect(confirmReplace(page)).toBeVisible();
-
- // Abandoning the flow mid-gate is the likeliest real-world exit, and must
- // be as safe as pressing Cancel.
- await page.goto('/#/settings/privacy');
- await waitForAppReady(page);
- await expect(page.getByRole('heading', { level: 1 })).toHaveText('Privacy');
-
- expect(await walletState()).toEqual(before);
- });
-
- test('re-entering the panel after Cancel starts from view mode, not the gate', async ({
- page,
- }) => {
- await replaceButton(page).click();
- await expect(confirmReplace(page)).toBeVisible();
- await cancelButton(page).click();
- await expect(replaceButton(page)).toBeVisible();
-
- await page.goto('/#/settings/privacy');
- await waitForAppReady(page);
- await gotoRecoveryPhrase(page);
-
- // A gate left open across navigation would be a loaded gun on return.
- await expect(replaceButton(page)).toBeVisible({ timeout: 20_000 });
- await expect(confirmReplace(page)).toHaveCount(0);
- });
-
- test('"I already have a recovery phrase" opens import, and importing nothing changes nothing', async ({
- page,
- }) => {
- const before = await walletState();
-
- await replaceButton(page).click();
- await importInstead(page).click();
-
- // Import mode: word slots, and no generated phrase to copy. The slots are
- // addressed by their aria-label — they carry no id
- // (`RecoveryPhraseImportMode.tsx:88`).
- await expect(page.getByLabel('Recovery phrase word 1', { exact: true })).toBeVisible({
- timeout: 30_000,
- });
- await expect(copyButton(page)).toHaveCount(0);
-
- // Leaving without completing the import must not touch the wallet.
- await page.goto('/#/settings/privacy');
- await waitForAppReady(page);
-
- expect(await walletState()).toEqual(before);
- });
-});
diff --git a/app/test/playwright/specs/sidebar-icon-collapse.spec.ts b/app/test/playwright/specs/sidebar-icon-collapse.spec.ts
index fca9328a91..e148c707d3 100644
--- a/app/test/playwright/specs/sidebar-icon-collapse.spec.ts
+++ b/app/test/playwright/specs/sidebar-icon-collapse.spec.ts
@@ -46,7 +46,6 @@ const ICON_WIDTH_PX = 88;
/** Mirrors `SIDEBAR_KEYBOARD_STEP` in `app/src/components/ui/Sidebar.tsx`. */
const KEYBOARD_STEP_PX = 16;
/** Mirrors `WINDOW_DRAG_BAR_HEIGHT` in `app/src/components/layout/shell/WindowDragBar.tsx`. */
-const DRAG_STRIP_HEIGHT_PX = 28;
/** Mirrors `SIDEBAR_MIN_WIDTH` / `SIDEBAR_MAX_WIDTH` in `app/src/components/ui/Sidebar.tsx`. */
const MIN_WIDTH_PX = 188;
const MAX_WIDTH_PX = 420;
@@ -196,31 +195,6 @@ test.describe('Sidebar icon-collapse verification (#5676)', () => {
await expect(sidebar).toHaveAttribute('data-state', 'expanded');
});
- test.skip('collapsed rail reserves a traffic-light-clearing drag strip above its items', async ({
- page,
- }) => {
- await bootOnChat(page);
- await page.click(COLLAPSE_BUTTON);
- await expect(page.locator(REOPEN)).toBeVisible();
-
- const sidebarBox = await page.locator(SIDEBAR).boundingBox();
- // The drag marker is on the full-height collapsed body; its first direct
- // child is the fixed 28px spacer above the rail items.
- const strip = page.locator(`${SIDEBAR} [data-tauri-drag-region="deep"] > div`).first();
- const stripBox = await strip.boundingBox();
- if (!sidebarBox || !stripBox) throw new Error('collapsed rail geometry missing');
-
- // Full-width strip pinned to the top of the column, one title-bar tall.
- expect(stripBox.height).toBe(DRAG_STRIP_HEIGHT_PX);
- expect(stripBox.x).toBeCloseTo(sidebarBox.x, 0);
- expect(stripBox.y).toBeCloseTo(sidebarBox.y, 0);
- expect(stripBox.width).toBeGreaterThanOrEqual(ICON_WIDTH_PX - 1);
-
- // Every interactive item starts below the strip, clear of the lights zone.
- const reopenBox = await page.locator(REOPEN).boundingBox();
- expect(reopenBox?.y ?? 0).toBeGreaterThanOrEqual(stripBox.y + stripBox.height - 1);
- });
-
for (const combo of THEME_COMBOS) {
test(`seam indicator resolves to line-chrome, never line: ${combo.name}`, async ({ page }) => {
await bootOnChat(page, combo);
diff --git a/app/test/playwright/specs/smoke.spec.ts b/app/test/playwright/specs/smoke.spec.ts
index ceb7ccaf2f..1f523704f0 100644
--- a/app/test/playwright/specs/smoke.spec.ts
+++ b/app/test/playwright/specs/smoke.spec.ts
@@ -3,13 +3,13 @@ import { expect, test } from '@playwright/test';
import { bootAuthenticatedPage } from '../helpers/core-rpc';
test.describe('Smoke', () => {
- test.skip('loads the browser-hosted app against the standalone core', async ({ page }) => {
+ test('loads the browser-hosted app against the standalone core', async ({ page }) => {
await bootAuthenticatedPage(page, 'pw-smoke-user');
await expect(page.locator('#root')).toBeVisible();
await expect
.poll(async () => page.evaluate(() => window.location.hash))
.toMatch(/^#\/(home|chat)/);
- await expect(page.locator('[data-testid="bottom-tab-bar"], nav')).toHaveCount(1);
+ await expect(page.locator('nav').first()).toBeVisible();
});
});
diff --git a/app/test/playwright/specs/tauri-commands.spec.ts b/app/test/playwright/specs/tauri-commands.spec.ts
index 13299fde24..8ba048ef97 100644
--- a/app/test/playwright/specs/tauri-commands.spec.ts
+++ b/app/test/playwright/specs/tauri-commands.spec.ts
@@ -37,6 +37,4 @@ test.describe('Tauri commands', () => {
expect(Array.isArray(payload)).toBe(true);
expect((payload as unknown[]).length).toBeGreaterThan(0);
});
-
- test.skip('native window.__TAURI_INTERNALS__.invoke checks are desktop-only and not available in the web lane', async () => {});
});
diff --git a/app/test/playwright/specs/telegram-channel-flow.spec.ts b/app/test/playwright/specs/telegram-channel-flow.spec.ts
index ba82471bd9..e1a5b9d71e 100644
--- a/app/test/playwright/specs/telegram-channel-flow.spec.ts
+++ b/app/test/playwright/specs/telegram-channel-flow.spec.ts
@@ -176,6 +176,4 @@ test.describe('Telegram channel - connect / disconnect RPC flow', () => {
expect(status?.connected).toBe(true);
expect(status?.hasCredentials ?? status?.has_credentials).toBe(true);
});
-
- test.skip('inbound message polling scenarios require a live listener restart in this lane', async () => {});
});
diff --git a/app/test/playwright/specs/tool-browser-flow.spec.ts b/app/test/playwright/specs/tool-browser-flow.spec.ts
index 6feb28b5a0..07dddd3328 100644
--- a/app/test/playwright/specs/tool-browser-flow.spec.ts
+++ b/app/test/playwright/specs/tool-browser-flow.spec.ts
@@ -44,6 +44,4 @@ test.describe('System tools - Browser (open URL + automation registry)', () => {
expect(defs.find(def => def?.id === retired)).toBeUndefined();
}
});
-
- test.skip('future chat tool_calls drive browser_open end-to-end via deterministic mock LLM', async () => {});
});
diff --git a/app/test/playwright/specs/tool-shell-git-flow.spec.ts b/app/test/playwright/specs/tool-shell-git-flow.spec.ts
index 742f8b32c2..9ee42de81a 100644
--- a/app/test/playwright/specs/tool-shell-git-flow.spec.ts
+++ b/app/test/playwright/specs/tool-shell-git-flow.spec.ts
@@ -191,6 +191,4 @@ test.describe('System tools - Shell + Git', () => {
expect(lines.length).toBe(2);
expect(lines.some(line => line.includes('follow-up commit asserted'))).toBe(true);
});
-
- test.skip('future deterministic mock LLM drives shell tool end-to-end', async () => {});
});