Skip to content

Support LongCat Firefox cookie imports - #2462

Merged
steipete merged 3 commits into
steipete:mainfrom
akshayprabhu200:agent/longcat-firefox-cookie-import
Jul 28, 2026
Merged

Support LongCat Firefox cookie imports#2462
steipete merged 3 commits into
steipete:mainfrom
akshayprabhu200:agent/longcat-firefox-cookie-import

Conversation

@akshayprabhu200

@akshayprabhu200 akshayprabhu200 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Firefox as a Chrome-first fallback for LongCat automatic cookie imports
  • preserve the existing Chrome precedence without adding Safari or unrelated Chromium browser probes
  • update the dedicated browser-order regression test to lock the provider metadata and Firefox fallback

Root cause

LongCat's automatic cookie import order was hard-coded to [.chrome]. Although the shared cookie importer already supports Firefox and other providers use it successfully, Firefox was never included in LongCat's candidate list, so a valid longcat.chat Firefox session could not be discovered.

Real behavior proof

Ran a credential-safe local proof on a machine signed in to LongCat only in Firefox. The proof used the exact SweetCookieKit 0.4.1 revision pinned by this checkout and the same Firefox cookie query and LongCat endpoints used by the production importer.

[proof] configured LongCat order: Chrome -> Firefox
[proof] Chrome LongCat cookie rows: 0
[proof] Firefox candidate profiles with LongCat cookies: 1
[proof] Firefox profile #1: authenticated LongCat session discovered
[proof] user-current: HTTP 200, envelope 0
[proof] tokenUsage: HTTP 200, envelope 0, totalToken present
[proof] cookie values and account fields: redacted by harness

The Chrome check was count-only and did not decrypt or print cookie data. The Firefox proof imported the live cookie store, sent authenticated GET requests only to longcat.chat, and printed only status/schema evidence. No cookie names, values, account identity, quota values, or response bodies were retained.

Firefox uses the shared Gecko SQLite/WAL reader and does not use Chromium Safe Storage, so this fallback does not introduce a browser Keychain prompt. It does expand LongCat's file-based browser probing from Chrome to Firefox when Automatic import runs; Chrome remains first.

Verification

  • real Firefox-only LongCat discovery proof above — authenticated user-current and tokenUsage requests succeeded
  • make check — all portable repository checks and SwiftFormat passed; the initial SwiftLint invocation could not load SourceKit from the active Command Line Tools path
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer .build/lint-tools/bin/swiftlint --strict — 0 violations across 1,581 files
  • swift test --filter BrowserCookieOrderStatusStringTests — could not start because this checkout requires Swift tools 6.2 while the installed Xcode/Swift toolchain is 5.10
  • make test — same local Swift 6.2 toolchain prerequisite prevented test discovery; upstream CI remains the compilation and test gate

Changelog

LongCat: detect Firefox web sessions during Automatic cookie import.

No screenshots needed; this changes provider cookie-source selection only.

Fixes #2463

@akshayprabhu200
akshayprabhu200 marked this pull request as ready for review July 26, 2026 20:43
@clawsweeper

clawsweeper Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codex review: found issues before merge. Reviewed July 27, 2026, 11:37 PM ET / July 28, 2026, 03:37 UTC.

ClawSweeper review

What this changes

The PR changes LongCat Automatic cookie discovery from Chrome-only to Chrome followed by Firefox, with regression assertions for the provider’s browser order.

Merge readiness

⚠️ Needs maintainer review before merge - 5 items remain

Keep this PR open for a maintainer product decision. The Firefox-only LongCat case is credible and has real live proof, but the patch changes Automatic import from the repository’s Chrome-only default to an unconditional second-browser probe; the prior review’s compatibility concern remains unresolved.

Priority: P2
Reviewed head: 67f976d679b92c2fb03775c4abeacaa28e490beb
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is small and the live proof is strong, but its unconditional default change still needs an explicit product and compatibility decision.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR contains redacted after-fix live output showing a Firefox-only LongCat session is discovered and both authenticated usage endpoints succeed; no additional visual proof is needed for this non-visual provider-selection change.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR contains redacted after-fix live output showing a Firefox-only LongCat session is discovered and both authenticated usage endpoints succeed; no additional visual proof is needed for this non-visual provider-selection change.
Evidence reviewed 5 items Current-main behavior: The submitted diff shows that current main configures LongCat Automatic imports with Chrome only; this PR is the change that adds Firefox as a default fallback.
Repository policy: The fully supplied AGENTS.md directs cookie imports to remain Chrome-only by default when possible and to use a browser-list override when another browser is needed. This patch changes the default rather than exposing such an override.
Prior review continuity: The latest completed review at commit 9615d72 identified the same unresolved concern: Firefox probing should remain opt-in or receive explicit approval for a LongCat-specific exception. The branch’s later main merge does not provide that approval.
Findings 1 actionable finding [P2] Preserve the Chrome-only Automatic default
Security None None.

How this fits together

LongCat usage probing starts by selecting browser cookie stores when its Cookie source is Automatic. A discovered authenticated longcat.chat session is then used by the provider’s usage endpoints to retrieve account usage.

flowchart LR
    A[User refresh] --> B[LongCat Automatic cookie source]
    B --> C[Browser import order]
    C --> D[Chrome cookie store]
    C --> E[Firefox cookie store]
    D --> F[Authenticated LongCat session]
    E --> F
    F --> G[Usage API probes]
    G --> H[Menu bar usage display]
Loading

Decision needed

Question Recommendation
Should LongCat Automatic cookie import remain Chrome-only by default, or should it intentionally probe Firefox after Chrome for every existing LongCat user? Keep Chrome-only Automatic import: Retain the existing default and address Firefox discovery through an explicit browser-selection design rather than silently broadening every Automatic refresh.

Why: Both paths are technically viable: the PR proves the Firefox-only use case, while repository policy favors Chrome-only defaults unless broader browser probing is deliberately selected.

Before merge

  • Preserve the Chrome-only Automatic default (P2) - This changes LongCat Automatic refreshes from one browser probe to an unconditional Firefox fallback, despite repository guidance to keep imports Chrome-only by default and override the browser list when needed. That can discover a different signed-in LongCat account without an explicit user choice; keep Firefox opt-in or obtain explicit approval for this provider-specific exception. This is the unresolved blocker from the prior review cycle.
  • Resolve merge risk (P1) - Merging changes existing LongCat Automatic refreshes to inspect Firefox without an explicit user selection, expanding local browser-cookie probing and potentially selecting a different signed-in LongCat account.
  • Resolve merge risk (P1) - The repository’s Chrome-first policy appears intended to avoid surprise browser probing; the Mistral precedent supports an exception only when a maintainer deliberately accepts that provider’s behavior.
  • Complete next step (P2) - A maintainer must choose whether LongCat is an approved exception to the Chrome-only Automatic-import default before an implementation path can be accepted.

Findings

  • [P2] Preserve the Chrome-only Automatic default — Sources/CodexBarCore/Providers/Providers.swift:296
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch surface 2 files affected; 12 added, 5 removed The implementation is narrowly scoped to one provider default and its focused regression test, so the remaining blocker is behavior policy rather than patch size.

Merge-risk options

Maintainer options:

  1. Retain the conservative Automatic default (recommended)
    Restore LongCat’s Chrome-only order until users can explicitly select additional browser stores, avoiding a behavior change for existing Automatic refreshes.
  2. Accept the LongCat Firefox fallback
    A maintainer can explicitly accept the Chrome-to-Firefox default after deciding that the Firefox-only discovery benefit outweighs the extra provider probe.
  3. Pause for shared selection UX
    Close or pause this implementation if LongCat should not be an exception and the shared browser-selection direction is not yet sponsored.

Technical review

Best possible solution:

Preserve Chrome-only Automatic behavior unless a maintainer explicitly accepts LongCat’s Chrome-to-Firefox exception; the more durable alternative is a bounded user-visible browser-source selection that keeps the default conservative.

Do we have a high-confidence way to reproduce the issue?

Yes—at source level with high confidence: current main restricts LongCat Automatic imports to Chrome, and the supplied Firefox-only signed-in workflow directly exercises the omitted candidate source. The contributor also provided redacted live after-fix evidence for the resulting authenticated requests.

Is this the best way to solve the issue?

Unclear—the Chrome-to-Firefox fallback is a narrow technical fix, but it is not clearly the best product path while the repository policy favors Chrome-only defaults and lacks an explicit LongCat browser-selection decision.

Full review comments:

  • [P2] Preserve the Chrome-only Automatic default — Sources/CodexBarCore/Providers/Providers.swift:296
    This changes LongCat Automatic refreshes from one browser probe to an unconditional Firefox fallback, despite repository guidance to keep imports Chrome-only by default and override the browser list when needed. That can discover a different signed-in LongCat account without an explicit user choice; keep Firefox opt-in or obtain explicit approval for this provider-specific exception. This is the unresolved blocker from the prior review cycle.
    Confidence: 0.92

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against de3389771177.

Labels

Label justifications:

  • P2: This is a bounded provider behavior change with a credible user need, but it affects existing Automatic imports rather than an urgent runtime failure.
  • merge-risk: 🚨 compatibility: Existing users’ Automatic refreshes would begin probing Firefox in addition to Chrome without changing their stored settings.
  • merge-risk: 🚨 auth-provider: The added fallback can discover and authenticate a different browser-held LongCat session than the Chrome session previously considered by Automatic import.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR contains redacted after-fix live output showing a Firefox-only LongCat session is discovered and both authenticated usage endpoints succeed; no additional visual proof is needed for this non-visual provider-selection change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR contains redacted after-fix live output showing a Firefox-only LongCat session is discovered and both authenticated usage endpoints succeed; no additional visual proof is needed for this non-visual provider-selection change.

Evidence

What I checked:

Likely related people:

  • steipete: The contributor explicitly requested a decision from steipete on the LongCat-specific exception, and steipete authored the branch’s current-main synchronization commit. (role: likely product decision owner; confidence: medium; commits: 67f976d679b9; files: Sources/CodexBarCore/Providers/Providers.swift)
  • djsavvy: Authored the merged Mistral browser-import expansion that is the closest concrete precedent for provider-specific Firefox fallback behavior. (role: merged adjacent-feature contributor; confidence: medium; commits: 05090d06398e, b7920f1aead5; files: Sources/CodexBarCore/Providers/Providers.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain a maintainer decision on whether LongCat Automatic imports may probe Firefox by default, or revise the patch to preserve a Chrome-only default.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-07-26T20:42:18.611Z sha f94f043 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-26T20:50:48.967Z sha f94f043 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-26T20:57:01.959Z sha f94f043 :: needs changes before merge. :: [P2] Assert LongCat metadata directly
  • reviewed 2026-07-26T21:01:32.296Z sha f94f043 :: needs changes before merge. :: [P2] Assert LongCat metadata directly
  • reviewed 2026-07-27T00:49:20.300Z sha 9615d72 :: found issues before merge. :: [P2] Keep Firefox probing opt-in for Automatic imports

@akshayprabhu200
akshayprabhu200 marked this pull request as draft July 26, 2026 20:47
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 26, 2026
@akshayprabhu200

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 26, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Jul 26, 2026
@akshayprabhu200
akshayprabhu200 marked this pull request as ready for review July 26, 2026 20:57
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 26, 2026
@akshayprabhu200

akshayprabhu200 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

I believe this bounded LongCat override follows the AGENTS.md guidance (“default Chrome-only when possible … override via browser list when needed”): the redacted live proof shows Chrome-only does not work for a Firefox-only LongCat session, and Firefox adds no Chromium Keychain prompt.

The closest merged precedent is #1985, which intentionally expanded Mistral Automatic from Chrome-only to Chrome → Firefox → Safari so Firefox users are detected without Manual mode. LongCat currently exposes only Automatic / Manual cookie header / Off; I could not find an existing per-provider browser picker, so making Firefox explicitly selectable would require a broader settings/config feature rather than a focused compatibility fix.

Would you accept the LongCat-specific Chrome → Firefox exception, or would you prefer that broader opt-in browser-selection UX first?

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. label Jul 28, 2026
@steipete
steipete merged commit dd029db into steipete:main Jul 28, 2026
15 of 17 checks passed
@steipete

Copy link
Copy Markdown
Owner

Merged after final review of the exact head and the surrounding LongCat cookie-import path.

Verification:

  • Confirmed Automatic import remains Chrome first, falls back to Firefox, and does not add Safari.
  • Confirmed Firefox uses the existing non-Keychain browser-cookie path.
  • Structured autoreview reported no accepted/actionable findings.
  • Exact-head CI passed: https://github.com/steipete/CodexBar/actions/runs/30326268798
    • lint, GitGuardian, Linux x64/arm64, Linux musl, both macOS test shards, and the aggregate gate all passed.
    • One macOS shard was rerun after SwiftPM's shared cache lost its swift-log repository during dependency resolution; the rerun completed successfully.
  • The PR documents successful live Firefox-only LongCat discovery and authenticated endpoint proof with credentials and account data redacted.

Thank you for the focused fix and the live Firefox validation, @akshayprabhu200!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LongCat automatic cookie import ignores Firefox sessions

2 participants