Skip to content

Clear Google cookies from a browser profile, as often as you need - #34158

Merged
brennanb2025 merged 27 commits into
mainfrom
brennanb2025/sta-4398-google-cookie-clear-2
Oct 28, 2026
Merged

brennanb2025 merged 27 commits into
mainfrom
brennanb2025/sta-4398-google-cookie-clear-2

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1413 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1409
Prod 44 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​768 $\color{#cf222e}{\Huge{\mathbf{−}}}$​54 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​714

Google sign-in can get stuck on an old account in Orca, and importing browser cookies does not replace that sign-in. This adds one “Google Cookies” section at the bottom of Settings → Browser → Session & Cookies. Its “Clear Google cookies…” button asks for confirmation, then clears Google cookies from the Active profile on the selected Host. Other sites stay signed in.

Before: Settings has no repeatable Google-only clear. After: one button below the Host/profile controls explains why Google sign-ins are not imported and offers a Google-only reset. Import menus, the Browser Use cookie step and the import warning retain the existing Google notice without a clear action.

The Host, profile and pairing are frozen when the button is pressed. A changed pairing, retired route or replaced executor refuses the stale action rather than switching jars. It never falls back to clearing all cookies. Unsupported remote hosts show a disabled button with a short reason; existing profile invalidations refresh availability when routes change. No new saved setting or wire field. The legacy staged-image replay protection from #34113 is included.

Intended differences from the common pattern: Google-only deletion, confirmation for each clear, selected Host’s Active profile and mixed-version capability/ownership checks follow the approved product rulings.

UI

Dark theme, one Default/Active profile: Google Cookies below the profile controls, with added space, a why-first caption and the red action on the right:

google-cookies-row-dark.png

Confirmation names the profile and explains the Google-only sign-out:

google-cookies-confirm-dark.png

Browser Use’s Import menu keeps the existing note and has no clear action:

browser-use-import-menu.png

Settings profile’s Import menu also keeps its original note without a clear action:

profile-import-menu.png

Earlier functional run, before the presentation update — clear result: screenshot

Earlier functional run — empty repeat: screenshot

Validation

  • Full-path correctness, consumer, architecture, performance and readiness reviews completed. Continued review accepted the localized-search repair: both search filters use the existing translated aliases, with one real Chinese-catalog child-filter assertion. The owner reports the named renderer suite passed all 13 tests and the normal pre-commit hook passed.
  • Targeted M4Air run on f67d63c: section/confirmation, Cancel, selective clear in the actual Active profile, empty repeat, and Settings/Browser Use menu placement verified. Cancel preserved both synthetic cookies. Clear removed the Google cookie; the other-site cookie retained every metadata field. Repeat showed “No Google cookies to clear in Default.”
  • The later efdc2aa commit changes only Settings search metadata and its localized assertion; review accepts tests-row QA carry. Deletion behavior is unchanged; the later presentation update has fresh screenshots.
  • The unchanged real-Electron restart fixture retains its passing CI and targeted native evidence, including legacy staged-image refusal after graceful restart. Opaque partition-key seeding remains unverified.
  • Evidence limitation: extra toast DOM-bracket files were not retained. Actual full-window result screenshots, semantic locator waits and full-metadata cookie comparisons are retained and independently reviewed; no snapshots were reconstructed.
  • The final UI head 8591c69 includes the permitted conflict refresh. The single runtime-status import conflict preserves main’s new migration helper and the Google capability filter. The prescribed merge hook passed. A second clean merge incorporates main’s fix(main): drop stray tr.json keys and split runtime-file-read-client under max-lines #34929 repair for an unrelated CI max-lines failure; the Google UI and clearing code are unchanged. Final-head CI passed via one gh pr checks 34158 --watch --fail-fast --interval 60 on8591c69c9669a12bd7474fb9844dc075bc8ae100 (workflow); the watch exited0, including static analysis/typecheck and all five Node test shards.

Tracked in STA-4398.

The Google Cookies presentation update was accepted by continued correctness/consumer review: both English and localized search aliases remain intact, the unavailable reason stays under the caption and the existing confirmation/target behavior is preserved. The owner reports the named section suite passed13/13 and its normal hook passed. Fresh dark-theme row/confirmation screenshots are on 8591c69; prior selective-clear/repeat and restart evidence carries because those operations are unchanged.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 27, 2026 00:31
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

The change adds Google-cookie clearing for local browser profiles and remote runtime profiles. It adds target validation, cookie-removal outcomes, IPC and RPC routes, and capability reporting. Successful imports can carry local or remote clear-target data. The renderer adds confirmation-backed actions to import warnings and profile menus. Tests cover target provenance, clearing behavior, runtime capability forwarding, and Electron persistence across restart.

Priority: Normal

Merge Risk: Moderate · previous review 393da

Google cookies can return after a reported clear when an older import stage is pending, and the restart test can fail in CI. Fix the staged-image handling before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description is substantive and follows much of the template. It has an ELI5-style opening paragraph, a What Changed section (Before/After and the mechanism: frozen Host, profile and pairing, refus… 1. Replace the placeholder-style 'Fixes #' line with a real linked GitHub issue, or explain the issue link. STA-4398 is not a GitHub issue link. 2. Add a clear explanation of why this approach was chosen over alternatives in the Why section…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: repeatedly clearing Google cookies from a browser profile.
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 is substantive and follows much of the template. It has an ELI5-style opening paragraph, a What Changed section (Before/After and the mechanism: frozen Host, profile and pairing, refusal of stale actions, no whole-jar fallback), a Why section (Google-only deletion, confirmation, mixed-version handling), a Validation section with QA evidence, and UI screenshots. Several template sections are missing or incomplete. The 'Why' section does not explain why this approach beats the alternatives. The 'Linked Issue' section has no 'Fixes #' issue reference; only 'Tracked in STA-4398' appears, which is not a GitHub issue link. The 'Testing' checklist items are not ticked, and the testing platforms are not stated in a template-conformant form (macOS is mentioned via M4Air, but Linux, Windows and SSH are not addressed). The 'AI Disclosure' section is empty. The 'Review' and 'Agent skill upstream boundary' sections are missing; the upstream-boundary checkbox is not ticked. The 'Notes' section, which asks for security, cross-platform, SSH, mobile, backwards-compatibility and performance review, is not explicitly addressed, though the Validation section mentions performance and architecture reviews. The Checklist is not ticked. The description also states that QA reported failure and that the PR is not ready, and CI status is contradictory: the Validation section says final-head CI passed, while the PR objectives say current aggregate CI had not passed. This conflict should be resolved before merge. The description is also dense and hard to read in places, with repeated commit references.

Resolution

  1. Replace the placeholder-style 'Fixes #' line with a real linked GitHub issue, or explain the issue link. STA-4398 is not a GitHub issue link. 2. Add a clear explanation of why this approach was chosen over alternatives in the Why section. 3. Complete the Testing section: state which platforms were tested (macOS, Linux, Windows, SSH), list reviewer steps, and tick the applicable checkboxes. 4. Fill in the AI Disclosure section, or state that it does not apply. 5. Address the Review and Agent skill upstream boundary sections, and tick the upstream-boundary checkbox or explain why it applies. 6. Address the Notes items explicitly: security, cross-platform, remote SSH, mobile, backwards compatibility and performance. 7. Complete the Checklist, or state which items are pending. 8. Resolve the conflicting CI status between the Validation section and the PR objectives, and state the final CI result for the head commit clearly. 9. Consider reducing the commit-hash-heavy validation text so the reviewer can find the key evidence quickly.
Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce193ec2-e59a-4432-b9f5-18a063a8bde6
Commits

Reviewing files that changed from the base of the PR and between acf1a8c and c0ed96e.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 34
  • config/scripts/ci-unit-files.mjs
  • src/main/browser/browser-client-route-cookie-import.ts
  • src/main/browser/browser-google-cookie-clear-target.test.ts
  • src/main/browser/browser-google-cookie-clear-target.ts
  • src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts
  • src/main/browser/cookies/browser-google-cookie-clear.test.ts
  • src/main/browser/cookies/browser-google-cookie-clear.ts
  • src/main/ipc/browser-google-cookie-clear-ipc.ts
  • src/main/ipc/browser-session-profile-ipc.test.ts
  • src/main/ipc/browser-session-profile-ipc.ts
  • src/main/orcad/electron-sidecar-method-routing.ts
  • src/main/runtime/browser/browser-commands.ts
  • src/main/runtime/browser/browser-profiles.ts
  • src/main/runtime/rpc/methods/browser-profile-rpc-methods.ts
  • src/main/runtime/runtime-edge-command-controller.ts
  • src/preload/api/browser-api.ts
  • src/preload/api/browser-bridge-page-interaction-and-sessions.ts
  • src/renderer/src/components/BrowserCookieImportDisclosure.tsx
  • src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserImportHintButton.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserToolbarMenu.tsx
  • src/renderer/src/components/settings/BrowserProfileRow.google-cookie-clear.test.tsx
  • src/renderer/src/components/settings/BrowserProfileRow.tsx
  • src/renderer/src/components/settings/BrowserUseCookieImportStep.tsx
  • src/renderer/src/components/settings/BrowserUsePane.test.tsx
  • src/renderer/src/components/use-google-cookie-clear.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/browser-cookie-import-toast.test.ts
  • src/renderer/src/lib/browser-cookie-import-toast.ts
  • src/renderer/src/lib/browser-google-cookie-clear.test.ts
  • src/renderer/src/lib/browser-google-cookie-clear.ts
  • src/renderer/src/web/preload-api/web-browser-api.ts
  • src/shared/browser-google-cookie-clear.ts
  • src/shared/browser-runtime-capabilities.ts

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

Comment thread config/scripts/ci-unit-files.mjs Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9408a6c9-253d-409c-828a-7d41cc182d2a
Commits

Reviewing files that changed from the base of the PR and between c0ed96e and 87c2a9d.

Files ignored due to path filters: 1
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 43
  • .github/workflows/pr.yml
  • config/scripts/pr-package-test-paths.mjs
  • src/main/browser/browser-client-route-cookie-import.ts
  • src/main/browser/browser-google-cookie-clear-target.test.ts
  • src/main/browser/browser-google-cookie-clear-target.ts
  • src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts
  • src/main/browser/cookies/browser-google-cookie-clear.ts
  • src/main/host/electron-browser-commands.ts
  • src/main/ipc/browser-session-profile-ipc.ts
  • src/main/orcad/__fixtures__/fake-orcad-electron-sidecar.cjs
  • src/main/orcad/electron-serve-browser-process.test.ts
  • src/main/orcad/electron-serve-browser-process.ts
  • src/main/orcad/external-chromium-browser-process.integration.test.ts
  • src/main/orcad/orcad-browser-provider.test.ts
  • src/main/orcad/orcad-browser-provider.ts
  • src/main/orcad/orcad-browser-startup.ts
  • src/main/runtime/browser/browser-command-contracts.ts
  • src/main/runtime/browser/browser-profile-rpc-test-fixture.ts
  • src/main/runtime/browser/browser-profiles-client-placement.test.ts
  • src/main/runtime/browser/browser-profiles.ts
  • src/main/runtime/orca-runtime-get-status.ts
  • src/main/runtime/orca-runtime-tests/browser-capabilities.spec.ts
  • src/main/runtime/rpc/methods/browser-profile-rpc-methods.ts
  • src/main/runtime/runtime-browser-commands-factory.ts
  • src/main/runtime/terminal/driver/terminal-driver-resources.ts
  • src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserImportHintButton.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserToolbarMenu.tsx
  • src/renderer/src/components/settings/BrowserProfileRow.google-cookie-clear.test.tsx
  • src/renderer/src/components/settings/BrowserProfileRow.tsx
  • src/renderer/src/components/settings/BrowserUseCookieImportStep.tsx
  • src/renderer/src/components/settings/BrowserUsePane.test.tsx
  • src/renderer/src/components/use-google-cookie-clear.ts
  • src/renderer/src/lib/browser-cookie-import-toast.ts
  • src/renderer/src/lib/browser-google-cookie-clear.ts
  • src/renderer/src/runtime/runtime-compatibility-test-fixture.ts
  • src/renderer/src/store/slices/browser/browser-cookie-import-actions.ts
  • src/renderer/src/store/slices/browser/browser-profile-list-actions.ts
  • src/renderer/src/store/slices/browser/browser-slice-contract.ts
  • src/shared/browser-google-cookie-clear.ts
  • src/shared/browser-workspace-types.ts
  • src/shared/rpc-contract/browser-params.ts
  • src/shared/runtime-browser-contracts.ts

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Major · Clearing Google cookies leaves a pending legacy staged… · browser-google-cookie-clear.ts:49-52

src/main/browser/cookies/browser-google-cookie-clear.ts:49-52
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Clearing Google cookies leaves a pending legacy staged image unchanged, so cleared cookies return on restart.

clearGoogleCookiesFromPartition removes Google cookies only from the live Session. It does not update a pending staged image. When a legacy string stage is pending, startup runs copyFileSync(stagedPath, liveCookiesPath) before it consumes the stage. The staged image still contains the pre-clear Google cookies, so they return after restart.

The Linux Electron lifecycle job runs this path directly. .github/workflows/pr.yml:1085-1094 invokes Vitest on src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts. That test expects the restarted cookie names to equal the post-clear after names, so the same failure can block this CI workflow.

The correction belongs at the clear boundary in production code, not in the test. The test assertions already state the intended contract: the pending state is preserved, and only other, other-under-google, suffix-trap, and youtube remain after restart. The clear must also remove Google cookies from the pending legacy stage, and it must keep other-site cookies in that stage. A safe diff is not shown because the staging module API that would perform this update was not inspected.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1cc16da8-0c3b-4e6b-90a3-08a308aff7e3
Commits

Reviewing files that changed from the base of the PR and between 165349a and 393dab9.

Files selected for processing: 2
  • src/main/orcad/electron-serve-browser-process.test.ts
  • src/main/runtime/browser/browser-profile-rpc-test-fixture.ts

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

@brennanb2025

brennanb2025 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Round10 — copy-only continuation reviewed on d5187b9. The two-line diff changes only the Google Cookies caption and matching English translation. Continued review accepted its accuracy against the existing import policy, identical TSX/default catalog wording and absence of obsolete caption assertions. No wording or behavior was changed by the loop. Final-head CI has53 successful checks and13 skips; the lane owner’s checks watch exited0.

New caption:

Google ties its sign-ins to the browser they were made in, so Orca doesn't import Google cookies from other browsers. If Google is stuck on the wrong account or keeps signing you out, clear Google cookies from the active profile, then sign in to Google again in Orca. Other sites stay signed in.

QA carry: d5187b9 changes only copy on the Settings tests-row surface; deletion, targeting, confirmation, layout and remote behavior are unchanged. Brennan explicitly instructed on10-28: “Don't retake screenshots just tell me the new wording.” No QA rerun or new screenshots were taken. Round9 row/confirmation screenshots on8591 and the earlier selective-clear/repeat/restart evidence onf67 remain the evidence; the images below predate this caption update. The marker names reviewed head d5187b9 and retains the existing functional qa_head.

Google can get stuck on an old account in Orca, and importing browser cookies does not replace that sign-in. This PR adds one Google Cookies row below Settings → Browser → Session & Cookies. It explains when to clear, with a red action on the right that asks for confirmation and clears only Google cookies from the selected Host’s Active profile. Other sites stay signed in.

The full review loop and settled design rulings are complete, with no open P0/P1 findings. Continued correctness/consumer review accepted the latest 0a14dcc presentation revision: spacing, heading, caption and destructive button; English and localized search aliases and disabled/unavailable behavior are preserved. The owner reports the named renderer suite passed13/13 and the normal pre-commit hook passed. Final-head CI passed via one gh pr checks 34158 --watch --fail-fast --interval 60 on8591c69c9669a12bd7474fb9844dc075bc8ae100 (workflow); the watch exited0, including static analysis/typecheck and all five Node test shards.

Fresh dark-theme screenshots on8591c69c9669a12bd7474fb9844dc075bc8ae100 cover the revised row and its confirmation dialog. Earlier actual clear/repeat evidence onf67d63c70fec234171c4b06611f471065bc0c910 carries: Cancel preserved both synthetic cookies; clear removed Google and retained every metadata field of the other-site cookie; repeat displayed “No Google cookies to clear in Default.” Browser Use and profile import menus have no clear action. Backend/restart fixture evidence, including legacy staged-image refusal after graceful restart, carries unchanged.

Tests-row carry: efdc2aa changes Settings search metadata and its localized assertion;0a14dcc changes only this Settings presentation and its heading assertions. The two fresh screenshots supersede the old section/confirmation appearance. Main merges c8965fd (conflict refresh) and8591c69c9669a12bd7474fb9844dc075bc8ae100 (#34929 repair of main’s CI max-lines failure) preserve the reviewed Google behavior; prescribed merge hooks passed.

Intended differences from the common pattern follow the approved Google-only clear, explicit confirmation, selected Host/Active profile and mixed-version ownership/capability rulings. No deferred issue blocks this scope. Evidence limits remain: opaque partition-key seeding is unverified, and optional extra toast DOM-bracket files were not retained; actual result screenshots, semantic waits and full-metadata cookie comparisons were reviewed, without reconstructing missing snapshots.

For Brennan’s review — revised row:

google-cookies-row-dark.png

Confirmation names the profile:

google-cookies-confirm-dark.png

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds a repeatable Google-only cookie clear under Settings → Browser → Session & Cookies.

  • Google cookies can be cleared from the selected browser session without clearing other sites.
  • Browser Settings offers a confirmed Google-only clear for the Active profile.

No actionable issues were found. No tests or UI captures were run during this review.

Diagram

sequenceDiagram
  participant U as User
  participant S as Settings
  participant O as Selected browser owner
  participant J as Cookie jar
  U->>S: Press Clear Google cookies
  S->>O: Capture profile and owner
  O-->>S: Captured target
  S->>U: Ask for confirmation
  U->>S: Confirm
  S->>O: Clear captured target
  O->>O: Check owner and wait for cookie lock
  O->>J: Remove Google cookies only
  O->>J: Check remaining Google cookies
  O-->>S: Return result
Loading

Reviews (1) · Last reviewed commit: "Explain why Google cookies are handled s..." · Reviewed by Greptile

@brennanb2025
brennanb2025 merged commit bb1b05e into main Oct 28, 2026
66 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/sta-4398-google-cookie-clear-2 branch October 28, 2026 21:44
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.

1 participant