From 1ddcc649d8895240840e73008bb4e84fac4254d4 Mon Sep 17 00:00:00 2001 From: JoeVenner Date: Mon, 6 Jul 2026 17:36:17 +0100 Subject: [PATCH 1/4] Point Ollama login recovery to sign-in page --- .../CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift b/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift index 5778155001..5d2d85b6f6 100644 --- a/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift +++ b/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift @@ -43,7 +43,7 @@ public enum OllamaUsageError: LocalizedError, Sendable { case .missingAPIKey: "Missing Ollama API key. Set apiKey in ~/.codexbar/config.json or OLLAMA_API_KEY." case .notLoggedIn: - "Not logged in to Ollama. Please log in via ollama.com/settings." + "Not signed in to Ollama. Please sign in at https://ollama.com/signin." case .invalidCredentials: "Ollama session cookie expired. Please log in again." case .apiUnauthorized: @@ -53,7 +53,7 @@ public enum OllamaUsageError: LocalizedError, Sendable { case let .networkError(message): "Ollama request failed: \(message)" case .noSessionCookie: - "No Ollama session cookie found. Please log in to ollama.com in your browser." + "No Ollama session cookie found. Please sign in at https://ollama.com/signin in your browser." } } } From 8e67ab3f1ad049a957448a195b6dfee9dec7d08f Mon Sep 17 00:00:00 2001 From: JoeVenner Date: Mon, 6 Jul 2026 17:37:21 +0100 Subject: [PATCH 2/4] Test Ollama sign-in recovery links --- Tests/CodexBarTests/OllamaUsageFetcherTests.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/CodexBarTests/OllamaUsageFetcherTests.swift b/Tests/CodexBarTests/OllamaUsageFetcherTests.swift index e25283f5b0..624c633038 100644 --- a/Tests/CodexBarTests/OllamaUsageFetcherTests.swift +++ b/Tests/CodexBarTests/OllamaUsageFetcherTests.swift @@ -3,6 +3,12 @@ import Testing @testable import CodexBarCore struct OllamaUsageFetcherTests { + @Test + func `sign in errors point to current recovery page`() { + #expect(OllamaUsageError.notLoggedIn.errorDescription?.contains("https://ollama.com/signin") == true) + #expect(OllamaUsageError.noSessionCookie.errorDescription?.contains("https://ollama.com/signin") == true) + } + @Test func `attaches cookie for ollama hosts`() { #expect(OllamaUsageFetcher.shouldAttachCookie(to: URL(string: "https://ollama.com/settings"))) From d2b933a3daa211d76590f45c6ea395c1cf63d792 Mon Sep 17 00:00:00 2001 From: JoeVenner Date: Mon, 6 Jul 2026 17:37:33 +0100 Subject: [PATCH 3/4] Document current Ollama sign-in recovery --- CHANGELOG.md | 1 + docs/ollama.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63a471b174..7d007d5267 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Claude: distinguish Max 5x and Max 20x in the plan label instead of a flat "Max". Thanks @kes02! ### Fixed +- Ollama: point missing-session recovery to the current `/signin` page instead of the protected settings page. Thanks @joeVenner! - Alibaba Token Plan: support International Model Studio while preserving China-mainland upgrades and isolating regional cookie caches. Thanks @harshav167! - Amp: open the current Usage page from the menu dashboard action. Thanks @3kh0! - Browser cookies: stop automatic Chromium-family probes after the first Safe Storage denial, while keeping an explicit Refresh retry available (#1952). Thanks @CoreyCole! diff --git a/docs/ollama.md b/docs/ollama.md index 837958b0d4..42880756bf 100644 --- a/docs/ollama.md +++ b/docs/ollama.md @@ -48,12 +48,12 @@ Ollama API keys currently do not expire, but they can be revoked from the key se ### “No Ollama session cookie found” -Log in to `https://ollama.com/settings` in Chrome, then refresh in CodexBar. +Sign in at `https://ollama.com/signin` in Chrome, then refresh CodexBar. If your active session is only in Safari (or another browser), use **Cookie source → Manual** and paste a cookie header. ### “Ollama session cookie expired” -Sign out and back in at `https://ollama.com/settings`, then refresh. +Sign out and back in at `https://ollama.com/signin`, then refresh. ### “Could not parse Ollama usage” From 7ff8373dc4898d84823d7ed62ff126405f05a13f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 6 Jul 2026 16:10:08 -0700 Subject: [PATCH 4/4] fix: align Ollama session recovery guidance --- .../Providers/Ollama/OllamaUsageFetcher.swift | 8 +++++--- Tests/CodexBarTests/OllamaUsageFetcherTests.swift | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift b/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift index 5d2d85b6f6..dc527ed479 100644 --- a/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift +++ b/Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift @@ -30,6 +30,8 @@ private func hasRecognizedOllamaSessionCookie(in header: String) -> Bool { } public enum OllamaUsageError: LocalizedError, Sendable { + private static let signInURL = "https://ollama.com/signin" + case missingAPIKey case notLoggedIn case invalidCredentials @@ -43,9 +45,9 @@ public enum OllamaUsageError: LocalizedError, Sendable { case .missingAPIKey: "Missing Ollama API key. Set apiKey in ~/.codexbar/config.json or OLLAMA_API_KEY." case .notLoggedIn: - "Not signed in to Ollama. Please sign in at https://ollama.com/signin." + "Not signed in to Ollama. Please sign in at \(Self.signInURL)." case .invalidCredentials: - "Ollama session cookie expired. Please log in again." + "Ollama session cookie expired. Please sign in again at \(Self.signInURL)." case .apiUnauthorized: "Ollama API key is invalid or revoked." case let .parseFailed(message): @@ -53,7 +55,7 @@ public enum OllamaUsageError: LocalizedError, Sendable { case let .networkError(message): "Ollama request failed: \(message)" case .noSessionCookie: - "No Ollama session cookie found. Please sign in at https://ollama.com/signin in your browser." + "No Ollama session cookie found. Please sign in at \(Self.signInURL) in your browser." } } } diff --git a/Tests/CodexBarTests/OllamaUsageFetcherTests.swift b/Tests/CodexBarTests/OllamaUsageFetcherTests.swift index 624c633038..16333938af 100644 --- a/Tests/CodexBarTests/OllamaUsageFetcherTests.swift +++ b/Tests/CodexBarTests/OllamaUsageFetcherTests.swift @@ -4,8 +4,9 @@ import Testing struct OllamaUsageFetcherTests { @Test - func `sign in errors point to current recovery page`() { + func `session authentication errors point to current recovery page`() { #expect(OllamaUsageError.notLoggedIn.errorDescription?.contains("https://ollama.com/signin") == true) + #expect(OllamaUsageError.invalidCredentials.errorDescription?.contains("https://ollama.com/signin") == true) #expect(OllamaUsageError.noSessionCookie.errorDescription?.contains("https://ollama.com/signin") == true) }