Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CUA proofBuild commit: b9526d4 (PR head) with an uncommitted proof-only patch (not part of the PR): Commands:
Screenshots (local, not committed) in Note: the Codex provider pane displayed a real ambient account despite empty CODEX_HOME; unrelated to this PR. |
Port review: Ollama empty Manual cookie guidance (#638, GAP row 24 of 0.66.0)Reviewed the branch diff What I checked:
Result: no findings. The port matches upstream semantics (message copy, single never-automatic action, fail-closed classification) and the UI behavior is proven at the current head. No dependency, locale addition beyond the spec text, bridge or frontend logic change. |
UI proof (browser-use)Combined build of
Every surface also passed the privacy check (no email-like text, account e-mail nodes or profile paths in the DOM) and theme Validation at |
…al cookie and offer automatic cookies The release split build_fetch_context into a no-cookie-domain branch and a cookie-domain branch, each with its own Manual arm. Git put the PR's blank-header check into the first arm (where the release also clones the token cookie); the same check now also guards the cookie-domain arm, which is the one Ollama takes, so a whitespace-only header counts as missing there too. commands/tests.rs keeps the release Raycast cookie-source test next to the new Ollama cases; keys.ts and locale.rs keep the Raycast keys next to ProviderManualCookieMissing and ProviderUseAutomaticCookies.
Summary
With cookie source Manual, no pasted Ollama header and no active token-account cookie, refresh now fails closed: no browser import, no network call, and the message is upstream's:
A non-empty header without a recognized session cookie keeps its existing error (
NoCookies). In Settings > Providers the cookie-source row shows "No cookie header pasted." and a "Use automatic cookies" button that sets the source to Auto. The action is never automatic.Before this change Ollama returned
Clifor empty Manual (supports_cli() == false), so the shell remapped it to a silent browser-cookie import.Upstream reference
fa557ace.v0.66.0) reads:Sources/CodexBarCore/Providers/Ollama/OllamaUsageFetcher.swift(OllamaUsageError.manualCookieHeaderEmpty,resolveManualCookieHeader),Sources/CodexBar/Providers/Ollama/OllamaProviderImplementation.swift(settingsPickers:manualCookieMissing, trailing text, actionollama-use-auto-cookie).Implementation
rust/src/providers/ollama/mod.rs:manual_empty_cookie_policy()returnsFailClosedWeb(mirrors Replicate).rust/src/providers/ollama/cookies.rs:resolve_cookie_sourcereturns the friendly error when the shell signalsmanual_cookie_missing, before any browser import.commands/providers.rs: a blank/whitespace stored header now counts as missing for fail-closed providers (upstream trims before checking).commands/provider_detail.rs: newmanualCookieMissingfield onProviderDetail, derived from the samebuild_fetch_contextdecision and gated on the provider's fail-closed policy so opening the pane never imports browser cookies.CookieSourceSectionrenders the hint and action generically fromdetail.manualCookieMissing(no provider-id branch); it only offers the action when Manual is selected and an Auto option exists.CookieSectiongets an optionalonChangedso the flag refreshes after paste/import/remove.ProviderManualCookieMissing,ProviderUseAutomaticCookies(en-US; other locales fall back).Ported / Deferred
debugDisableKeychainAccess). Win-CodexBar has no explicit API usage-source mode for Ollama (an API key is tried first under Auto) and no Keychain gate, so neither condition exists.manualfor every provider (DEFAULT_COOKIE_SOURCE). Like Replicate, an Ollama user who never touched the setting and has no pasted header now sees the friendly error and the one-click action instead of a silent browser import.docs/ollama.mdnot mirrored (macOS-oriented doc; no Windows doc for this row exists).Validation
Toolchain
cargo +1.98.0,CARGO_BUILD_JOBS=4.cargo fmt --all -- --check: passcargo clippy --workspace --all-targets -- -D warnings: passcargo test -p codexbar(full, locale enum touched): 2163 passed, 0 failedcargo test -p codexbar ollama: 28 passed (3 new inproviders::ollama::cookies::tests)cargo test -p codexbar-desktop-tauri fetch_context: 32 passed (4 new Ollama cases incommands/tests.rs)cargo test -p codexbar-desktop-tauri(full): 465 passed, 1 failed:bootstrap_payload_exposes_every_provider_variant(79 vs 78). It reads the local machine's real settings (a deprecated provider enabled in the developer's config) and is unrelated to this change.pnpm --dir apps/desktop-tauri exec vitest run: 68 files, 406 tests passed (4 new inCookieSourceSection.test.tsx)pnpm --dir apps/desktop-tauri run lint: only pre-existing warnings;run build: passAffected areas
Provider (Ollama), shell fetch-context, settings UI (Providers tab, cookie source row), locale catalog.
UI proof
Pending: coordinator will capture CUA proof (CODEXBAR_PROOF_MODE=settings:providers) on a fresh build.