Repository navigation
fix(browser)/test: background tab host bounds and native right-click observation - #4744
Conversation
…iewport A background conversation's browser.open_url allocates a blank consent tab that stays off every native host and unsized until its approved first navigation completes (deferBackground, #4468). The spec asserted the 1280x800 background viewport on that blank tab; assert zero bounds and no hidden window there, and assert the background host geometry once the page holds a document. Also read state through probe.browserState() in the last step, which this world never exposed as readBrowserState.
Native popups have no DOM and no CDP target, so nothing outside the main process can see which entries a right-click offered or deliver a choice. Record each shown template as plain data (ids, labels, enabled, no callbacks) plus the last selection, and expose inspect/choose/dismiss to the app's main frame only when OPENWORK_DEV_MODE=1 and the app is unpackaged.
be5ab61 (#4650) replaced the overlay.html link menu with a native popup, so the spec's overlay target never appears. Read entries and deliver choices through the development seam, keep the negative half (no HTML menu in the app document), and assert Copy Link Address through the recorded selection and the clipboard.
The spec proved a pending background open through POST /experimental/ui-control/request, but the server mailbox answers "did not answer within 5 seconds" (#4459) while the step needs the user to switch conversations and approve navigation. Stamp the command with its origin through window.__openworkControl.command instead, which is exactly what the mailbox hands the window, and print the reply when it lacks a result.
…b re-attaches Switching back to the reading conversation re-attaches its view to the panel asynchronously; snapshotting native state mid-transition made the rejected paused open look like it changed geometry.
…end control The panel renders a "Suspend" button that is disabled while a task protects the page (title: Protected until browser work is released) and never sends the request, so the "Suspend tab" click and "protected or busy" toast the step expected could not exist. Assert the disabled control, then that browser.release_tab enables it.
seed.session fired session.rename and returned; three of five Daytona runs of browser-tabs-owned-by-thread then never saw the new conversation's title in the sidebar (it stayed "New session"). Reuse renameSessionAndWait, which confirms the listed title and retries the rename once.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Warden review summary — ClearNative findings: 1. 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 (119379 ms), confidentiality-review (127716 ms), spec-provenance-review (175956 ms), desktop-den-sync-review (138685 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (e74718c471e77a38874c221f200ac0501ae964bb). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
… contract The typecheck:electron step rejected the inspection fixture because the request() helper inferred a narrow item shape from its default argument, so a separator entry could not be passed. Annotate the fixture helpers with the NativeContextMenuItem contract from @openwork/types/desktop-ipc.
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (1c1885cca6ae52da0c35b1e596278427d17363ff). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
CI fix (1c1885c): Fix is test-only: the fixture helpers ( Verified locally: |
Resolves evals/packages/testkit/src/spec/runtime.ts: both sides made the same change to seed.session() (wait through renameSessionAndWait like sessions()) and differed only in the comment; dev's landed wording is kept, so the merged file is identical to dev and its per-spec surface isolation, declared-workspace creation and lazy provisioning (#4730, #4817, #4762) are untouched.
Deploying openwork with
|
| Latest commit: |
a6c6d9c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://04fe401e.openwork.pages.dev |
| Branch Preview URL: | https://e2e-browser-tab-geometry-nat.openwork.pages.dev |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (a6c6d9c39ecee6541b82c0ea9aa2232b4627df80). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Resync with
|
Makes
browser-tabs-owned-by-threadgreen on the Daytona E2E lane. Triage: cluster 6 / brief H inreports/e2e-red-2026-09-09/triage.md("Product UI changed, owning spec not updated" →browser-tabs-owned-by-thread).Root cause
Two stale claims plus three latent ones that were unreachable behind them:
BACKGROUND_TAB_VIEWPORT. The product (sinced9ad918efComplete browser tasks with site tools, page controls and user takeover #4468,deferBackground) intentionally keeps that tab off every native host and unsized (0×0) with no hidden window until its approved first navigation completes — attaching an uninitialized widget to a hidden host can crash Electron on Linux, and the unit test already states "pending consent needs no hidden native host". Intended geometry, now stated in the spec: pending consent tab →attached:false, aboveApp:false, bounds 0×0, backgroundWindowCount 0; once the page holds a document → single hidden host,bounds 0,0,1280×800,backgroundWindowCount 1. The "released page must not contact its destination" assertion is unchanged.be5ab613cfeat(desktop): use native right-click menus #4650 replaced theoverlay.htmlmenu with a nativeMenu.popup, which has no DOM and no CDP target, so the spec's overlay wait could never succeed.POST /experimental/ui-control/request, whose mailbox answers"did not answer within 5 seconds"(fix: make in-app UI control work in web and desktop through the server #4459) while the step needs the user to switch conversations and approve; the paused-open baseline was snapshotted mid re-attach; and the last step clicked a"Suspend tab"button that never existed (the panel renders a disabledSuspendtitled "Protected until browser work is released").What changed
context-menu.mjsrecords each shown native menu template as plain data (ids/labels/enabled, no callbacks) plus the last selection, and exposesinspect / choose / dismiss.main.mjsregistersopenwork:context-menu:*handlers only whenOPENWORK_DEV_MODE=1 && !app.isPackaged, main-frame only;preload.mjsexposes__OPENWORK_ELECTRON__.contextMenuunder the same env gate. Covered by a new case incontext-menu.test.mjs. No behaviour change for packaged builds.menuitemin the app document), and assert "Copy Link Address" via the recordedselectedIdand the clipboard; origin-stamped background open issued at the window boundary (window.__openworkControl.command({…, origin}), exactly what the mailbox hands the window); paused-open baseline taken after the reading tab re-attaches; task protection asserted through the disabled/enabledSuspendcontrol aroundbrowser.release_tab.transcriptLinkWorldgainsnativeMenu / chooseMenuItem / dismissMenu;browserBackgroundWorldgainscommandFrom;BrowserState(behaviors) now carriesbackgroundWindowCount.seed.session()now usesrenameSessionAndWaitlikeseed.sessions(). Three of five runs of this spec lost a seeded title (sidebar stuck on "New session") in different tests; this is the same retrysessions()already had.Proof
pnpm evals:e2e browser-tabs-owned-by-thread --daytonawithOPENWORK_EVAL_REF=<sha>(sandbox log:source verified <sha>×7):e74718c47(PR head): passed 7 / failed 0 / skipped 0 — verdictpassed.{"command":"evals:e2e","lane":"e2e","daytona":true,"placement":"daytona","engine":"legacy","surface":"legacy","files":["browser-tabs-owned-by-thread"],"passed":7,"failed":0,"skipped":0,"skips":[],"verdict":"passed"}— Duration 864 s, 7 Daytona desktop sandboxes (one per test), all disposed.bb53aa0685/2 (native-menu test green; background test hit the 5 s mailbox),5d8bd1ed26/1 (paused-open baseline race),f11bbcff55/2 (Suspend tabnever existed + seeded-title flake),8f5e1fbb26/1 (seeded-title flake only, in the link test).node --test electron/context-menu.test.mjs electron/browser-panel.test.mjs→ 73 pass;pnpm --dir apps/desktop test→ 397 pass / 0 fail / 1 pre-existing skip.Noticed, not touched
apps/desktop/electron/menu-overlay-preload.mjs, theopenwork:menu-overlay:*IPC channels, theoverlay.htmlVite entry, andpageTargets()'soverlay.htmlfilter are dead since feat(desktop): use native right-click menus #4650.evals/packages/behaviors/src/browser-task.tsBrowserStateandevals/worlds/browser-panel.tsBrowserStateare two hand-rolled parsers of the same IPC payload.test-run.jsonrecords the runner'sgitSha/branch, notOPENWORK_EVAL_REF(already listed in the triage "Not clusters").pnpm --dir evals run typecheckhas ~365 pre-existing errors unrelated to this change (Promise.withResolvers lib target, JSON import attributes, email templates jsx).