Repository navigation
Description
Summary
Session cookies and authentication state are NOT persisted across OpenCode Desktop restarts in v2.2.0. The embedded browser's cookie store remains frozen at its initial state — no cookies, localStorage session data, or IndexedDB writes survive app restarts. This is the same bug as #50382, which was closed with upgrade to v2 advice, but the bug still exists in v2.2.0.
Environment
- opencode version: 2.2.0 (Desktop app); CLI: 1.18.35
- OS: Linux 6.12.113+deb13-amd64 (Debian 13 trixie)
- Shell: /bin/bash
- Install/channel: latest release (installed to /opt/OpenCode)
- Active plugins: /home/israel/.opencode/plugins/browser-persistente (V2 local)
- Config: ~/.config/opencode/opencode.jsonc (V2 format, key "plugins")
Reproduction
- Open OpenCode Desktop v2.2.0
- Use the built-in "Navegador" panel (browser pane) to visit any login-protected site (e.g., agensi.io, github.com)
- Complete login, confirm the page shows authenticated content
- Fully quit OpenCode Desktop (close app)
- Reopen OpenCode Desktop
- Navigate to the same site in the browser pane
Expected Behavior
The user should remain logged in. Session cookies should persist in the browser profile directory and the site should show the authenticated state.
Actual Behavior
The user is logged out. Every restart requires re-login. Evidence:
~/.config/ai.opencode.desktop/Cookiesfile is frozen at profile creation time (2026-09-04 in this case, 20480 bytes) — never written to during any session~/.config/ai.opencode.desktop/Partitions/ directory does not exist— ephemeral UUID partition is still being used (as described in#50382)- No
Cookies-walfile is ever created despite successful logins
This matches the exact pattern from #50382: Network/Cookies SQLite DB stays frozen at launch-time size, no WAL/journal activity.
Additional Context
#50382was closed by thdxr on Oct 11 sayingOpenCode 2.0 is now out— but the reporter (Tomflame-4ever) confirmed in a comment that the same bug reproduces on v2.0.12- Fix PR exists:
#53453by 4Liberty (merged Oct 5) — switches fromopencode-browser-${crypto.randomUUID()}ephemeral partition topartition: "persist:opencode-browser" - The PR description says:
Verified Electron session persistence: session cookies and Local Storage are successfully retained across app restarts in Partitions/opencode-browser - However, v2.2.0 (released Oct 27) still ships with the broken ephemeral partition behavior — the PR fix was not included in v2.2.0 release
- The
Partitions/directory is absent from the profile (confirmed on this machine) - Alternative workaround tested:
opencode-browser-plugin(Playwright withlaunchPersistentContextto~/.opencode/browser-profile) works for cookie persistence, but this is a separate browser instance, not the integrated pane
Impact: Every user who relies on the integrated browser pane for authenticated workflows (GitHub, Agensi, GitLab, etc.) loses all session state on every restart. This is a significant UX regression for a core feature.
Activity
opencodejr commentedon Oct 29, 2026
Thanks for the detailed report. We couldn't reproduce this in our automated environment because it can't run the OpenCode Desktop app, so a maintainer with the Desktop app will need to confirm it.
The code does point to a likely cause, though we haven't confirmed it by running the app. On both v2.2.0 and the latest
dev(1eea2d4), the built-in browser pane gets a new, temporary storage area each time it's set up, so cookies stay in memory and are lost when the app closes. That fits what you saw: theCookiesfile is never written and there's noPartitions/folder.One correction: #53453, the PR that would make the browser storage persistent, hasn't been merged yet. It's still open, which is why the fix isn't in v2.2.0.
Related:
kernelKain commentedon Nov 3, 2026
Still reproduces on v2.2.5 (Desktop)
Same symptom as the original report, on a current build. Confirmatory data point, not a new bug:
2.2.5), installed at/opt/OpenCode@tarquinen/opencode-dcp,opencode-mem, local./plugins/usage(none touch the browser)Repro: open a Google-authenticated console (OpenRouter / OpenCode Console / Kimi / Gemini) in the browser pane → sign in → quit the app → reopen → navigate back → signed out, and every one of those consoles asks for Google sign-in again.
Evidence:
~/.config/ai.opencode.desktop/Cookies— 20,480 bytes, 0 rows, mtime frozen at profile creation (2026-10-05). Still noPartitions/directory.The bundle confirms the cause is unfixed in 2.2.5.
resources/app.asarstill contains:No
persist:prefix, and the partition name is regenerated per browser connection, so the session is in-memory by construction. Same root cause the maintainer comment above describes.Control case on the same machine: Chrome's profile has 3,260 cookies including a valid
.google.comSID/SSID/SAPISID, so this is specific to the embedded browser, not expiring Google sessions.Blocker check: the fix PR #53453 (
opencode-browser-${crypto.randomUUID()}→persist:opencode-browser) is still open and currentlymergeStateStatus: DIRTY(last push 2026-10-10), so it hasn't landed between 2.2.0 and 2.2.5. That PR looks like the whole fix.One caveat worth testing after #53453 merges: Google's OAuth rejects embedded user agents in some flows (
disallowed_useragent), so a persistent partition may still not fully restore Gmail SSO inside the pane. That doesn't affect the general cookie-persistence bug, but it does affect whether "stay signed in to Google consoles" is fixable in-app or needs a real browser.