Skip to content

Support Safari, Firefox, and Edge for Xiaomi MiMo - #1350

Merged
steipete merged 1 commit into
steipete:mainfrom
Yuxin-Qiao:feat/mimo-multi-browser-cookie
Jun 10, 2026
Merged

Support Safari, Firefox, and Edge for Xiaomi MiMo#1350
steipete merged 1 commit into
steipete:mainfrom
Yuxin-Qiao:feat/mimo-multi-browser-cookie

Conversation

@Yuxin-Qiao

@Yuxin-Qiao Yuxin-Qiao commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expand Xiaomi MiMo automatic cookie discovery to Safari, Chrome, Chrome Beta, Chrome Canary, Firefox, and Microsoft Edge
  • keep Arc, Brave, and other browser profiles on explicit manual Cookie header import
  • defer browser cookie I/O from availability checks to fetch time
  • surface Safari Full Disk Access failures instead of reporting a generic missing session
  • update provider copy, translations, documentation, changelog, and focused regression coverage

Closes #1304.

Validation

  • DEVELOPER_DIR=/Applications/Xcode264.app/Contents/Developer make check
  • DEVELOPER_DIR=/Applications/Xcode264.app/Contents/Developer xcrun swift test --filter 'BrowserCookieOrderStatusStringTests|MiMoProviderTests' (29 tests)
  • DEVELOPER_DIR=/Applications/Xcode264.app/Contents/Developer xcrun swift test (3,419 tests, 392 suites)
  • autoreview clean, twice, against origin/main

No live browser-cookie or Keychain probe was run; permission behavior is covered with an injected cookie-loader regression.

@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed June 10, 2026, 4:14 AM ET / 08:14 UTC.

Summary
This PR changes MiMo automatic cookie discovery from Chrome variants to Safari, Chrome variants, Firefox, and Edge, defers session resolution to fetch time, surfaces browser access-denied details, and updates copy, docs, changelog, and tests.

Reproducibility: not applicable. as a feature PR, though source inspection confirms current main limits MiMo Auto to Chrome, Chrome Beta, and Chrome Canary while the PR expands that order.

Review metrics: 3 noteworthy metrics.

  • Files changed: 20 files, +112/-56. The PR spans provider auth code, docs, tests, changelog, and localized UI copy, so review must cover more than one source file.
  • MiMo auto browser scope: 3 browsers to 6 browsers. The default automatic import order changes from Chrome variants only to Safari, Chrome variants, Firefox, and Edge.
  • Locale surface: 11 locale files changed. The user-facing settings copy has to stay consistent with the new browser behavior across localized builds.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted after-fix proof from a real MiMo browser import setup, such as a screenshot, recording, terminal output, copied live output, linked artifact, or redacted log with cookies, account identifiers, IPs, API keys, phone numbers, and non-public endpoints removed.
  • Make the proof show at least one newly supported browser path and the resulting provider refresh so reviewers can distinguish it from source-only or stubbed validation.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body explicitly says no live browser-cookie or Keychain probe was run, so the external PR still needs redacted after-fix proof; after updating the PR body, ClawSweeper should re-review automatically or a maintainer can comment @clawsweeper re-review.

Risk before merge

  • [P1] MiMo Auto will prefer Safari before Chrome and add Firefox/Edge, so an existing user with different MiMo sessions across browsers could see a different imported account after upgrade.
  • [P1] The PR broadens automatic access to browser cookie stores, including Keychain-backed Chromium-family stores such as Edge, but the PR body only provides tests and stubs rather than redacted live import evidence.

Maintainer options:

  1. Require redacted real MiMo import proof (recommended)
    Ask for redacted after-fix proof showing MiMo Auto importing from at least one newly supported real browser and refreshing the provider result without exposing cookies or account identifiers.
  2. Accept source-level validation explicitly
    Maintainers can choose to accept the cookie-scope change based on the focused tests and AGENTS.md's live-probe caution, but that owns the lack of real browser proof.
  3. Narrow the automatic browser scope
    If the expanded default is too broad, narrow the PR to the browser set maintainers are ready to auto-probe and leave the rest of the linked issue open.

Next step before merge

  • [P1] The remaining blocker is contributor-side real browser proof plus maintainer acceptance of the expanded automatic cookie scope; there is no narrow code repair for automation to make on the PR branch.

Security
Needs attention: The diff has no dependency or supply-chain changes, but it intentionally broadens automatic access to browser cookie stores and still lacks real behavior proof.

Review details

Best possible solution:

Land the curated MiMo browser-order change after maintainers accept the expanded default scope and the PR body includes redacted after-fix proof from a real supported-browser MiMo import.

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

Not applicable as a feature PR, though source inspection confirms current main limits MiMo Auto to Chrome, Chrome Beta, and Chrome Canary while the PR expands that order.

Is this the best way to solve the issue?

Mostly yes: a provider-specific curated browser list is the maintainable shape and avoids the earlier full-default-order problem. It is not merge-ready until real behavior proof and maintainer acceptance of the expanded automatic cookie scope are present.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against e97bfb0db9eb.

Label changes

Label changes:

  • add merge-risk: 🚨 compatibility: Existing Auto users may see a different MiMo session selected after upgrade because Safari now precedes Chrome and Firefox/Edge are added.

Label justifications:

  • P2: This is a normal-priority provider auth/import improvement with limited blast radius, but it is still merge-relevant because it changes automatic cookie source behavior.
  • merge-risk: 🚨 compatibility: Existing Auto users may see a different MiMo session selected after upgrade because Safari now precedes Chrome and Firefox/Edge are added.
  • merge-risk: 🚨 auth-provider: Changing the browser cookie order can change which MiMo credentials or signed-in account the provider uses.
  • merge-risk: 🚨 security-boundary: The diff expands automatic browser-cookie probing into additional sensitive browser stores and needs proof/acceptance before merge.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body explicitly says no live browser-cookie or Keychain probe was run, so the external PR still needs redacted after-fix proof; after updating the PR body, ClawSweeper should re-review automatically or a maintainer can comment @clawsweeper re-review.
Evidence reviewed

Security concerns:

  • [medium] Broadened automatic cookie-store access needs proof — Sources/CodexBarCore/Providers/Providers.swift:229
    MiMo Auto now includes Safari, Firefox, and Edge in addition to Chrome variants; this is intentional, but it touches sensitive browser-cookie sources and should have redacted real import proof before merge.
    Confidence: 0.84

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the MiMo provider and browser-cookie helper files to Peter Steinberger in the release/main history, and the current PR head commit is authored by steipete with the MiMo browser-scope change. (role: recent area contributor and PR-head committer; confidence: high; commits: 920997c6a365, a2080dbb59b3; files: Sources/CodexBarCore/Providers/MiMo/MiMoProviderDescriptor.swift, Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift, Sources/CodexBarCore/Providers/Providers.swift)
  • Deb Pramanik: The original MiMo provider, cookie importer, usage fetcher, docs, and tests were added in the merged Xiaomi MiMo token-plan tracking commit. (role: introduced MiMo provider behavior; confidence: high; commits: f9a2918afcf1; files: Sources/CodexBarCore/Providers/MiMo/MiMoProviderDescriptor.swift, Sources/CodexBarCore/Providers/MiMo/MiMoCookieImporter.swift, Tests/CodexBarTests/MiMoProviderTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee64c84b84

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// for "Chrome-only when possible" to avoid extra browser keychain prompts.
public static var mimoCookieImportOrder: BrowserCookieImportOrder? {
#if os(macOS)
[.safari] + Browser.defaultImportOrder.filter { $0 != .safari }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit MiMo auto import to intended browsers

In macOS auto mode this now appends every entry from Browser.defaultImportOrder after Safari; that default order is already asserted to contain Firefox, so MiMo will probe Firefox (and other default browsers) even though the new docs/comment say Firefox should fall through to Manual and the repo guidance asks to avoid extra browser prompts. This can surface unexpected browser/keychain access attempts or import a MiMo session from a browser the UI says is not used; please build an explicit Safari + Chrome-variant list instead of reusing the full default order.

Useful? React with 👍 / 👎.

@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 Jun 7, 2026
@Yuxin-Qiao Yuxin-Qiao changed the title MiMo: import cookies from Safari in addition to Chrome variants Expand browser cookie import beyond Chrome-only defaults Jun 7, 2026
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Follow-up for the needs proof / browser-scope feedback:

  1. P1 browser-scope fix (041b2c3e) — MiMo Auto is now an explicit curated order [.safari, .chrome, .chromeBeta, .chromeCanary] via ProviderBrowserCookieDefaults.mimoCookieImportOrder, not Browser.defaultImportOrder. Tests assert Firefox/Edge are excluded from Auto.
  2. Proof added to PR body — before/after source snippets, focused XCTest output (31 passing tests), and a stubbed end-to-end MiMo web-strategy test that exercises imported browser sessions without live Keychain prompts (per AGENTS.md).
  3. Copy alignment — settings subtitle, locales, and docs/mimo.md now match the curated Safari + Chrome-variant Auto policy; Firefox/Edge documented as Manual.

Please re-run the review against 041b2c3e.

@Yuxin-Qiao Yuxin-Qiao changed the title Expand browser cookie import beyond Chrome-only defaults MiMo: Safari + Chrome auto import; fix Chrome-only copy elsewhere Jun 7, 2026
@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 7, 2026
@Yuxin-Qiao Yuxin-Qiao changed the title MiMo: Safari + Chrome auto import; fix Chrome-only copy elsewhere MiMo: import cookies from Safari, Firefox, and Edge (not Chrome-only) Jun 7, 2026
@Yuxin-Qiao

Copy link
Copy Markdown
Contributor Author

Updated scope to match issue #1304 wording: main was Chrome-only; Auto now includes Safari, Chrome variants, Firefox, and Edge (bf213ac5).

The earlier “Safari + Chrome only” title/body was written to satisfy ClawSweeper’s AGENTS.md narrow-scope suggestion, but that under-delivered on the issue request. PR title/description and mimoCookieImportOrder are corrected.

@clawsweeper re-review against bf213ac5

@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Yuxin-Qiao Yuxin-Qiao changed the title MiMo: import cookies from Safari, Firefox, and Edge (not Chrome-only) Fix Chrome-only browser cookie import and misleading copy (MiMo #1304 + related providers) Jun 7, 2026
@Yuxin-Qiao Yuxin-Qiao changed the title Fix Chrome-only browser cookie import and misleading copy (MiMo #1304 + related providers) Fix Chrome-only browser cookie import and misleading copy across providers Jun 7, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 7, 2026
Add bounded automatic cookie discovery for Safari, Chrome variants, Firefox, and Edge. Surface browser permission failures and defer cookie I/O to fetch time.

Co-authored-by: Yuxin Qiao <Yuxin-Qiao@users.noreply.github.com>
@steipete
steipete force-pushed the feat/mimo-multi-browser-cookie branch from bf213ac to a2080db Compare June 10, 2026 08:07
@steipete steipete changed the title Fix Chrome-only browser cookie import and misleading copy across providers Support Safari, Firefox, and Edge for Xiaomi MiMo Jun 10, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Jun 10, 2026
@steipete
steipete merged commit 050b139 into steipete:main Jun 10, 2026
4 checks passed
@Yuxin-Qiao
Yuxin-Qiao deleted the feat/mimo-multi-browser-cookie branch June 25, 2026 15:07
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. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xiaomi Mimo: Support importing cookie from browsers other than Chrome

2 participants