Skip to content

fix(browser): persist session storage across restarts, prevent tab unmount on navigation, increase tunnel connection limit - #53453

Open
4Liberty wants to merge 1 commit into
anomalyco:v2from
4Liberty:fix/browser-session-persistence
Open

4Liberty wants to merge 1 commit into
anomalyco:v2from
4Liberty:fix/browser-session-persistence

Conversation

@4Liberty

@4Liberty 4Liberty commented Oct 5, 2026

Copy link
Copy Markdown

Summary

This PR resolves three interconnected issues affecting OpenCode's embedded browser pane:

  1. Sessions/Cookies Wiped on Reload: The browser pane previously generated an ephemeral UUID partition (opencode-browser-${crypto.randomUUID()}), causing all cookies, logins, IndexedDB, and Local Storage to be discarded on app restart or pane re-attachment. By switching to partition: "persist:opencode-browser", Electron persists session cookies and authentication state across restarts in the application's persistent partition directory.
  2. Background Tabs Destroyed & Reloaded: Main frame navigation in the host window previously triggered navigate -> close(entry) -> page.dispose(), causing the browser pane to be destroyed and fully reloaded from scratch upon refocus. We retain lifecycle cleanup on actual window destruction while preventing spurious unmounts on internal window routing.
  3. Tunnel Bottleneck on Rich Assets: The RPC network proxy enforced an aggressive hard limit of 64 concurrent sockets (sockets.size >= 64), causing asset-rich pages to stall or throw 502 connection limit errors. We increase the connection ceiling to 512.

Verification

  • Verified Electron session persistence: session cookies and Local Storage are successfully retained across app restarts in Partitions/opencode-browser.
  • Tested page stability across backgrounding and navigation.
  • Verified asset loading concurrency under heavy network requests.

@github-actions github-actions Bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours. needs:issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant