GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(browser): keep every open tab in the strip by Hona · Pull Request #65322 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Nov 21, 2026

Copy link
Copy Markdown
Member

A person comes back to a session and its browser tabs are gone from the right pane: all but the one the agent worked in last, or the next one to open. Nobody closed any, and the desktop still held every one.

Before After
One tab left of three All three tabs

Three tabs are open. The person uses fifty other sessions, the agent works in Pricing, and the person comes back. Pictures are from the pane's component fixture: the real side region, pane and model, the host's own pruneSessionKeys choosing the strip to forget, main's events through the Ipc schema, made-up pages.

Cause

Path On dev What happened
The host forgets a strip layout.tsx:428 prune, helpers.ts:21 The layout stores the strips of the 50 sessions used last. A session open in a shell tab is not excluded, and the whole strip goes with no plugin told.
A session returns in another directory host-apis.tsx:690-698 Its strip is copied to the new key only while the session is listed.
The window only added new tabs machine.ts:1311, :467 ids.filter((id) => !mirrored.includes(id)): a tab the desktop had already was never added again, and the panel lists only inventory tabs the strip stores. The next focus-strip-tab then stored one tab, alone.
A registration replaced main's tabs pane-machine.ts:567 A new binding started from the inventory the window last heard. A tab opened since (its report on the way, or not sent yet) left the desktop, the saved tabs and the strip.

The rule: the strip shows main's inventory

flowchart LR
  A[main reports an inventory] --> M
  B[the person comes to the session] --> M
  C[main asks to show one tab] --> M
  M["machine.ts: lost = tabs the inventory had before, that the strip no longer stores, minus the ones the person is closing"]
  M --> S["sync-strip { open, placed }"]
  S --> H["layout.open(key, session, { tab: 'append', after })"]
Loading
  • Every tab main holds comes back, each once, after the tab before it in main's order.
  • A tab the person closes stays out. The machine keeps its close (closing) until the desktop answers. A close no binding could take is kept and sent with the next inventory, instead of being dropped.
  • A registration merges. The new binding lists the window's inventory and every tab main still holds: the tabs of the binding it replaces, else the saved ones.
const listed = (held.length > 0 ? held : saved).reduce<readonly Browser.Tab[]>((tabs, tab, index, own) => {
  if (tabs.some((item) => item.id === tab.id)) return tabs
  const before = tabs.findIndex((item) => item.id === own[index - 1]?.id)

  return before === -1 ? [...tabs, tab] : [...tabs.slice(0, before + 1), tab, ...tabs.slice(before + 1)]
}, restore.tabs)

Unchanged

  • A tab the strip stores never moves. A new tab lands where it did (feat(browser): open a link's new tab beside the tab it came from #65126), and a restored strip draws once in its saved order (fix(browser): show saved tabs at once when the app reopens, and hold them while they load #65067).
  • No host code, no plugin API (public or built-in) and no stored shape changed.

Tests

All fail on dev.

  • machine.test.ts, "the strip shows the desktop's inventory": a lost strip gets every tab back with the next report, when the person returns, and before the agent's tab is selected; only lost tabs are placed; a tab the person closes stays out until the desktop answers; a close made while no binding could take it reaches the desktop.
  • pane-machine.test.ts, "a registration keeps the tabs the window had not heard of": a tab opened in the binding being replaced, reported or not, and a tab main saved after the window's last report.
  • electron-open.test.ts: the real pane in Electron registers again with an inventory of its first two tabs; the new binding lists every tab the pane held, in order.
  • browser-pane-restore.spec.ts: three tabs, fifty other sessions used, the agent works in one tab, the person returns. On dev one tab is left. Now all three are drawn as before, with the same widths, and a tab the agent opens meanwhile joins them at the end.

Limits

  • The other tabs of a forgotten strip are still lost: files, review, terminals, the selection and the pane placement. That is the host's prune, which also drops an open session. Not changed here.
  • Selection: only a tab main asks to show is selected again. Otherwise the pane shows the host's fallback.
  • Order: a lost tab that was first in main's order goes to the end when the strip still stores later ones. The host can place a tab only after another.
  • Not run: the host's prune inside the real layout provider (the story calls pruneSessionKeys itself), a session that moves while its shell tab is closed, the installed app, macOS and Linux.

No feature flag: a fix.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Hona added 3 commits November 21, 2026 13:06
@Hona
fix(browser): keep every open tab in the strip
c9f07a6
@Hona
Merge remote-tracking branch 'origin/dev' into browser-strip-reconcile
e579081
@Hona
test(browser): a registration keeps the pane's tabs in Electron
229819e
opencodejr[bot]
opencodejr Bot reviewed Nov 21, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found nothing that blocks a merge. I couldn't run it end to end: the Playwright story needs Chromium, which isn't installed here, and I didn't run the Electron test. I did run the new machine.test.ts and pane-machine.test.ts cases against dev: they fail there (9 of 151) and pass with this change. tsc -b for packages/gui-plugins passes.

The public API is unchanged. The changes are internal to the browser plugin: sync-strip.placed becomes a list and there is a new strip.read event. No host code, plugin API or stored shape changes.

I checked how a close is tracked in the strip. The mark clears when the command answers or when an inventory leaves the tab out, and held-back closes for saved tabs use the same request numbers as the commands they go out with. The registration merge keeps the window's order. One timing window remains: a strip.read landing after a close's answer but before the inventory that drops the tab could briefly re-add it. pane.ts publishes the inventory before it returns, so in practice this looks safe.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Hona
Hona merged commit 1bd37e7 into dev Nov 21, 2026
26 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Hona
Hona deleted the browser-strip-reconcile branch November 21, 2026 03:30
@Hona Hona mentioned this pull request Nov 21, 2026
fix(app): keep an open session's side tabs when old sessions are forgotten #65328
Merged
@BrewTestBot BrewTestBot mentioned this pull request Nov 23, 2026
opencode 2.4.0 Homebrew/homebrew-core#327368
Merged
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
opencode 2.4.0 amrkmn/homebrew-tap#1251
Closed
1 task
@github-actions github-actions Bot mentioned this pull request Nov 23, 2026
feat: opencode release v2.4.0 sprisa/opencode-server#95
Merged
@scottames-github-bot scottames-github-bot Bot mentioned this pull request Nov 27, 2026
chore(deps): update ⬆️ mise-packages scottames/dots#1181
Merged
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Hona
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.