Uh oh!
There was an error while loading. Please reload this page.
feat(desktop): import browser cookies into a profile - #7255
feat(desktop): import browser cookies into a profile#7255juliusmarminge wants to merge 60 commits into
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Reviewed the new BrowserImport service, its Chromium cookie helper, and the IPC/layer wiring against the Effect service conventions.
Service shape, module layout (Context.Service tag + inline interface, make, layer), namespace imports, and layer composition in main.ts all look correct. The findings below are about the error model: the new failure type is unstructured (reason: Schema.String) and every construction discards the underlying cause, including one that erases a structured BrowserSession error.
Posted via Macroscope — Effect Service Conventions
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
There was a problem hiding this comment.
UI Consistency
One finding in the changed browser-profiles UI (apps/web/src/components/settings/IntegrationsSettings.tsx).
The menu/primitive usage itself looks consistent with the shared system: Menu/MenuPopup/MenuItem/MenuSub from components/ui/menu, MenuTrigger render={<Button …/>} matching the existing pattern in PreviewMoreMenu/ProjectScriptsControl, existing size="icon-sm" / variant="ghost-muted" Button variants, min-w-* on popups honouring MenuPopup's width-defaulting contract, and the bordered list container matching the convention already used in ConnectionsSettings. aria-labels are preserved on both the rename input and the new row trigger.
The issue is a state-display regression introduced by removing the default-profile Select while filtering Incognito out of the new list: a stored default of incognito (which the removed Select allowed a user to pick) now leaves the section with no "Default" badge on any row.
Posted via Macroscope — UI Consistency
Uh oh!
There was an error while loading. Please reload this page.
757f025 to
5853095CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new desktop workflow that reads and decrypts browser authentication cookies through the OS keychain, then writes them into Electron profiles, along with native packaging and settings changes. The sensitive-data scope and unresolved runtime/UI risks warrant human review. Not approved because:
No code changes detected at Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
5853095 to
23b22b9CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Reviewed the new BrowserImport service, its Sources/ChromiumCookies helpers, the IPC method, and the layer wiring against the Effect service conventions. The service module follows the canonical shape (errors → Context.Service with inline interface → make → layer), dependencies are acquired from the environment, and the failure translations now keep a real cause. One remaining gap on error context.
Posted via Macroscope — Effect Service Conventions
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
UI Consistency — 1 finding
The two issues flagged on earlier commits are addressed: loadSources now clears sources before each refresh, and resolvedDefaultId resolves against the rendered rows.
One consistency gap remains: with BrowserDefaultProfileSetting removed and Incognito no longer rendered as a row, the section can badge Default on a profile that is not the effective default (see inline comment).
Minor (not blocking): lines 507–529 now carry three consecutive doc comments for a single component — the "Create, rename, and remove browser profiles" and "Per-profile cookie import" blocks are leftovers from the removed/renamed pieces and could be folded into one.
Posted via Macroscope — UI Consistency
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Two findings in the reworked browser-profiles section. Both are about the settings UI now disagreeing with the runtime behaviour it configures, rather than styling.
Posted via Macroscope — UI Consistency
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
57fccc1 to
ea2efcbCompareUh oh!
There was an error while loading. Please reload this page.
3264ff7 to
76fc9d2CompareTwo review findings: the import menu only hid uninstalled sources, so a platform that can never import from a browser (a macOS-only fork on Linux) still listed it and clicking led to a dead-end blocked screen — those are now left out too. And the "Default profile" search entry lost the word "browser" when its settings row went away, which broke the "default browser profile" query and read ambiguously beside its siblings; the search-only title says "Default browser profile" again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…key retry Three review findings on the import flow: - Profile discovery accepted any entry named `Cookies`, so a directory listed as an importable profile and then failed the SQLite open; the fallback scan and the installed check now require a regular file. - A "new profile" target chosen before the profile cap was reached could still be imported once it was, creating a profile past the limit; the Import button now disables in that case. - `keychainItemMissing` told the user to sign in and retry but offered no retry — it is now retryable, since signing in is exactly what creates the key. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
b4a5e28 to
d22663dCompare| const targetMissing = | ||
| target.kind === "existing" && | ||
| !targetProfiles.some((profile) => profile.id === target.profileId); | ||
| const targetFeedback = | ||
| targetError ?? | ||
| (targetMissing | ||
| ? "That profile is no longer available. Choose where to import these cookies." | ||
| : undefined); |
There was a problem hiding this comment.
The new cap guard on the Import button (target.kind === "new" && !canCreateProfile) has no matching feedback, so it lands the user in a dead end: once canCreateProfile flips false the New profile tile is unrendered (line 270), nothing in Into looks selected, and Import is disabled with nothing said. The structurally identical case one line up — an existing target that disappeared — already renders targetFeedback telling the user to choose again, so the two now behave differently for the same problem.
Consider routing the cap case through the same message slot (and reusing targetUncreatable in the disabled expression below, so the condition isn't stated twice).
| consttargetMissing= | |
| target.kind==="existing"&& | |
| !targetProfiles.some((profile)=>profile.id===target.profileId); | |
| consttargetFeedback= | |
| targetError?? | |
| (targetMissing | |
| ? "That profile is no longer available. Choose where to import these cookies." | |
| : undefined); | |
| consttargetMissing= | |
| target.kind==="existing"&& | |
| !targetProfiles.some((profile)=>profile.id===target.profileId); | |
| // The "New profile" tile is unrendered once the cap is reached, so a target | |
| // chosen before that leaves nothing selected in "Into". | |
| consttargetUncreatable=target.kind==="new"&&!canCreateProfile; | |
| consttargetFeedback= | |
| targetError?? | |
| (targetMissing | |
| ? "That profile is no longer available. Choose where to import these cookies." | |
| : targetUncreatable | |
| ? "You've reached the profile limit. Choose an existing profile to import into." | |
| : undefined); |
Posted via Macroscope — UI Consistency
Stacked on #7272 (
shared-sqlite-client).Imports cookies from Helium on macOS into a T3 Code browser profile. Saved passwords and browsing history remain out of scope.
The app requests the browser key through the in-process Keychain API, so consent belongs to T3 Code. Denial stops the import; there is no permission bypass. Source databases are opened read-only and snapshotted consistently with SQLite before extraction.
The wizard chooses a source and destination, prevents profile edits during an import, and reports imported/skipped counts and affected sites. Plaintext and encrypted cookie records are handled separately; domain-bound records are validated. Partitioned cookies are skipped when their partition semantics cannot be preserved by Electron.
Validation includes synthetic decryption records, plaintext and legacy records, domain-binding failures, partitioned-cookie rejection, WAL snapshot consistency, interrupted writes, and wizard state transitions, plus scoped typechecks/lint. Earlier Helium imports were verified in the desktop app; this audit did not request another live Keychain read.
Original implementation: Claude Code. Review fixes: GPT-5.6 Sol agents, coordinated through Codex.
Note
Add
BrowserImportservice and wizard to import browser cookiesBrowserImportservice and IPC handlers to read, decrypt, and write Chromium cookies into a target profile partitionBrowserImportWizardUI to guide users through source and target selection, showing quit, blocked, and success screens@napi-rs/keyringdependency and build staging to package native keychain binaries for desktop artifactspersistClientSettingsUpdatenow delays in-memory snapshot publication until persistence completes and rejects on failure; optimistic patches made during an awaited update are reappliedMacroscope summarized d22663d.
Note
High Risk
Reads third-party cookie databases and macOS Keychain secrets and writes session cookies into app partitions; correctness and hardening (path validation, partition alignment) directly affect auth/session security.
Overview
Adds browser cookie import from installed Chromium-family browsers (initially Helium on macOS) into T3 Code preview profiles. The desktop main process gains a
BrowserImportservice that lists sources, blocks import while the source browser is running, validates profile paths against traversal, reads cookies via a consistent SQLite snapshot and in-process Keychain access (@napi-rs/keyring), then writes into the same Electron partition the preview webview uses. New IPC/preload endpoints exposelistBrowserImportSourcesandimportBrowserCookies; contracts define sources, failure reasons, and results.The Integrations browser profiles UI is reworked: Add profile opens a menu for a blank profile or Import from a detected browser, with a multi-step
BrowserImportWizard(quit browser, pick source/target, progress, skipped domains). Default profile moves into per-profile row actions; the standalone default-profile setting row is removed. New profiles are persisted only after a successful import with cookies, using a newpersistClientSettingsUpdatequeue so registration does not race other settings writes.Desktop release builds stage
@napi-rs/keyringnative binaries like existing passkey addons. Extensive unit tests cover decryption edge cases, lock detection, and wizard logic.Reviewed by Cursor Bugbot for commit d22663d. Bugbot is set up for automated code reviews on this repo. Configure here.