fix(browser): name the Cloak setContent hang instead of advising a longer timeout (#448) - #528
Open
Ayushraj06-bit wants to merge 1 commit into
Open
Ayushraj06-bit wants to merge 1 commit into
Ayushraj06-bit wants to merge 1 commit into
Conversation
Contributor
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. Limitations
This review is advisory and does not block merging. |
…nger timeout page.setContent() applies its markup and then never resolves on the local Cloak runtime: Playwright settles the call on a console.debug sentinel it writes from the utility world, and Cloak's Chromium accepts Runtime.enable without ever emitting Runtime.consoleAPICalled. A program that opens with setContent therefore spends its whole budget on the first statement and is told to increase --timeout, which cannot help. Classify the timeout through the existing timeoutKind path and name the document.open/write/close recovery CloakBrowser publishes on CloakHQ/CloakBrowser#360, which keeps the page on its current origin. setContent is checked after popup and download so neither loses a timeout it claims today, and message detection requires the timeout as well as the "setting frame content" call log so a detached frame is not retyped. Refs agentrhq#448, which reported this as a filechooser failure; filechooser itself forwards correctly through the Cloak bridge.
Ayushraj06-bit
force-pushed
the
fix/cloak-setcontent-timeout-hint
branch
from
September 13, 2026 20:56
7aab4b1 to
8da23e7
Compare
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.
Description
#448 is misdiagnosed.
filechooseralready works on the local Cloak runtime —page.setContent()is what hangs.Running the issue's program unchanged against real Cloak reproduces the timeout. Changing only
setContenttogotoand leaving every other line identical:So the chooser is forwarded,
setFilestakes in-memory payloads, and an input removed right afterclick()is fine. The program never got that far: it spent its whole budget on statement one, and browser run repliedSplit the task into a smaller run or increase --timeout— advice that cannot work, and sends the caller back around the same 30s wall.Cause. Cloak's Chromium accepts
Runtime.enablebut never emitsRuntime.consoleAPICalled. Playwright resolvesFrame.setContenton aconsole.debug(<tag>)sentinel it writes from the utility world besidedocument.write, so the promise never settles even though the markup has landed:Reproduced with
cloakbrowseralone, humanize on and off, so it is upstream of webcmd and not the browser-run bridge. This is CloakHQ/cloakbrowser#360, which Cloak-HQ confirmed and root-caused to the binary's DevTools layer on 2026-06-07, with a fix promised in "the next binary build". It is still open, and still reproduces on the current binary three months later. It also explains the issue's control: with stockplaywright-core,setContentresolves normally. And why Cloak 0.5.9 changed nothing — it is the browser binary, not the wrapper.Fix. Classify that timeout and name the cause and the recovery CloakBrowser itself publishes on #360, reusing the
timeoutKind/timeoutRunErrorpath that already backsPOPUP_WAIT_TIMEOUT_HINTandDOWNLOAD_WAIT_TIMEOUT_HINT. Two deliberate constraints:setContentis checked last, so popup and download keep every timeout they claim today.setting frame contentcall log and a timeout, because a detached frame or closed target logs that same line and must not be retyped.The hint points at the upstream workaround rather than a
data:URL, because it keeps the page on its current origin — and webcmd already has a separate typed error fordata:/about:blankdocuments losinglocalStorage:Verified end to end through browser run on real Cloak: completes in 21ms, leaves
page.url()untouched, and the issue's full filechooser program then returnsevidence.pdf.This does not make
setContentwork — that needs the binary fix tracked in #360.Alternative considered. Reimplementing
setContentinPlaywrightTransportto bypass the sentinel would make the call work, but it re-derivesraceNavigationActionand lifecycle semantics by hand and changessetContentfor stock Chromium and SLAB too — a large diff for a defect that is not webcmd's.Related issue: #448
Type of Change
Checklist
skill-src/, I ranmake buildand committedskills/— not editedAdapter Notes
Not an adapter change.
Screenshots / Output
Two tests fail on
mainand pass here:runner.test.tsgoes to96 passed (96). The other five added tests are regression guards that hold onmaintoo: popup/download precedence, the generic hint, and two that keep a non-timeoutsetContentfailure from being retyped.typecheckexit 0,buildexit 0. My Windows box has 28 pre-existing failures (22EPERM … symlink, plus\-vs-/path assertions); I diffed the failure set against a pristine checkout ofmainand it is byte-identical, with passing counts3590 → 3597for the added tests.Evidence above is from cloakbrowser 0.4.5 / Chromium 146.0.7680.177.5, headed persistent context — the configuration
session-manager.tslaunches.Notes
Refs, notFixes. This PR changes no filechooser code, because that path works, and it does not makesetContentresolve. I'd suggest closing Local Cloak browser-run does not forward transient filechooser events #448 as misdiagnosed once you've read the reproduction, but this shouldn't auto-close it.response_formatschema dropped by fix: parse fenced docs review json #260), not a finding about this change — same limitation string on feat: modular suite with interactive cloner TUI, browser-router, and ppt generator #525, Add Application Rescue Agent #523, agent #517, feat: add automated finance and invoice tracking plugin #516, # feat(cloner): Universal Website Cloner, WCAG 2.1 Audit & Design System Studio (webcmd clone) #515, feat: add universal website task engine UI #513 and feat(cli): add Weaver, a block-art terminal mascot #511..setContent(gets the hint even if it hung elsewhere. Popup and download take precedence.page.on('console')never fires on the default runtime, so page-sideconsole.logis silently dropped in every browser-run program.Refs #448