CAS-1931: AI features use Local CLI provider during pre-beta
CAS-1931: AI features use Local CLI provider during pre-beta
Shipped: 2026-05-08
PRs: #510 (LocalCliService engine), #511 (AIManager wiring), #519 (bug-report user context), #521 (KNOWN_ISSUES), #522 (AI Settings page)
What this is
Casaconomy’s AI features (bug-report chat, rules creation) now route through a Local CLI provider that spawns a claude subprocess instead of calling the Anthropic HTTPS API. The regent’s Claude Max plan covers the cost; no API key credits required.
Architecture
LocalCliService(src-tauri/src/services/ai/local_cli.rs) — spawnsclaude --output-format stream-json, passes the prompt over stdin, emits Tauri events as delta lines arrive on stdout. Same trait shape asAnthropicServiceandGeminiService.AIServiceInstance::LocalClivariant added tosrc-tauri/src/services/ai/manager.rs.- Provider picker in Settings → AI: selects between
LocalCli(default),Anthropic, andGemini. Stored in app settings viasrc/tauri/aiClient.ts. - Bug-report chat (
src/pages/BugReportPage.tsx) — the first consumer. Bootstraps the conversation with route, recent logs, screenshot, and store snapshot; streams assistant replies back.
Dev-only boundary
Local CLI requires the claude binary installed and authenticated on the machine. This is developer mode only — beta testers will not have claude installed.
See KNOWN_ISSUES.md §Local CLI for the standing callout. The settings UI labels the option “Developer mode (requires claude CLI)”.
Not in scope (deferred)
- BYOK (bring-your-own API key) for beta testers — covered by the existing HTTPS providers
- Hosted-key proxy for wide distribution
- Rules-creation flow improvements (punted to a future epic per spec; CAS-1938 remains as research)
- Codex CLI / Oz CLI as alternative backends