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 the pane's tabs unless the person or the agent closes them by Hona · Pull Request #65313 · anomalyco/opencode

Conversation

@Hona

@Hona Hona commented Nov 21, 2026 •
edited by opencodejr Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

A person clicks a link in the conversation. Its page opens in a new tab of the right pane and shows. About 15 seconds later, while they type a prompt, the tab closes by itself. A link to an address that does not answer opens a tab that closes at once. Nobody closed either, and the window says nothing.

  • Now: a tab that showed a page stays until the person, the agent's close tool or the page itself closes it.
  • Since: feat(desktop): signed-in browser pane with extensions, previews, prompts and agent safeguards #63002 (19 Nov). Release 2.3.2 does not have this code.
The strip after the link's tab opened and the person typed
Before
After

Cause

tabs.open makes the tab, then runs its first navigation, and undoes the tab when that navigation rejects (pane.ts:1181, :1192 on dev; the agent's file preview does the same at :1120).

opening.defer(() => { if (page(binding, tabID) === opened) dispatchBinding(binding, { type: "tab.closed", tabID }) })
await opened.execute({ action: { type: "navigate", tabID, url: action.url }, files: [] }, signal, origin)
  • A page still loading: the navigation rejects when the page has not fired load within 15 s (navigation-deadline.ts:13, around loadURL at chromium.ts:1334). A page with slow ads or one hanging request has shown long before that.
  • A page that fails to load: loadURL rejects with Chromium's error.
  • Silent: the window's command swallows both, because "the tab itself reports" them (pane.ts:580). By then the tab is gone.

What removes a tab

Path Who
tabs.close: strip button, shortcut, menu, "Leave site?", the agent's tool person, agent kept
window.close(), a pop-up whose first address is refused the page kept
A plugin closing the tab it opened, an extension's chrome.tabs.remove the person's plugin or extension kept
Session deleted: main forgets its saved tabs person kept
tabs.open undone when its first load rejects nobody fixed
The agent's file preview undone the same way nobody fixed for a page still loading
A binding that closes (session switch, reconnect, idle eviction, reload): pages are released, the tabs come back unloaded no removal since #63002 unchanged
A registration that lands before a new tab's first report restores without it nobody, a window of milliseconds listed
Host: the layout keeps 50 session strips and drops the rest, whole (layout.tsx prune) nobody listed, host
Host: a strip key removed without the plugin is not added again in that run, since the window only appends tabs new to the inventory nobody listed

Fix

  • One rule (keepsOpenedTab in errors.ts) decides what an open leaves behind when its first load rejects:

    The first load The person's tab A plugin's tab (experimental.open) The agent's tab
    still under way at the deadline stays, loading; the command settles stays; the call resolves with the handle stays, reported and shown as a tab that loaded; the agent's error names the tab
    failed by Chromium stays, with the page that says why and offers Reload stays; the call resolves with the handle undone; the agent gets the failure
    committed no page (cancelled, became a download), or the pane could not open it undone undone; the call rejects undone
  • A tab that stays is an ordinary tab. One path (firstLoad in pane.ts) serves the tab that loaded and the tab that stays: its state is refreshed, it is announced and shown per the same options (focus: false keeps it in the background, a file preview takes the pane), and its opener holds it. No tab exists whose opener has neither a handle nor an undo.

  • The agent's error names its tab, in the message only (no tool schema changed): browser.tabs.open failed. The browser page did not finish starting or navigating. Reload the tab and inspect it before retrying. The tab stays open as tab_…: use that tabID with browser.wait, browser.reload or browser.tabs.close, and do not open the address again.

  • experimental.open documented a rejection only for an unavailable pane or a session not on screen. Its TSDoc and the guide now say that it resolves once the tab exists, also while the page loads or after the load failed, and rejects when the address opened no page.

  • Deadline as an input: the pane and its pages take navigationDeadlineMs for a navigate command's load. Production passes nothing and gets NAVIGATION_DEADLINE_MS, the same 15 s. Page start-up keeps the constant.

  • Log: main writes browser tab closed: its open failed when it undoes a tab, and browser pane closed with the reason when a binding closes. The desktop log had no line about either. The window's [browser] unmapped failure line now carries the failure's code and the action as text; it passed them as an object, which the desktop log wrote as [object Object]. No unmapped failure removes the pane or a tab that existed: the only removal behind one is an open undone as in the table, which main logs.

Unchanged

  • Every close the person or the agent asks for, a page that closes itself, a deleted session.
  • The agent's open of an address that fails to load still leaves no tab.
  • No window behaviour and no stored shape changed, so the strip's order, widths and selection are untouched. The only window change is the text of one log line.

Tested

On dev Covers
electron-open.test.ts: the real pane in Electron, attached to a stand-in server, opening tabs as a conversation link, a plugin and the agent do fails: both tabs are gone from the inventory Person: two tabs open, then a link to a page that shows and keeps loading past the deadline, and a link to a page that fails to load. Every tab is still reported, in order; the commands do not fail. Plugin: both of those opens resolve with a handle and closeTab on it closes the tab; an address that opens no page rejects and leaves no tab. Agent: a tab kept at the deadline is announced in front, in the background with focus: false, and a file preview takes the pane; each error names the tab. The fixture gives the pane a 300 ms deadline, so a run takes about 3.5 s
browser-pane-model.test.ts fails: the log call gets an object the unmapped-failure line holds the code and the action as text
errors.test.ts new rule each row of the table above, for the person and the agent
navigation-deadline.test.ts passes the default is still 15 s, to the millisecond

Limits

  • Release 2.3.2 loses tabs another way (Review pane browser tabs are deleted when the session detaches (session switch, compaction) #64734): a window that left a session closed its binding as client.closed, and main forgot the saved tabs. dev fixed that in feat(desktop): signed-in browser pane with extensions, previews, prompts and agent safeguards #63002: the window's close keeps them, and pane-machine.test.ts "only explicit deletion forgets the saved tabs" guards it. fix(browser): keep the pane's tabs when its window detaches #64742 targets the old code; on dev it would keep a deleted session's tabs.
  • "All tabs but one", as reported on 2.3.2, is not reproduced here. That build was not run.
  • The pictures are the component fixture's strip, fed what main reported in the Electron run on each head.
  • The [browser] unmapped failure [object Object] line in the owner's log of 21 Nov cannot be decoded: its fields were not written.
  • The agent's open of an address that fails to load is still undone, and its tab is drawn in the strip meanwhile as an unselected "New tab".

No feature flag: a fix.


Added by the opencode bot (AI-generated).

Related: #64734

Public API: Browser.experimental.open (experimental plugin SDK) now resolves with a handle when the tab's page is still loading or failed to load, and rejects only when no page opened (backwards compatible)

Sorry, something went wrong.

Uh oh!

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

All reactions
@Hona
fix(browser): keep the pane's tabs unless the person or the agent clo…
5fa5105
…ses them
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.

The rule itself makes sense: a tab whose page is still loading at the 15 s deadline stays, and a person's tab whose load Chromium failed stays and shows the error page. I checked it by reading the code and running errors.test.ts and tsc -b, both clean. I could not run the Electron test here (the sandbox lacks libnspr4.so), so the end-to-end behaviour is unverified.

Public API is unchanged. The only new outputs are two main-process log lines.

Concerns:

  • Plugin createTab: it runs tabs.open with origin "user", so a plugin's tab whose first load fails or runs past the deadline is now kept, but createTab still rejects. grant.settled() never runs, so the plugin gets no handle for a tab that now exists and cannot close it (see the inline comment).
  • Test cost: the Electron test brings a 222-line fixture with a stand-in server and waits out the real 15 s deadline on every run. Could the fixture inject a shorter deadline, or the still-loading row be covered by the keepsOpenedTab table plus a smaller pane-level test? That would keep it fast and less timing-sensitive on loaded runners.

Related: #64734

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread packages/gui-plugins/src/browser/pane.ts Resolved

Uh oh!

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

Hona added 2 commits November 21, 2026 12:26
@Hona
test(browser): give the pane its navigation deadline, so the open tes…
3bec430
…t waits 300 ms
@Hona
Merge remote-tracking branch 'origin/dev' into browser-tabs-vanish
9df113c
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.

The test-cost point is fixed: the pane takes a deadline input, and the Electron test runs with 300 ms and bounded polls instead of the real 15 s. Production keeps 15 s, and navigation-deadline.test.ts checks that. I ran navigation-deadline.test.ts and errors.test.ts (both pass) and tsc -b (clean). The Electron test still can't run in this sandbox.

Public API is unchanged. navigationDeadlineMs is an internal option of the built-in browser pane.

The open thread on plugin createTab is unchanged in code. The description now lists it under Limits: a plugin's tab kept after a slow or failed load still leaves the plugin with no handle to close it.

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 12:41
@Hona
fix(browser): a tab that is kept is held by its opener and shown as o…
b347259
…ne that loaded
@Hona
fix(browser): log an unmapped failure's code and action as text
5f60e20
@Hona
test(browser): wait for the state each open row compares
610c34e
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.

The open thread is fixed. A kept tab now goes through the same path as one that loaded, so it is refreshed, announced and shown as asked. A plugin's createTab resolves with a usable handle, and the agent's error names the kept tab. I checked this by reading the code. errors.test.ts and navigation-deadline.test.ts pass, as do the app's browser-pane-model.test.ts and tsc -b for gui-plugins. The Electron test still can't run in this sandbox.

Public API: the plugin SDK's experimental Browser.experimental.open now resolves with a handle when the tab's page is still loading or failed to load. Before, it rejected and the tab was removed. It now rejects only when the address opened no page. The TSDoc and the guide are updated. This is backwards compatible: callers that treated a rejection as "no tab" still get that.

Nothing new blocks this. The Electron fixture has grown to cover the person, plugin and agent rows. If it gets slow or flaky on CI, trimming it to the person and plugin rows would keep it focused.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Hona
Hona merged commit 3441156 into dev Nov 21, 2026
29 checks passed

Uh oh!

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

@Hona
Hona deleted the browser-tabs-vanish branch November 21, 2026 03:12
@kobzevvv kobzevvv mentioned this pull request Nov 24, 2026
chore(upstream): порт v2.4.1 — 67 в порт, 38 на решение gpt-mem/opencode-mem#223
Open
4 tasks
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.