fix(ai): reconcile Ollama status badge with the desktop-only banner (#266) - #273
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (44)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
… modules) CLAUDE.md's i18n section and directory map both undercounted the locale roster by 2 (missing ru and ko, added in a prior PR's squashed commits but never reflected here) and the per-locale module count by 1 (20 -> 21). Also corrected the Beta/near-production grouping to match i18n/locales.ts (the actual SSOT) -- el/ja/pt/zh are near-production, not beta. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…266) The generic connection-status badge and the Ollama "desktop app required" banner in AiProviderCard were driven by two independent state signals that were never reconciled: testStatus (async, defaults to 'idle' -> "Ready") and isDesktop (sync, drives the banner). Since the auto-test effect and the manual "Test connection" button are both disabled for Ollama in a browser, testStatus can never leave 'idle' there -- so the badge always read "Ready" right next to a banner saying local servers aren't available, which is exactly the inconsistency reported against the live app. Fix: added a derived `ollamaUntestable` flag (provider === 'ollama' && !isDesktop) that the status badge checks first, rendering a new, distinct "Not available in browser" label instead of falling through to the idle-default "Ready" text. Desktop is unaffected -- the real test result (ok/error/loading) still renders there. New i18n key settings.ai.providerStatusUnavailableBrowser added to all 19 locales. Also fixes the scan endpoint order restpunkt: scanLocalOpenAiCompatibleEndpoints now tries Ollama's native /api/tags first, falling back to the OpenAI-compat /v1/models shim only on a non-timeout failure -- mirrors the native-first approach testOllamaConnection/listOllamaModels already use, so an older Ollama install without the compat shim isn't missed by the scan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
9c4a3c5 to
c00bce6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Stacked on #272 (base =
fix/desktop-local-server-external) — will auto-retarget tomainonce that merges.Fixes the other still-open half of #266: the reported inconsistency where Settings → AI shows "Bereit"/"Ready" for Ollama at the same time as the "desktop app required" banner.
Root cause:
AiProviderCard's generic connection-status badge and the Ollama-specific banner are driven by two independent state signals that are never reconciled —testStatus(async, defaults to'idle'→ "Ready") andisDesktop(sync, drives the banner). Since the auto-test effect and the manual "Test connection" button are both disabled for Ollama in a browser,testStatuscan never leave'idle'there, so the badge is permanently stuck showing "Ready" — not because the connection was verified, but because it structurally can't be tested.Fix
ollamaUntestableflag (provider === 'ollama' && !isDesktop) that the status badge checks first, rendering a new, distinct "Not available in browser" label instead of the misleading idle-default "Ready" text. Desktop is unaffected — the real test result still renders there.settings.ai.providerStatusUnavailableBrowser, added to all 19 locales.scanLocalOpenAiCompatibleEndpoints()now tries Ollama's native/api/tagsfirst, falling back to the OpenAI-compat/v1/modelsshim only on a non-timeout failure — mirrors the native-first approachtestOllamaConnection/listOllamaModelsalready use, so an older Ollama install without the compat shim isn't missed by the scan.Includes one unrelated, small doc-drift fix as its own commit: CLAUDE.md's i18n section had undercounted the locale roster (17 vs the actual 19 —
ru/kowere added in a prior PR but never reflected there) and the per-locale module count (20 vs 21).Test plan
pnpm run lint— cleanpnpm run typecheck— cleanpnpm run i18n:check— 19 locales, 2834 keys, parity OKpnpm exec vitest run tests/unit/settings/AiProviderCard.test.tsx tests/unit/aiProviderService.test.ts— 64/64 passing, including new tests for the badge reconciliation and the scan's native-first endpoint order🤖 Generated with Claude Code