GeezerVison is showing github.com — feat(browser): import a cookie file from Settings > Browser by Hona · Pull Request #415 · anomalyco/opencode-rune
Conversation
Hona
commented
Nov 21, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Adds "Import cookie file" to Settings > Browser > Advanced, using WS-1's #286 cookie store. It matches official anomalyco/opencode at b9a60d9d078d87bfb90f039e431090508f88ac02.
Official reference (b9a60d9d078d87bfb90f039e431090508f88ac02)
- The row,
settings.tsx:230-255:
- Its second card in Advanced, with title
settings.import.file.title and description settings.import.file.description.
- A
Choose file button that shows busy while the import runs.
- When an import finishes, its outcome replaces the description, in red if it failed.
- The file picker,
settings.tsx:56-61: titled settings.import.file.pick and limited to txt and json files.
- Reading the file,
profile/index.ts:503-516 (importFile): files over 32 MiB are refused; a file that cannot be read gives read; a file that does not parse gives format.
- Outcome messages,
jobs.ts:186-276:
- Failures:
signins.failed.read.file, signins.failed.format, signins.failed.storage.
- Some cookies lost:
signins.imported.incomplete (count plus the number skipped).
- Otherwise:
signins.imported (count).
- No answer from the app:
settings.failed.import.
- Time limit,
jobs-machine.ts:87: the import fails after 60 s without an answer.
Changes
apps/desktop/src/surfaces/browser/cookie_import.rs (new):
- The app shows the OS file picker itself, so a plugin never supplies a path.
- feat(browser): enable real OS cookie encryption, CefCookieManager, remote cookie mirror, and Rust cookie importer #286's
read_cookie_file reads and checks the file: regular files only, at most 32 MiB, Netscape cookies.txt, Chrome JSON or Playwright storage state. feat(browser): enable real OS cookie encryption, CefCookieManager, remote cookie mirror, and Rust cookie importer #286 owns the parser.
- If the engine is idle, it is started, and the cookies go in through
BrowserHost::import_profile_cookies once the engine's cookie store is up.
- One import at a time; it fails after 60 s without an answer. The engine's results are routed back here (
pump_cookie_import drains take_profile_events).
Browser:ImportCookieFileAsync(title): only the built-in browser plugin can call it. MCP tools and other plugins get browser.cookies.denied.
- Settings: the row with official's messages and busy state. Now that both the remote-sign-ins and cookie-file rows exist, the Advanced summary shows official's full text.
- Strings: 9 English keys with official's names and text.
Not in this PR
Round 2 (READER-12 read 3, notes/review-rd294.md #415 items 1-5): head 3bc4a37
- Cookie host validated (critical):
valid_cookie_host accepts only a plain hostname (alphanumerics, -, _; labels at most 63; at most 253 in all) or an IPv4/IPv6 literal, with at most one leading dot. It refuses @, ?, #, %, ports, stray :, controls and spaces.
- It runs in two places:
prepare_for_import (crates/browser-pane/src/cookies/format.rs), where an invalid host counts as skipped as official's cookieDetails would, and the engine's to_cef_cookie, which every write goes through.
- The engine then parses the cookie's URL with
url and requires no user info, no password, no port, and the same host.
- Large files (critical):
- The file is read and parsed on a worker thread.
- The JSON shape is chosen by its first byte (
[ or {) instead of an untagged enum, so the text is parsed once.
- Cookies go to the engine in batches of at most 1,000 cookies or about 2 MiB, one wire line each.
- The 60 s limit restarts at every answered batch. The import fails at once if the engine goes away.
- Caller guard and picker title:
require_settings_caller requires in_flight.is_empty() (merged from dev). The picker title is cut to 200 characters with control characters removed.
- Other callers' engine answers are kept: the import takes only its own
CookiesImported answers, through a new BrowserHost::take_profile_events_matching. Every other profile event stays queued for whoever asked for it.
prepare_for_import is now called: expired, nameless or invalid-host cookies count as skipped, not failed.
Store limits (parity): official's writeCookies (profile/import.ts:10-38 at db2d889c) writes every cookie with no per-site cap and no warning, and Chromium evicts past its own limits. Ours does the same; recorded in ours.md.
Proof (proof/previews/cookie-file/import-after.json, scratch engine profile):
- Hostile hosts:
[email protected] (as a __Host- cookie), github.com?x=…, github.com#…, github.com:8443, github%2ecom and 0x7f.1 were all refused: imported 0, failed 6, and no cookie exists on any github host.
- Valid hosts:
.example.test, app.example.test and [::1] were imported (3).
- Large import: 60,000 cookies (13.2 MB of cookie text) went in 60 lines, the largest 337 KB, far under the engine's 32 MiB line cap. All 60,000 were imported, 0 failed, in 54 s.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
# Conflicts:
# apps/desktop/src/plugin_host/native/browser.rs
# apps/desktop/src/surfaces/browser/mod.rs
…em off the UI thread (READER-12 #415)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ng (READER-12 #415 follow-up)
Hona
added a commit
that referenced
this pull request
Nov 21, 2026
… pane (#550)
* feat(browser): import a cookie file from Settings > Browser
* fix(browser): validate cookie hosts, batch file imports, and parse them off the UI thread (READER-12 #415)
* feat(browser): offer sign-ins and history from another browser on the pane, as official's SignInOffer
* fix(browser): the sign-in bar shows only over a page with an address; the new tab page has the card
* fix(browser): list other browsers off the UI thread so the pane's sign-in offer never stalls a draw
* fix(browser): keep the browsers' listing beside the icons so surfaces/browser/mod.rs stays under 800 lines
|
Smoke after merge (FLEET.md:156, missed before the merge): #550's PR CI build 6e85ed3 contains this PR; tools/smoke.ps1 9/9 (plugins load, settings 14/14 incl. browser, browser tab loads, clean quit). Lines on #550.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Hona
added a commit
that referenced
this pull request
Nov 21, 2026
…og (#611)
* feat(browser): import a cookie file from Settings > Browser
* fix(browser): validate cookie hosts, batch file imports, and parse them off the UI thread (READER-12 #415)
* feat(browser): offer sign-ins and history from another browser on the pane, as official's SignInOffer
* fix(browser): the sign-in bar shows only over a page with an address; the new tab page has the card
* fix(browser): list other browsers off the UI thread so the pane's sign-in offer never stalls a draw
* feat(plugins): ui.checkbox, Desktop's compact checkbox with its label (contract 1.7)
* feat(browser): Sign-ins and Browsing history boxes in the import dialog, as official's
* fix(browser): keep the browsers' listing beside the icons so surfaces/browser/mod.rs stays under 800 lines
* fix(browser): history comes only after sign-ins that did not fail, and never fails an import (official main.ts:285-296)
* fix(browser): the import dialog takes official's frame: header with its close button, body 16 in, footer buttons
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|