Skip to content

Make the AI Control Center easy to set up and honest about what works - #3

Merged
devxsubh merged 1 commit into
mainfrom
feat/ai-setup-ux
Oct 25, 2026
Merged

devxsubh merged 1 commit into
mainfrom
feat/ai-setup-ux

Conversation

@devxsubh

Copy link
Copy Markdown
Owner

Why

The AI Control Center showed a green "Everything stays on this computer" banner and "On-device" badges on every task while Ollama wasn't running, so nothing AI-related worked and the only hint was a small "Couldn't list models: fetch failed". It also asked people to assign models to tasks before they had any way to run one.

What changes

Status first. A new GET /api/ai/health checks each task for real: is the runtime up, is the model downloaded, is the key present and accepted, is Local-only mode blocking it, can the model use tools, does the provider support embeddings. The page's top card shows the result in plain words, with one fix button per cause (Start Ollama, Download, Add key, Allow cloud AI, Change model). The app-wide banner uses the same check, so it also warns when AI is configured but broken.

Guided setup. Choose "On this computer" or "Cloud provider":

  • On-device: detects whether Ollama is missing or just stopped (and can start it), recommends models that fit this computer's memory, checks disk space, marks models that are already downloaded, optionally adds document search, and shows download progress in plain words. Downloads can be cancelled and resume where they left off.
  • Cloud: pick a provider, then paste a key. The key is cleaned up (quotes, Bearer , NAME= lines), checked against the right provider ("This key looks like it's for OpenAI, not Anthropic"), and verified with the provider before it's stored. A rejected key is never saved; when you're offline you can save without the check. The model list comes from your account with a recommended default, and there's a text fallback if the list fails to load. Finishing requires explicit consent to what leaves the computer, and turns Local-only off. Document search uses the provider's embeddings, or keyword search for Anthropic, Groq and OpenRouter, with no Ollama dependency.

Advanced settings (collapsed) keeps the per-task model picker, model downloads, API keys and custom servers, with:

  • confirmations before removing a model or key that's in use, and when choosing a cloud model while Local-only is on;
  • a note that changing the embedding model sends existing documents back to keyword search;
  • custom server IDs prefixed custom- so a server named "OpenAI" can't overwrite the built-in preset.

Errors. classifyLlmError sorts failures into auth / quota / rate-limit / model-missing / local-down / offline / timeout, and reads the cause on Node fetch errors. Messages no longer say "fetch failed" or "restart the backend".

Testing

  • Backend and frontend typecheck clean; lint has 0 errors, and the 153 warnings are the same ones already on main.
  • 21 helper checks pass: key cleanup and provider detection, chat-model filtering and recommendation, Ollama tag matching, error classification.
  • In the desktop app with Ollama stopped: the card showed "Ollama isn't running" with a single Start Ollama button. Clicking it launched Ollama and the card switched to "AI is ready".
  • On an isolated backend with a throwaway data directory:
    • Anthropic rejected a fake key with HTTP 422, and no secrets file was written.
    • The wrong-provider key, too-short key, bad custom URL, Anthropic-as-embedding, and cloud setup without a key were all refused with plain messages.
    • Health gave the right status and fix for: not set up, model not downloaded, blocked by Local-only, and key missing.
  • Not tested: cloud setup end to end with a real API key.

🤖 Generated with Claude Code

The old page showed a green "everything stays on this computer" banner and
"On-device" badges while Ollama wasn't even running, and asked users to
assign models before they had anywhere to run them.

Backend
- GET /api/ai/health: live per-task check (runtime up, model downloaded,
  key present and accepted, Local-only blocking, tool support, provider
  embedding support), each problem with one fix action. Listings cached 20 s.
- Ollama: detect installed-but-stopped vs not installed, POST /local/start
  launches it, free disk space reported and checked before downloads.
- API keys: cleaned up on paste (quotes, Bearer, NAME= lines), wrong-provider
  keys caught, and verified with the provider before they're stored;
  rejected keys are never saved, offline saves need an explicit skipVerify.
- POST /quick-setup/cloud: provider's recommended model for chat and
  background tasks, provider embeddings or keyword search (no Ollama
  dependency), Local-only off. quick-setup/local accepts a chosen model.
- classifyLlmError: auth / quota / rate-limit / model-missing / local-down /
  offline / timeout, reading fetch's error cause; messages no longer say
  "fetch failed" or "restart the backend".

Frontend
- Status card replaces PrivacyCard: real state per task, one fix button per
  cause, Local-only switch with confirmations.
- Guided setup: "On this computer" (Ollama, model fit for RAM/disk, optional
  document search, resumable downloads) or "Cloud provider" (key check,
  model list with fallback, explicit consent before data can leave).
- Per-task models, downloads, keys and custom servers move under Advanced
  settings, with confirms for removing in-use models/keys and custom ids
  that can't collide with built-in providers.
- App banner uses the health check, so it also warns when AI is configured
  but broken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devxsubh
devxsubh merged commit 214970b into main Oct 25, 2026
4 checks passed
@devxsubh
devxsubh deleted the feat/ai-setup-ux branch October 25, 2026 19:24
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