Skip to content

feat(browser): add Dia source adapter with discovery identity - #124

Merged
mvanhorn merged 2 commits into
mainfrom
cursor/add-dia-browser-f149
Sep 13, 2026
Merged

mvanhorn merged 2 commits into
mainfrom
cursor/add-dia-browser-f149

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

Adds Dia (The Browser Company) as a Chromium-family source browser so source.yaml browser.name: dia reads ~/Library/Application Support/Dia/User Data/<profile>/Cookies with keychain account Dia / service Dia Safe Storage.

This supersedes #120 (fork alexknowshtml/agentcookie / add-dia-browser). We cannot push to that fork, so this is a fresh branch off latest main that keeps #120's registry intent and lands the two gaps that blocked it.

Fixes beyond #120

  1. Discovery identity. browserForRoot in internal/chromepaths/discover.go had no Dia case, so a discovered Dia User Data root was labeled chrome and key lookup used Chrome Safe Storage. Dia is classified by consecutive Dia/User Data path components (not a lone dia folder, and not the substring media) and Darwin chromeRoots scans Dia/User Data so extra-profile / cookies / doctor discovery actually finds it.
  2. Unsupported-browser fixtures. TestLoadSourceUnknownBrowserFailsWithSupportedNames (and the matching LookupBrowser / doctor tests) still used dia as the unsupported name. They now use vivaldi, which remains unsupported.

Verified

  • go build ./...
  • go vet ./internal/chrome ./internal/config ./internal/chromepaths ./internal/cli
  • go test ./internal/chrome ./internal/config ./internal/chromepaths ./internal/cli

Notes

  • Explicit config and discovery now share the same Dia keychain identity. Cookie decryption was verified on a real Dia install in feat(browser): add Dia browser support #120 (agentcookie source --once posted 1627 cookies); this PR adds the missing identity + test coverage on latest main.
  • Darwin extra-profile union (cookies command, sink adapter paste) will include Dia stores when Dia is installed and Dia Safe Storage is readable, matching Brave/Edge. Arc is still not in chromeRoots (pre-existing); this PR does not expand Arc discovery.
  • Custom Chrome roots under a directory or user named dia (via CHROME_USER_DATA_DIR / cdp.profile_dir) stay labeled Chrome.
  • No wire-format, blocklist, or on-disk config schema change. browser.name: dia is opt-in for agentcookie source.
  • Does not merge, comment on, or close feat(browser): add Dia browser support #120.
  • govulncheck fail is existing go1.26.4 stdlib debt (same as feat: fan out cookie and secret sync to multiple sinks #122 / main); not chased here.
Open in Web Open in Cursor 

Register Dia as a Chromium-family source browser (Arc User Data layout,
Dia Safe Storage). Classify discovered Dia roots as dia so key lookup
does not fall through to Chrome Safe Storage, and move unsupported-
browser fixtures off dia now that it is supported.

Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Sep 12, 2026

Copy link
Copy Markdown

Greptile Summary

Adds Dia as a Chromium-family source browser and aligns explicit configuration with browser discovery.

  • Registers Dia’s profile layout and macOS Safe Storage identity.
  • Discovers Dia profiles under its standard Darwin user-data directory.
  • Narrows Dia path classification and adds regression coverage for custom Chrome roots under a lone dia directory.
  • Updates configuration examples, tests, and release notes.

Confidence Score: 5/5

The PR appears safe to merge with no accepted new findings or outstanding previous findings.

The prior path-misclassification thread was manually resolved without explanation, so it is not outstanding and does not affect merge safety. No new actionable issue remains after excluding that duplicate edge case.

Important Files Changed

Filename Overview
internal/chromepaths/discover.go Adds Dia’s Darwin discovery root and narrows path-based identity detection to consecutive Dia/User Data components.
internal/chromepaths/discover_test.go Covers Dia discovery identity and regression cases involving unrelated paths containing dia.
internal/chrome/browser.go Registers Dia’s profile layout and Safe Storage credentials.
internal/config/config.go Enables source configuration to derive Dia’s default cookie database path.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Dia User Data root] --> B[Profile discovery]
    B --> C[Browser identity: dia]
    C --> D[Dia Safe Storage]
    D --> E[Decrypt discovered cookie stores]
Loading

Reviews (2): Last reviewed commit: "fix(chromepaths): require Dia/User Data ..." | Re-trigger Greptile

Comment thread internal/chromepaths/discover.go Outdated
A lone "dia" path component mislabeled custom Chrome roots under a
folder or user named dia, so key lookup requested Dia Safe Storage and
dropped the store. Match consecutive Dia/User Data components only.

Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
@mvanhorn
mvanhorn merged commit 57b53df into main Sep 13, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants