Skip to content

fix(ollama): try every browser before giving up on cookie import - #446

Merged
Finesssee merged 3 commits into
mainfrom
fix/ollama-cookie-browser-priority
Sep 8, 2026
Merged

fix(ollama): try every browser before giving up on cookie import#446
Finesssee merged 3 commits into
mainfrom
fix/ollama-cookie-browser-priority

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Maintainer replacement for #430 because the original head is in an external fork. Includes the reviewed fix plus preservation of meaningful browser cookie extraction errors.\r\n\r\nSupersedes #430.\r\n

Summary by CodeRabbit

  • Bug Fixes
    • Improved Ollama session detection across supported browsers.
    • Authentication now continues checking available browser cookie sources when earlier cookies are unrelated.
    • Prevents irrelevant cookie data from blocking valid sessions.
    • Handles missing or unusable sessions more reliably.

leoarayas and others added 3 commits September 6, 2026 19:58
Auto/Web cookie import stopped at the first installed browser that
returned any cookies for ollama.com, even when those cookies were
stale/irrelevant (e.g. a consent or analytics cookie left over from a
one-off visit) and carried no recognized session cookie. That starved
out a later browser (often the one actually signed in) and surfaced
"No cookies available for web API" even with a valid, logged-in
session sitting on disk.

Walk every detected browser and keep going until one yields a header
containing a recognized Ollama session cookie, instead of stopping at
the first non-empty result. Extracted the selection logic into a small
pure helper with a focused regression test reproducing the exact
scenario (irrelevant-only cookies on one browser, real session on the
next).

Fixes #426

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L23pzyCfMvfbMQwnHXmKCp
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: fc54053d-473e-48df-9cb6-a09b80616425

📥 Commits

Reviewing files that changed from the base of the PR and between 1e3d04c and 570302a.

📒 Files selected for processing (1)
  • rust/src/providers/ollama/cookies.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Ollama cookie resolution now scans all detected browsers, returns the first recognized session header, preserves the first meaningful extraction error, and returns None when no usable session exists.

Changes

Ollama cookie resolution

Layer / File(s) Summary
Browser cookie scan and session validation
rust/src/providers/ollama/cookies.rs
Cookie lookup scans every detected browser. The helper selects the first recognized Ollama session header. Tests cover irrelevant earlier cookies and missing sessions.

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

Merge Risk: ⚪ Minimal · up to 57030

Ollama session-cookie resolution now continues through detected browsers until it finds a recognized session, while retaining meaningful extraction errors when none is available. No current merge-blocking risk is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: Ollama cookie import now tries every detected browser before it gives up.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 1 files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ollama-cookie-browser-priority

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

@Finesssee
Finesssee merged commit f0f6a96 into main Sep 8, 2026
4 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