Skip to content

fix(desktop): detect Chromium profiles for Linux cookie import - #25698

Open
ScaleLeanChris wants to merge 2 commits into
pingdotgg:mainfrom
ScaleLeanChris:fix/linux-chromium-browser-import
Open

ScaleLeanChris wants to merge 2 commits into
pingdotgg:mainfrom
ScaleLeanChris:fix/linux-chromium-browser-import

Conversation

@ScaleLeanChris

Copy link
Copy Markdown

Linux Chromium users can reach Settings → Browser → Browser profiles → Add profile and see “No supported browsers found” despite having a populated ~/.config/chromium/Default/Cookies. The existing Linux Chromium reader supports this database, but Chromium itself is absent from the source registry and shared source-ID contract.

Register Chromium on Linux using its standard profile directory and chromium Secret Service application name. This reuses the existing discovery, running-browser checks, decryption, and import flow. Other platforms and nonstandard profile directories are outside this fix.

This is a small, focused omission in the established Linux Chromium cookie-import capability: Chrome and Helium already use the same reader. No new import workflow, setting, or encryption implementation is introduced.

Validation:

  • Reproduced on Linux with T3 Code 0.1.3-nightly.20261026.3726: Chromium is installed, its Local State declares Default, and Default/Cookies exists, but the installed source registry omits Chromium.

  • Added a parameterized regression test for Cookies and Network/Cookies. Both cases fail on the base commit because the source is missing, then pass with this fix. They check source discovery, shared-schema decoding, encrypted-cookie import, host-only scope, and flushing the target store.

  • vp test run apps/desktop/src/preview/BrowserImport/BrowserImport.test.ts apps/desktop/src/preview/BrowserImport/Sources.test.ts apps/desktop/src/preview/BrowserImport/ChromiumCookies.test.ts apps/desktop/src/preview/BrowserImport/ChromiumKeys.test.ts: 54 passed.

  • vp run check:changed: formatting, lint, both knip passes, affected-package/dependent typechecks, and neighboring tests pass.

  • Ran the changed importer in Electron 44.9.3 with an isolated temporary home and a synthetic encrypted Chromium database, writing to a real Electron cookie session:

    DETECTED {"id":"chromium","name":"Chromium","profiles":[{"directory":"Default","name":"Runtime fixture","cookieCount":1}]}
    IMPORTED {"imported":1,"skipped":0,"skippedDomains":[]}
    VERIFIED real Electron session: 1 decrypted cookie; hostOnly=true; secure=true; httpOnly=true
    

The runtime smoke check uses basic-storage v10 fixture encryption. A live Chromium Secret Service/v11 session and the import wizard UI were not exercised. Personal session cookies were not imported.

Implemented with GPT-6.1 Sol through the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 26, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — The production changes add Linux Chromium to the default cookie-import registry, extending existing sensitive browser-cookie handling to a newly exposed source. The test addition also introduces a file-level static-analysis suppression, so the change warrants human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0839aab and f9d1298.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d73fd12 and 0839aab.

Files selected for processing: 3
  • apps/desktop/src/preview/BrowserImport/BrowserImport.test.ts
  • apps/desktop/src/preview/BrowserImport/Sources.ts
  • packages/contracts/src/browserImport.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Adds Linux Chromium as a browser import source and includes a test for discovering Chromium profiles and importing cookies from supported database paths.

Changes: Linux Chromium import

Layer / File(s) Summary
Register the Chromium source
packages/contracts/src/browserImport.ts, apps/desktop/src/preview/BrowserImport/Sources.ts
Adds chromium to the browser import source IDs and defines its Linux-only user-data directory and secret application name.
Validate Chromium cookie import
apps/desktop/src/preview/BrowserImport/BrowserImport.test.ts
Adds a test for both supported cookie database paths. It checks source discovery, profile metadata, the imported cookie value and fields, import counts, and store flushing.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: bugfix, size:S

Suggested reviewers: t3dotgg

Merge Risk: Minimal · previous review 0839a

Chromium profile discovery and cookie import appear ready to merge after normal checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Description check Passed The description covers the problem, change, scope rationale, verification results, limitations, and implementation details. It explains why no issue or maintainer approval link is included for this fo…
Title check Passed The title clearly and concisely describes the main change: detecting Chromium profiles for Linux cookie import.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description covers the problem, change, scope rationale, verification results, limitations, and implementation details. It explains why no issue or maintainer approval link is included for this focused omission.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

thanks @ScaleLeanChris. the linux-only registry entry and shared source id correctly reuse the existing discovery, keyring, and cookie importer. i preserved your commit and merged current main without rebasing. no production or test code needed changing: the fix remains 12 production lines, with both supported cookie paths covered in the existing test file.

verification at f9d12987216100050179837b164245e47a391365:

  • reproduced both discovery failures using main's production files, then restored the fix: all 54 focused importer/source/key tests passed through blacksmith.
  • vp run check:changed passed through blacksmith: format, lint, both knip passes, affected typechecks, and neighboring tests.
  • ran the importer in electron 44.10.0 with an isolated encrypted v10 fixture and a real electron cookie session: chromium discovered, one cookie imported, decrypted value and host-only/secure/httponly attributes verified.
  • two independent read-only reviews approved this exact head without findings.

unverified: the desktop import wizard, before/after ui captures, and a live secret service/v11 keyring import. the web dev server has no electron ipc bridge, so a chrome-only screenshot would not prove this desktop flow.

upstream workflows, including ci, are stopped at action_required pending human approval. macroscope also requires human review of the added cookie source. no labels were changed manually, and this pr remains open for maria's review.

maria-rcks commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head f9d12987216100050179837b164245e47a391365 on this linux boat vm.

  • reproduced on github/main at 6575ce3250 in a separate worktree after vp i: settings → browser → add profile showed "no supported browsers found" despite a populated standard chromium profile.
  • installed the exact pr head and ran the real dev app. drove the web app with repo playwright and /usr/bin/google-chrome, and the desktop client through playwright cdp. the desktop's normal local backend was the sole backend during import; its renderer used the web dev server.
  • created an http-only persistent session by navigating a real chromium browser to a small running git application. no synthetic cookie database, mocked importer, or fixture cookies. the source was ~/.config/chromium/Default/Cookies, using chromium's basic-storage v10 encryption.
  • the pr listed chromium. importing while chromium was open stayed blocked; closing chromium and continuing reached the source/target picker. importing into a new profile reported "imported 3 cookies".
  • created the project and thread through the app and ran codex gpt-6.1-sol through the local proxy. its real browser tools read "session recognized" in chromium and "no session" in default. i opened and inspected both pages in the desktop browser panel myself. the imported cookie retained host-only scope, http-only, and same-site lax; default had no journal cookie.
  • blacksmith: all 54 focused importer/source/key tests passed. vp run check:changed passed format, lint, both knip passes, 32-package typechecks, and neighboring tests. the worker needed base history fetched first. all reported pr checks are passing or skipped.

before, main:

main: chromium is absent from the import menu

after, exact pr head, matching browser data:

pr: chromium appears in the import menu

running-browser guard, source/target selection, and successful import. idle pauses are shortened; this is not a timing measurement:

desktop chromium import interaction

actual imported profile making an authenticated request:

imported chromium profile recognizes the browser journal session

neighboring default profile remains isolated:

default profile has no browser journal session

short runtime transcript:

main: no supported browsers found
pr: chromium discovered; running-browser guard enforced
pr: imported 3 cookies into a new chromium profile
client-created thread: codex / gpt-6.1-sol
provider turn: completed, 2026-10-30T15:24:48Z → 15:25:16Z
imported chromium: session recognized
default: no session
imported journal cookie: host=127.0.0.1, HttpOnly=1, SameSite=Lax
uploaded recording: 1280x900, 11.708s; played to end; seeks to 6s and 10s passed

Not verified

live chromium secret-service/v11 encryption, a real Network/Cookies source database (covered by the focused tests), other browser imports, native mobile, macos, windows, remote relay/tunnel, or external account logins. the verified session was issued by the real local application. hidden agent screenshot captures were black before opening the panel; the evidence above uses inspected visible desktop captures. no source changes or pushes were needed.

media note: git.cafe renders these external uploads as links. i reopened the comment and checked that behavior; the image files and app-browser video playback were verified directly.

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

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants