Repository navigation
Add hide browser page commands for agents - #536
Merged
Merged
Conversation
hide browser snapshot, click, fill, type, press, hover, drag, scroll, wait, screenshot, eval, console and network read and drive a browser display of the caller's checkout. hided relays CDP frames from a claimed one-shot workspace socket to the desktop's scoped gateway, capped at eight relays, 4 MiB messages and a 60 s idle limit. The page-side code is ported from chromux (MIT) and embedded as assets.
A desktop e2e runs hide browser from an isolated Herdr pane against the candidate app: snapshot, fill and click in the page and in a cross-site frame, --diff and --grep, the overlay the operator sees, console, network, eval and screenshot; a dialog reported and holding the display until it is answered; busy, file, missing displays and stale refs. The help text now shows the snapshot lines as they print.
The snapshot, dom, render and overlay assets run as the CLI runs them: masking and state suffixes, refs that survive a re-snapshot, --diff and --grep, clickable divs and covering overlays, reach into same-origin frames and open shadow roots, fill on controlled inputs and selects, refusals of hidden, covered, stale and unfillable targets, click --text, changed ignoring a scroll, and the overlay staying out of snapshots.
A device pane's hide reaches the relay through the reverse Workspace forward, snapshots and clicks its display like a local pane, and fails with the Workspace commands' renderer_unavailable when no desktop is attached. Runs against the isolated SSH server like remote-workspace.spec.ts.
A selected View in a window another app covers reads visibilityState hidden yet takes input and screenshots, so the page's own visibility refused agents whenever the operator's window was behind another app. hided now answers the relay with whether the display is its area's selected View, and input and screenshots refuse display_hidden from that; a View in a Workspace not in front still fails display_hidden when its input goes unanswered. The desktop journey proves the refusal.
Session guidance lists the hide browser page commands beside browser open and points at hide browser help. BROWSER_DISPLAYS.md describes the agent page commands, their state, frames, overlay, dialogs, hidden displays and limits; ARCHITECTURE.md the hided relay path.
Four relays at most, so half of the gateway's clients stay free; a relay ends after five minutes, idle time counts only CDP text frames, and every send has a five-second deadline. Tests cover the oversized and binary frame closes.
Page text is sanitized before it reaches the terminal, a command has a two-minute deadline, dialogs are detected per frame session, frame tags are validated, the event buffer is capped by bytes, and the failure table and next actions cover every reason a command can return.
A frame a dialog holds answers no script, so its dialog check now runs before its tag is read; the read timed out first and reported page_unresponsive. The desktop e2e covers a frame's confirm, a ref from a frame that navigated, and the View in front staying put after a journey.
A line break in an element's id, role or text no longer starts a line of its own, and api tokens and similar fields are masked. Printing replaces control and bidirectional characters but keeps joiners, the failure reason on stderr is sanitized too, and wait polls once more at its deadline.
HyunjunJeon
pushed a commit
to HyunjunJeon/hide
that referenced
this pull request
Nov 12, 2026
Closes with-hide/hide-private#526 Closes with-hide/hide-private#599 Refs with-hide/hide-private#395, with-hide/hide-private#530, with-hide/hide-private#117, with-hide/hide-private#586 Refs with-hide/hide-private#832 ## Summary - Start the checkout PR flow on Main after its setup has focused another workspace. - Prevent Windows test browsers from losing local page or resource requests during shell startup. - Retain the failed row and pointer state for a separate, unreproduced late card-hover failure. ## Review - **Risky files**: browser-launch.cjs merges installed runner defaults; the desktop preload extends effective flags. - **Risky files**: checkout-pr.spec.ts retains discovery's connection, then resets first-run selection before Main. - **Risky files**: desktop browser.spec.ts uses the shared arguments for its plain Chromium launch and checks the applied features through CDP. - **Decide**: The narrow upstream fix uses the locked runner's internal argument API; a changed shape fails startup. - An entire runner upgrade would also replace the browser revision and is outside this stabilization change. - **Cost**: The hover observer exists only for one test phase, retains 32 transitions, and is removed on every exit. - **Cost**: Splitting the plain-browser notice from the native-view lifecycle adds one isolated fixture start so Windows CI checks that launcher too; its existing notice assertions are retained. - [Windows run 41016473655](https://github.com/with-hide/hide/actions/runs/41016473655/job/123933953907), tracked by [private with-hide#130](with-hide/hide-private#130), records the same document-load error. - [with-hide#832](with-hide/hide-private#832) tracks one later card-hover failure; this PR does not claim its cause is fixed. ## Tests - **Layer**: Unit feature merging; real browser startup and desktop recovery cross the actual host launch boundary. - The desktop plain-browser case checks the effective final disabled-feature list, retained runner defaults and the Windows loopback fix before opening the shell. - It passed its first Windows CI attempt on the final head in [the desktop lane](https://github.com/with-hide/hide/actions/runs/42860546110/job/129985854339). - Units cannot observe which feature list the launched browser applies; the startup check reads that applied state. - **Catches**: Removing the Windows feature fix failed two merge checks; restoring it passed all three. - **Repeat**: Linux/macOS: five flows x20, [100 passed each](https://github.com/with-hide/hide/actions/runs/42832076296). - Desktop recovery/relaunch: each x10 on macOS/Windows, retries 0, [40 passed](https://github.com/with-hide/hide/actions/runs/42831271844). - Final Windows: five flows x20, retries 0, [100 passed](https://github.com/with-hide/hide/actions/runs/42844846265/job/129929485236). - **Waits**: No new wait, delay, retry, timeout or threshold; the existing Main assertion follows explicit state setup. ## Evidence - **Verified**: Local startup/checkout flows, desktop recovery/relaunch, unit 3, lint, types, builds and policy checks. - **Verified**: The split desktop plain-browser and native-view flows passed locally without retries; desktop lint and typecheck passed. - **Verified**: A controlled trigger replacement preserved the original failure and captured mounts=2 before teardown. - **Verified**: [Required CI](https://github.com/with-hide/hide/actions/runs/42860546110) and independent review passed on final head c532660. - **Not verified**: The historical reference-only causes and the late hover cause. <details><summary>Failure evidence and review boundaries</summary> - with-hide#526's run 42780431716 drew Workspace while the test expected Main after setup focused its agents. - with-hide#599's run 42080456072 had an unmounted shell, a successful document and a failed entry script with ERR_NO_BUFFER_SPACE. - Private with-hide#130 is handled separately by public PR with-hide#2372; its Windows host log recorded window.load_failed ERR_NO_BUFFER_SPACE after a normal daemon start. - The test-only startup fix follows [the upstream fix](microsoft/playwright#43605) and [the browser defect](https://issues.chromium.org/issues/572515601). - The locked runner 1.63 lacks that fix. The helper reads its installed defaults rather than copying a version-specific list. - with-hide#395's run 42140863283 attached its daemon before its shell wait failed, with no page-side or failed-load signature for that exact wait. Its initial report used the retired fixture startup path; neither identifies this PR's connection cause. - with-hide#530's original failure drew Main with a failed sidebar boundary. A controlled stylesheet abort reproduced that screen and a missing CSS-token diagnostic, but the original artifact retained no asset-failure signature. - with-hide#117's latest retained record has only a whole-test timeout. Its historical lost step remains unidentified. - with-hide#586's run 42359435922 explicitly reports the loopback error, but its initial whole-test timeout and its separate focus flow were not resolved by the targeted repetitions. - For those next failures, inspect pageSide screen/project state, request status, failed requests, renderFailures and renderDiagnostics. The dump now retains failed regions and the newest eight relevant render diagnostics. Each reference-only issue has a comment with its confirmed facts, remaining gaps and next dump. - with-hide#536 was closed separately because commit 8be1505 deleted its Home collision test. The current no-project startup spec does not replace that behavior. - The first Windows repetition had 99/100 passes: checkout-pr.spec.ts:273 failed at the final light-theme hover after the shell, row, PR glyph and browser display had already drawn. - A diagnostic-only repeat at 5eefccb passed 100/100: all 20 checkout attempts retained one trigger mount, had PR facts ready and hit that row with the pointer. The card opened after its normal hover delay. This did not reproduce or establish the cause of the earlier failure. - The replacement diagnostic captures the failing state inside that step, before teardown can add a disconnected banner and move the row. It records the checkout key, mounts, pointer hit, geometry, focus, visibility, drag marks and tooltip state, preserves the original error, and reports independent cleanup failures. - The old conversation-date fixture also caused automatic sleep of the Main setup agent in the failed run. A current-clock proposal removes that sleep locally, but its relationship to the hover failure is unconfirmed. It remains an uncommitted local patch documented in with-hide#832. - No product input, runtime mutex, snapshot wire or rendering path changes. The operator's installed application was untouched. </details> <details><summary>Verification record</summary> - Final head: c532660. - Startup repeat candidate 4231d60: Linux/macOS each five flows x20, no retry. - Desktop repeat candidate ce0dffe: JSON reports on each OS show expected=20, unexpected=0, skipped=0, flaky=0, repeatEach=10 and retries=0. - Diagnostic-only Windows candidate 5eefccb: run 42838637529, five flows x20, no retry, 100 passed. The temporary early observer and trace flag were reverted. - Final Windows repeat candidate 49b560a: run 42844846265, five flows x20, retries=0, 100 passed; job log confirms the exact tested commit. - All temporary workflow changes are reverted. The repeated specs, shared startup fixtures and guide match the final Windows repeat candidate; the later desktop browser.spec.ts regression and its smaller size baseline are the only differences in those test trees. - Head 1933d66 is a source-identical verification commit after f45c106, added to regenerate the synthetic merge against the corrected base. - Review follow-up c532660 applies the shared launch settings to the desktop plain browser and separates that existing notice contract into a Windows-covered case. - Local current source: checkout hover flow passed without retries; a controlled browser replacement captured the original failure and two mounts; web lint and test-size budget passed. - Earlier unchanged-source checks: web build; web/desktop lint; desktop typecheck; startup/checkout 3; desktop recovery/relaunch 2; merge unit 3; design contract and policy checks passed. - Manual repeat dispatches that skipped every test and draft-only verify failures are excluded from verification evidence. - Independent review and required CI 42860546110 passed on c532660. - Ready run 42849933157 checked synthetic merge 83a0f35 against base 8284fb6, which predates with-hide#2398. - That merge still waited on the retired status.herdr field; current main uses status.engine. All hard web failures were at that restart boundary. One required failed-job rerun was started. - The regenerated merge f4ed9d1 includes the corrected status.engine wait. - Final run 42860546110 tests merge 6b977ba containing c532660; completed job logs confirm that checkout. - Its Linux suite has 412 passes and eight Windows-only skips, the retry-free changed-spec repeat has 80 passes, Windows web has 85 passes, and Windows desktop has 24 passes and one existing platform skip. The new plain-browser startup case passed its first attempt in 6.9 seconds. </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #159
Related: PRD
agents/prd/hide-browser-cli/prd.mdSummary
hide browser snapshot|click|fill|type|press|hover|drag|scroll|wait|screenshot|eval|console|network <display>, 안내는hide browser help./ws에browser_relay를 요청하고, hided가 체크아웃과 디스플레이를 검사한 뒤 데스크톱 게이트웨이에 직접 붙어 CDP를 중계합니다. capability URL은 CLI에 오지 않고, 디바이스 pane도 같은 경로를 씁니다.display_busy입니다.@N, cross-origin frame은@<tag>:N입니다.Review
visibilityState가 아니라 core의selected로 정했습니다. 가려진 창의 selected View는hidden으로 읽히면서도 입력을 받는 것을 native QA로 확인했기 때문입니다. PRD D-14의 "시도한 뒤 실패" 문구와 달리, 선택되지 않은 View는 미리 거부합니다.dialog_open으로 실패합니다(조용히 건너뛰지 않음). 바쁜 광고 frame이 있는 페이지는 읽기가 막힐 수 있습니다.hided/src/browser_relay.rs,hided/src/server.rs- failure path와 자원 상한: 릴레이는 hided 클라이언트 8개 중 최대 4개, 수명 5분, idle 60초(CDP text만 셈), send 5초.hided/src/browser_control.rs- ownership: 체크아웃/디스플레이 검사와 capability URL 경계.hided/src/browser_page/{page,actions}.rs- failure path: dialog, hidden, timeout이 어떤 reason이 되는지.hided/assets/browser/*.js,browser_page/mod.rsprintable- 페이지 텍스트가 터미널에 닿는 경로와 비밀값 마스킹.Mutex<Runtime>밖 자체 task이며 core 상태와 snapshot wire는 그대로입니다. 이벤트 버퍼 16 MiB, frame 24개, wait 폴링 간격은 frame 수에 비례해 게이트웨이 600회/분 아래로 둡니다.browserCdp.ts)가Input.dispatchDragEvent의data.files를 그대로 통과시키는 기존 gap이 있습니다. 이 PR은 게이트웨이를 건드리지 않으므로 후속 이슈로 열어도 될까요?Evidence
browser-agent.spec.ts3개, 후보 앱과 격리 Herdr에서 실행: 한글 fill과 click, cross-origin frame 입력,--diff/--grep, console/network/eval/screenshot, frame이 이동한 뒤의ref_stale, 실행 후 앞 View 불변, top과 frame의 dialog 보고와dialog_open, busy/hidden/file/missing 거부. 마지막 3회 연속 통과, dialog 테스트 4회 반복 통과.remote-browser-agent.spec.ts, 격리 sshd와 Herdr 두 개: 디바이스 pane에서 snapshot과 click, 데스크톱이 없을 때 Workspace 명령과 같은 reason.browser-agent-assets.spec.ts8개(plain Chromium): 마스킹, 줄 위조 방지, ref, 오버레이 등. 심은 결함 3개를 잡았습니다.verify-web.sh, CI가 도는 check 스크립트.hidden으로 읽히면서도 입력과 스크린샷을 받는 것을 확인했고, 그래서 gate를selected로 바꿨습니다.display_hidden)는 native로 관찰하지 못했습니다. timeout된 입력이 나중에 전달되는지도 재지 않았습니다.cargo test의 hide-platforma_burst_is_bounded_and_ends_in_an_overflow_rather_than_silence가 실패합니다(7425 changes). 이 PR은 hide-platform을 바꾸지 않습니다.Verification record
agents/prd/hide-browser-cli/prd.md(sha256 ac4eca6987b61529ef266cae34b86d5c12642cf994540a31e81e29b023f9652d)agents/runs/hide-browser-cli/verification-report.jsonandagents/runs/hide-browser-cli/verification-report.md; source fingerprint 9a929b94373a2d505366da11d8a818bb1aa5ef7cb750bce28aa4594928afc456data.filesdrag gap (browserCdp.ts out of scope), axum pre-buffer, page-world spoofing beyond tag checks, grep ReDoS, screenshot symlink, post-claim revocation poll.