Skip to content

fix(ai): reconcile Ollama status badge with the desktop-only banner (#266) - #273

Merged
qnbs merged 2 commits into
mainfrom
fix/ollama-browser-status-badge
Jul 28, 2026
Merged

fix(ai): reconcile Ollama status badge with the desktop-only banner (#266)#273
qnbs merged 2 commits into
mainfrom
fix/ollama-browser-status-badge

Conversation

@qnbs

@qnbs qnbs commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #272 (base = fix/desktop-local-server-external) — will auto-retarget to main once 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") 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 is permanently stuck showing "Ready" — not because the connection was verified, but because it structurally can't be tested.

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 the misleading idle-default "Ready" text. Desktop is unaffected — the real test result still renders there.
  • New i18n key settings.ai.providerStatusUnavailableBrowser, added to all 19 locales.
  • Also fixes a smaller 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.

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/ko were added in a prior PR but never reflected there) and the per-locale module count (20 vs 21).

Test plan

  • pnpm run lint — clean
  • pnpm run typecheck — clean
  • pnpm run i18n:check — 19 locales, 2834 keys, parity OK
  • pnpm 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

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldscript-studio Ready Ready Preview, Comment Jul 28, 2026 8:21am

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0eea3301-d974-4fb1-8503-466d9c9997ea

📥 Commits

Reviewing files that changed from the base of the PR and between 614e1df and c00bce6.

📒 Files selected for processing (44)
  • CHANGELOG.md
  • CLAUDE.md
  • components/settings/AiProviderCard.tsx
  • locales/ar/settings.json
  • locales/de/settings.json
  • locales/el/settings.json
  • locales/en/settings.json
  • locales/es/settings.json
  • locales/eu/settings.json
  • locales/fa/settings.json
  • locales/fi/settings.json
  • locales/fr/settings.json
  • locales/he/settings.json
  • locales/hu/settings.json
  • locales/is/settings.json
  • locales/it/settings.json
  • locales/ja/settings.json
  • locales/ko/settings.json
  • locales/pt/settings.json
  • locales/ru/settings.json
  • locales/sv/settings.json
  • locales/zh/settings.json
  • public/locales/ar/bundle.json
  • public/locales/de/bundle.json
  • public/locales/el/bundle.json
  • public/locales/en/bundle.json
  • public/locales/es/bundle.json
  • public/locales/eu/bundle.json
  • public/locales/fa/bundle.json
  • public/locales/fi/bundle.json
  • public/locales/fr/bundle.json
  • public/locales/he/bundle.json
  • public/locales/hu/bundle.json
  • public/locales/is/bundle.json
  • public/locales/it/bundle.json
  • public/locales/ja/bundle.json
  • public/locales/ko/bundle.json
  • public/locales/pt/bundle.json
  • public/locales/ru/bundle.json
  • public/locales/sv/bundle.json
  • public/locales/zh/bundle.json
  • services/aiProviderService.ts
  • tests/unit/aiProviderService.test.ts
  • tests/unit/settings/AiProviderCard.test.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ollama-browser-status-badge

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

@qnbs
qnbs deleted the branch main July 28, 2026 08:16
@qnbs qnbs closed this Jul 28, 2026
@qnbs qnbs reopened this Jul 28, 2026
@qnbs
qnbs changed the base branch from fix/desktop-local-server-external to main July 28, 2026 08:19
qnbs and others added 2 commits July 28, 2026 10:19
… 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>
@qnbs
qnbs force-pushed the fix/ollama-browser-status-badge branch from 9c4a3c5 to c00bce6 Compare July 28, 2026 08:21
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@qnbs
qnbs merged commit 383e666 into main Jul 28, 2026
19 checks passed
@qnbs
qnbs deleted the fix/ollama-browser-status-badge branch July 28, 2026 08:36
@qnbs
qnbs restored the fix/ollama-browser-status-badge branch July 28, 2026 08:36
@qnbs
qnbs deleted the fix/ollama-browser-status-badge branch July 28, 2026 08:37
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.

1 participant