Repository navigation
fix(browser): match official routed-session attach and port official recency rule - #301
Merged
Merged
Conversation
…e with BuiltinPromptGate
…ackoff immediately, and abort attach on Drop
|
PR test build retired — merged into |
…SessionIndex recency rule
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)
…sion/project lists through it
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
Replaces the earlier lazy-attach draft (archived on
browser-tools/lazy-attach-archived) with exact official parity ondev(48534ca6, incl.#292,#294,#274), closing the batch-8 Home bucket regression from#287(a974a664) and all Round-3 READER-10 findings with zero prompt gate and zeroopencode-kitchanges.1. Attach Moment & Set —
#287(dev) vs Official (anomalyco/opencodeorigin/dev)#287attached ondev:reconcile_sessions(apps/desktop/src/surfaces/browser/rpc/mod.rs:352-368) attached EVERY non-draft tab inapp.tabs(including all restored tabs at startup and background tabs opened withopen_in_background) plusRoute::Session.packages/gui-plugins/src/browser/model.ts:664-689,machine.ts:1000-1025): Never attaches restored or listed tabs at startup (sessions.list()). Attaches ONLY the routed session on open (sessions.current()atmodel.ts:664-671), keeps an already-attached session alive while open until closed or deleted (model.ts:617-619, 643-644), and aborts cleanly on close.#301:BrowserRpcState.routed_sessionsrecords(active_server, id)whenRoute::Sessionroutes to it (including whenopen_dirs.contains_key(&key)precedesapp.sessionsloadinginfo.directory), keeps it attached while still open inapp.tabsor routed, prunes on tab close /session.deleted, and implementsDroponSessionAttachment(rpc/session.rs) so window close aborts held attach sockets cleanly.2. Non-Mutating Official Recency Projection (
mergeRootSessionIndex) Across Every Listpackages/app/src/runtime/server/session-index.ts:4-20,recent-sessions-model.ts:374-403,home/sessions/controller.tsx:357):experimental.browser/attachwrites permissions (connection.ts:181, 453-464) ->projector.ts:990-992(time_updated: event.created), and renames/model/agent updates also bumptime_updated.SessionInfointact in store (data.session) and clamps ONLY the recency projection whenever(info.idle ?? 0) <= (indexed_idle ?? 0)(advancing only when a run completes withinfo.idle > indexed_idleor a new session is created).s.sessions(apps/desktop/src/workspace/search/recent_page.rs,incoming.rs,cost.rs): Replaced mutatingmerge_infowith non-mutatingwould_record_info/record_info+clamped_msinsiderecent_page::Page::active_msandtime. Raws.sessions[i].updatedstays untouched sopages/mod.rs:519, 589(page_key) invalidates cached transcripts on any second-client update andSessions:Get(services/session.rs:135, 146, 242) returns the raw serverupdated.home/list.rs:82,home/browse.rs:94,sidebar/recent.rs:156, 351,sidebar/customized.rs:51, 75,inbox/model.rs:142, 718,jump_list.rs:81.features/switcher/src/{lib.rs, entries.rs, search_index.rs:318,351, session_index.rs:27,34,47,60, servers.rs:116,133,162}+apps/desktop/src/workspace/search/switcher.rs(session_active_ms,recent_pageversion insessions_version, and per-remoteRemote.indexednon-mutating clamp inRemoteSeed/Remote).apps/desktop/src/app.rs:423(sort_projectsusesself.recent_page.active_ms(s)).apps/desktop/src/shell/tabs/recently_closed.rs:69(s.recent_page.active_ms).@sessionMentions:features/mentions/src/{lib.rs, index.rs:102-112, 146, 279}+apps/desktop/src/session/composer/mentions.rs(MentionsHost::session_active_ms+recent_pageversion insessions_stamp).routed_nowfix (rpc/mod.rs:380-390): Setsrouted_now = Some(key)whenopen_dirs.contains_key(&key)even ift.directoryprecedesapp.sessions.3. No Prompt Gate &
devReconciliationgate.rs,Incoming::PromptGate,hold_write, and allopencode-kitchanges removed; prompt gate belongs strictly to#302).origin/devcleanly through48534ca6(#292,#294,#274,#309,#310).Security Scope
contract.jsongrowth, zeroENGINE_REVISIONbump, zerostruct Appfield growth).BrowserRpcFeaturescoped strictly to(active_server, routed_session_id)on open; never exposed to Luau plugins.Driven Verification (
proof/browser-tools/lazy-attach/summary-v4.json, 10/10 PASS)baseline):0attaches; Home bucketsToday:[ses_01], Yesterday:[ses_02], Older:[ses_03,ses_04,ses_05].open5): All 5 routed sessions attached (["ses_01".."ses_05"]), servertime_updatedbumped+50 son all 5 (e.g.ses_05:1792612996045 -> 1795205055251), Home buckets/row order and Projects (["proj_1", "proj_2"]) stayed 100% unchanged, and window close aborted all 5 held attaches (attachAbortedCount: 5).projects,Ctrl+Shift+O->sort_projects): Openingses_04(proj_2, bumped+50 sahead of wall clock) beforeses_01(proj_1) kept["proj_1", "proj_2"].palette,Ctrl+Shift+F+"Session"server search ->sw.loaded): Kept clamped order["ses_01", "ses_02", "ses_03", "ses_04", "ses_05"].closed, right-click+): Kept clamped order["ses_01", "ses_02", "ses_03", "ses_04", "ses_05"].@sessionMentions (mentions,"@Session"inses_01): Kept clamped order["ses_03", "ses_05", "ses_02", "ses_04"].Sessions:Getraw timestamp (sesget): PluginSessions:Get("ses_05").updatedreturned exact raw server1795205089646(NOT clamped1792613036470).transcript): Second client updatingses_03(updatedbumped,idleunchanged) invalidatedpage_keycache (messageFetches.ses_03: 4) and rendered"SECOND_CLIENT_UPDATE_42".done):session.execution.succeededadvancingtime_idleonses_03promoted ONLYses_03(Today:[ses_03,ses_01], Yesterday:[ses_02], Older:[ses_04,ses_05]).5/5,web.ps1 -Check,browser-policyaarch64-apple-darwin&x86_64-unknown-linux-gnuviatools/cargo.ps1,--workspace --all-targets,opencode-desktop --features browser: ALL PASS. Pinged REFERENCE innotes/ORCHESTRATOR-inbox.mdto rerunhome-unread-badge,context-menu-home-row,home-row-hover.Held unmerged for READER-10 review.