Repository navigation
test(desktop): WorkHub layout E2E flakes while Coordination Session is resolving #3961
Description
What happened
apps/desktop/e2e/workhub-layout.spec.ts intermittently times out while waiting for .workhub-result.
The test currently treats the following assertion as proof that WorkHub is ready:
await expect(page.getByRole('main', { name: 'WorkHub' })).toBeVisible();However, both WorkHubCoordinationStatus and the ready WorkHubSurface render a <main aria-label="WorkHub"> and a composer. The assertion can therefore pass while the Coordination Session is still resolving.
If the test fills the composer and presses Enter during that state, submission is correctly blocked by sendBlocked. The resolving component is then replaced by the ready surface, but no request was accepted, so .workhub-result never appears.
Expected behavior: the E2E should wait until the real WorkHub conversation surface can accept input before submitting, then continue to verify that the submitted Session result is rendered without overlapping its target metadata.
How to reproduce
-
Build the repository from the root:
npm run build
-
Repeatedly run the focused E2E:
cd apps/desktop npx playwright test \ --config=e2e/playwright.config.ts \ e2e/workhub-layout.spec.ts \ --repeat-each=10 \ --workers=1
-
Observe an intermittent timeout at:
await expect(page.locator('.workhub-result')).toBeVisible();
Observed during diagnosis:
- PR fix(desktop): make proxy credential updates explicit and Host-owned #3704 merge result: 3 failures in 5 runs
- Corresponding base: 1 failure in 5 runs
- A newer main-based replay: 1 failure in 10 runs
The failure is also reproducible without the proxy-password changes from PR #3704.
Environment
- Maka commit:
6762085e2(upstream/main); also observed on the PR fix(desktop): make proxy credential updates explicit and Host-owned #3704 merge result - OS and version: macOS 15.6, Apple Silicon (
arm64) - Surface: Desktop Electron E2E
- Node.js version: v24.19.0
Logs, screenshots, or additional context
Investigation indicates this is a test-readiness race rather than a WorkHub routing or execution failure.
Relevant code:
apps/desktop/e2e/workhub-layout.spec.tsapps/desktop/src/renderer/workhub-surface.tsxapps/desktop/src/renderer/app-shell.tsx
Implementation constraints:
- Preserve the WorkHub architecture defined in
docs/workhub-domain-language.md: the active Runtime Host's stable Coordination Session remains the authority for the WorkHub conversation. - Keep submission blocked while the Coordination Session is resolving.
- Synchronize the E2E with a semantic ready state that distinguishes
WorkHubSurfacefromWorkHubCoordinationStatus. - Do not use a fixed delay or retry-only workaround.
- Do not weaken or remove the
.workhub-resultand layout assertions. - Do not introduce a fallback write path, duplicate transcript state, or an ordinary-Session submission before coordination readiness.
Acceptance criteria:
- The test submits only after the ready WorkHub surface can accept input.
- The existing result and non-overlap assertions remain intact.
- The focused test passes for at least 20 repeated executions.
- The Coordination startup failure/recovery E2E continues to pass.
Related but not duplicate:
- tracking(desktop): evolve WorkHub into a per-Runtime-Host conversational coordinator #3492 tracks the broader WorkHub architecture and delivery.
- [Desktop E2E] WorkHub correction test flakes while automatic session title is pending #3762 fixed a different WorkHub E2E synchronization race involving asynchronous Session title generation.
- fix(desktop): prevent WorkHub result overlap #3645 introduced the affected layout regression test while fixing result overlap.
Activity
Sun-GLiang commentedon Aug 27, 2026
I will work on this.
chore: re-trigger CI
chore: retrigger CI
chore: retrigger CI
chore: retrigger CI