Skip to content

test(app): fix pre-existing red in composer-editable-on-snapshot-error (missing PlatformProvider / run-mode menu) - #4802

Merged
yomgui merged 1 commit into
devfrom
test/composer-editable-on-snapshot-error
Sep 11, 2026
Merged

yomgui merged 1 commit into
devfrom
test/composer-editable-on-snapshot-error

Conversation

@yomgui

@yomgui yomgui commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

apps/app/tests/composer-editable-on-snapshot-error.test.tsx fails on clean origin/dev with Platform context is missing. This is a test-only fix: the session surface grew two provider requirements after the test was written, and the real app root already supplies both, so there is no product regression. Found as a pre-existing red during #4797 and left unowned.

Diagnosis (diagnose-a-red-run)

Red on clean origin/dev @ e925c7c99 (control worktree, apps/app):

bun test --isolate tests/composer-editable-on-snapshot-error.test.tsx
error: Platform context is missing
  at usePlatform (src/react-app/kernel/platform.tsx:55:15)
  at useNativeContextMenu (src/components/ui/action-context-menu.tsx:11:31)
0 pass / 1 fail  (exit 1)

Bisect (git bisect start e925c7c99 947ed0cf4, good = the commit that added the test, 8 steps) shows two stacked breaks:

  1. 94649b44a feat: choose workspace run modes from the composer (feat: choose workspace run modes from the composer #4293) — first bad commit. SessionSurface now renders <WorkspaceRunModeMenu>, which calls useDesktopRestriction → useDesktopConfig() → throws useDesktopConfig must be used within a DesktopConfigProvider.
  2. be5ab613c feat(desktop): use native right-click menus (feat(desktop): use native right-click menus #4650) — message list now renders <ActionContextMenu> → usePlatform() → throws Platform context is missing (the error visible on HEAD, masking Idea: Rename into Labori #1).

Product check: PlatformProvider is mounted in src/index.react.tsx:51 and DesktopConfigProvider in src/react-app/shell/providers.tsx:61,71, so the shipped tree is fine. The sibling test composer-focus-continuity.test.tsx was already patched for exactly these two breaks in #4631 (mock WorkspaceRunModeMenu) and #4640 (PlatformProvider wrapper); this test was missed.

Fix

Mirror the sibling test: wrap the surface in PlatformProvider with createDefaultPlatform() and mock WorkspaceRunModeMenu to null. +6 lines, one file, no src/ changes.

Why CI did not catch it

PR CI (.github/workflows/ci-tests.yml → openwork-tests-core) only runs pnpm test:core, a hand-picked list of 18 app test files that does not include this one. The full pnpm --filter @openwork/app test only runs in openwork-tests-extended, which is gated to schedule (nightly 07:37 UTC) and workflow_dispatch and does not block PRs. So this red has been visible only in the nightly since #4293 (Sep 5).

Evidence

Daytona lane (matching E2E spec, run on PR head; published in the sticky test-evidence comment below):

OPENWORK_EVAL_E2E_TESTS=1 pnpm evals:e2e composer-editable-during-snapshot-error
  placement: daytona · 1 passed / 0 failed / 0 skipped · 125 s · verdict passed

This proves the product behavior the unit test covers is intact on the real desktop app, supporting the "test drift, not regression" classification.

Local lane (bun unit tests; there is no testkit wrapper for apps/app unit tests):

Target test on PR head f2629144f:

cd apps/app && bun test --isolate tests/composer-editable-on-snapshot-error.test.tsx
1 pass / 0 fail / 5 expect() calls  (exit 0)

Full app unit suite, PR head vs clean origin/dev control (same command, same bun 1.4.0 / pnpm 11.4.0 / node 24.20.0):

pnpm --filter @openwork/app test
  origin/dev e925c7c99 : 1590 pass / 20 fail  (exit 1)
  PR head    f2629144f : 1591 pass / 19 fail  (exit 1)

The only difference in the failing set is this test going green. The suite exit is still 1 because of the pre-existing reds below.

Other pre-existing reds (not fixed here — separate ownership)

Identical on clean origin/dev and this branch (19 tests, 8 files):

File Failing tests First error
tests/message-list-loading.test.tsx 10 Platform context is missing — same root cause as #4650, needs PlatformProvider
tests/message-list-step-fold.test.tsx 3 Platform context is missing — same root cause as #4650
tests/command-palette-settings.test.ts 2 expect(...).toBe / toEqual
tests/app-mentions.test.ts 1 expect(...).toContain
tests/managed-brand-header.test.ts 1 expect(...).not.toContain
tests/prompt-file-parts.test.ts 1 expect(...).toEqual
tests/tool-error-attribution-ui.test.tsx 1 expect(...).toContain
tests/mcp-local-server-recovery.test.ts — (error outside a test) Computer Use requires the bundled OpenWork helper on macOS. (likely macOS-env only)

The 13 message-list-* failures are the same PlatformProvider drift from #4650 and are a natural follow-up, kept out of this PR to keep the diff minimal.

Verdict

Passed for the claim in scope (this test is green on the PR head; no src/ change). The full-suite command is still red on dev for the pre-existing failures listed above.

@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 10, 2026 6:09pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Sep 10, 2026 6:09pm UTC
openwork-diagnostics Skipped Skipped Sep 10, 2026 6:09pm UTC
openwork-landing Skipped Skipped Sep 10, 2026 6:09pm UTC

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (8539 ms), confidentiality-review (8488 ms), desktop-den-sync-review (9784 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 2/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (f2629144ff295bcd6af4258b34540740785e38a1). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui

yomgui commented Sep 10, 2026 •

Copy link
Copy Markdown
Member Author

Passed · 10/10 tests · 15/15 assertions · 5 images

Commit 89a90bf815ca9d1ecbcdb56803a370ebea0ddcba · selected evidence

Open review report

…he snapshot-error composer test

apps/app/tests/composer-editable-on-snapshot-error.test.tsx has been red on dev
since #4293 (composer renders WorkspaceRunModeMenu, which reads
DesktopConfigProvider) and #4650 (message list renders ActionContextMenu,
which reads PlatformProvider). Both providers exist at the real app root,
so this is test drift, not a product regression. Mirror the fix already
applied to composer-focus-continuity.test.tsx in #4631 and #4640.
@yomgui
yomgui force-pushed the test/composer-editable-on-snapshot-error branch from f262914 to 89a90bf Compare September 10, 2026 18:08
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics September 10, 2026 18:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing September 10, 2026 18:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den September 10, 2026 18:08 Inactive

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (89a90bf815ca9d1ecbcdb56803a370ebea0ddcba). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui
yomgui merged commit 08f9e07 into dev Sep 11, 2026
27 checks passed

This branch was successfully deployed

1 active and 3 inactive deployments
Preview – openwork-app — 89a90bf8 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-den — 89a90bf8 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-landing — 89a90bf8 Deployed Sep 10, 2026 by vercel[bot]
Preview – openwork-diagnostics — 89a90bf8 Deployed Sep 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant