Repository navigation
feat(browser): route previews via oc-preview://, harden PreviewFetch, and ban raw file:// unconditionally - #303
Merged
Merged
Conversation
…hed servers and block check_cdp contextId/userGesture
…te-dual-route-cdp # Conflicts: # apps/desktop/src/surfaces/browser/mod.rs # crates/browser-pane/src/protocol.rs
…ow sticky suppression, and harden CdpCall/check_cdp
…te-dual-route-cdp # Conflicts: # apps/browser-engine/src/engine.rs
… 800-line ceiling
…iew:// and ban raw file:// unconditionally
|
PR test build retired — merged into |
…ird-party plugin ban, bounded PreviewFetch pool + abort + backpressure + exact skip, Connecting/zero-OpenTab older-engine fix)
…Blocked::Replaced suppressed
…te-dual-route-cdp # Conflicts: # apps/desktop/src/surfaces/browser/mod.rs # crates/browser-pane/src/client.rs # crates/browser-pane/src/protocol.rs
…te-dual-route-cdp
…eparse policy and unconditional file:// ban
…ter, per-read timeout, and short-EOF skip guard
…egacy MCP until Unsupported/Unavailable, and fix #292 merge regressions
…reams for CEF StreamReaderURLLoader
…ck-pressure and unconditional file:// ban
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
- Fold security-confirmed merged PRs #292 (6d7a6ed, WS-1 mandatory RemoteServer proxy), #294 (ae3e910, BROWSER-UI file-link/click-to-run fix with known symlink/junction root limitation), and #274 (5da6474, WS-9 engine MV3 extension host, inert without --extension flags) - Update browser Reviewed column: #301 in rework (#287 eager-attach time_updated regression still live on dev), #296/#298/#302/#303/#305/#306 in rework, #307 open for pre-merge security review - Audit upstream anomalyco/opencode fe8def6854..4122af0206 (+2 commits: 1 skipped #65255 core/codemode, 1 added UP-135 #65215 -> WS-8)
…te-dual-route-cdp # Conflicts: # apps/browser-engine/src/engine.rs # crates/browser-policy/src/lib.rs
…te-dual-route-cdp
… events + PreviewCredit flow control, tool-scoped open_file/Links:Open agent gating, fair PreviewFetchPool + abortable DNS timeout)
…t wait + Ready.preview_credit handshake, ranged-200 completion cancel/remove, EINTR + ascii-digit Content-Length)
…ven across previews and unconditional file:// ban
…te-dual-route-cdp # Conflicts: # apps/desktop/src/plugin_host/native/browser/scope.rs # crates/browser-pane/src/client.rs
…n, check_local_mcp_allowed, send_cdp, mod cdp, and preview guards
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
…P-143 (#318) - Fold confirmed merged PRs #307 (a1e7d0d, click-to-load reply videos), #306 (b5167f7, atomic agent_driven), #301 (6522f11, routed-session attach + recency closing #287 regression), #296 (95cb36a, legacy rune_mcp suppression + Half::is_builtin + check_cdp), #303 (6fb05ce, oc-preview:// app routing + raw file:// ban completing UP-095-PREVIEWS), and #316 (6e98fc2, Rune 7a707454 / #1307 strict local video opening) - Add missing browser follow-up rows UP-095-3P-CONTRACT (#296 narrow third-party plugin browser contract gap) and UP-095-PROMPT-GATE (new-session-start-only prompt gate split from #302) - Record #302 split (tunnel vs gate), #314 masking stream paused pending owner decision on agent-tab contexts, and updated browser Reviewed entries - Audit upstream anomalyco/opencode 4122af0206..b9a60d9d07 (+11 commits: 3 skipped, 8 added UP-136..UP-143)
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.
Summary
Lands PREVIEWS PR 2 on top of
dev(95cb36a8, including#281,#300,#304,#292,#294,#274,#309,#310,#307,#306,#301,#296): routes all workspace HTML previews (local and remote/api/fs/read/*) and artifacts (/api/experimental/artifacts/<id>/view/*&artifact://) into isolatedoc-preview://tabs, bans rawfile://unconditionally across engine and app, adds the"show source"/browser.preview.unsupportedfallback for older engines lackingReady.preview, adds preview chrome markers +"Show the file's code", and closes allnotes/review-rd281.mdPR 2 conditions across Rounds 1–3 (1e3f4992,67771007,d125ebfd).Round-3 (
d125ebfd) Findings & Polish Closed (ccb6a64e, 8 files)EngineMsg::Ready.preview_credithandshake:PREVIEW_CREDIT_WAIT_TIMEOUT = 20 s(matchingPREVIEW_PER_READ_TIMEOUT) toPreviewChunkBudget::acquire(crates/browser-pane/src/preview.rs): an unconsumedfetch()or stalled consumer can no longer pinPreviewFetchPoolworkers beyond20 s— on expiryacquiremarks the entry canceled, aborts the upstream HTTP fetch, and releasesActiveGuardimmediately.#[serde(default)] preview_credit: booltoEngineMsg::Ready(apps/browser-engine/src/{wire,engine}.rs,crates/browser-pane/src/{protocol,transport}.rs):rune-browser-rxcallspreview_chunk_budget.set_credit_enabled(*preview_credit)(reset tofalseon disconnect), so pre-PR#281-eradevengines (Ready.preview == true, preview_credit == false) bypass credit blocking and stream> 1 MiBpreviews cleanly without deadlock (while the engine's own2 MiBqueue cap and pool caps still bound in-flight bytes).200completion cancels and removes proxy immediately:PendingProxy::deliver_chunk(apps/browser-engine/src/preview/mod.rs) andProxyResourceHandler::read(apps/browser-engine/src/preview/handler.rs) sendPreviewCredit { cancel: true }(never returning credit for dead tail) and callremove_proxy(req_id)as soon asremaining_to_deliver == Some(0) && skip_remaining == 0, stopping the host HTTP stream immediately instead of pumping up to128 MiBof unused tail.crates/opencode-kit/src/client/preview.rs):ErrorKind::Interrupted(EINTR) retry inServer::preview_stream.Content-Lengthheader parsing to non-empty ASCII digits (t.bytes().all(|b| b.is_ascii_digit())).Round-1 & Round-2 Conditions Retained
eventschannel stays ondev's unboundedmpsc::channel+ plain.send(...);read_messagesdispatchesPreviewResponse{Head,Chunk,End}directly toArc<PreviewRegistry>;last_pumpprevents pump starvation;EngineMsg::PreviewCreditruns end-to-end (1 MiBcredit /2 MiBcap) directly onrune-browser-rx.open_file&Links:Open+ third-party plugin ban:Workspace:OpenFile/OpenFileSourceandLinks:Openenforcecurrent_tool_scope, refusing cross-session targets and hidden/secret HTML entries synchronously with 0 tabs opened and marking allowed tool previewsagent_driven = true.Plugins::is_builtin_plugin(Tier::Bundled && running()) blocks third-party grant minting andTabScope::check_tabdenies third-party mutations/DevTools on preview tabs.PreviewFetchPool&AbortablePreviewResolver:8workers,3/tab,4/server,16queued/tab,64global;.timeout_resolve(Some(5s)), literal-IP fast path, detachedpreview-dnscapped at16global /4/host,< 1 msCondvar wake onPreviewAbort::abort()releasing the pool worker immediately.file://ban,#292/#294/#274/#307preservation, context menu isolation, older-engine fallback (engine_caps_known(), 0OpenTabs onopen_refused_tab), and history/savedTabs/closedTab/sitePermissionsisolation: all intact.Live Verification (Real CEF 156.0.26 + Real
opencode-desktop.exe)proof/previews/pr2-r3-proof.ts->pr2-r3-proof.json:ALL_PASS):fast_ok.jsonimmediately (216 ms); all 3 unconsumed server HTTP streams aborted cleanly at20,262 ms, and Tab 1 recovered immediately with a subsequent fetch (tab1RecoveredAfterTimeout: true).devengine binary (48534ca6, nopreview_credit): Realopencode-desktop.exe+ real pre-PRdevopencode-browser-engine.exestreamed a4,194,304-byte (4 MiB) remote preview cleanly (status: 200,elapsedMs: 609, zero deadlock).200 OKon 16 MiB stops at range end (raw TCP wire bytes counted at scratch server): RequestingRange: bytes=10-109against a 16,777,216-byte200 OKserver yielded exact206with all100bytes matching (exactBytesMatched: true) while the scratch TCP server aborted early after writing only131,072bytes (0.78%of 16 MiB) on the wire (serverAbortedEarly: true).ALL_PASS):pr2-r2-proof.json,pr2-file-ban-proof.json,pr2-blockers-proof.json, andpr2-app-proof.json.pwsh scripts/guardrails.ps1(5/5),pwsh scripts/web.ps1 -Check(wasm32),apps/browser-engine --bins,opencode-desktop,cargo check --workspace,cargo check -p browser-pane --no-default-features, andcargo check -p browser-policyforaarch64-apple-darwin&x86_64-unknown-linux-gnu; 0#[test]/#[cfg(test)], 0.github/edits.