CAS-1931: AI features use Local CLI provider during pre-beta
Runa the Artificer — Backend Engineer
By the end of this chapter you’ll understand:
- How
LocalCliServicefits into theAIManagerprovider hierarchy alongsideAnthropicServiceandGeminiService - Why the local CLI path is developer-only and what the Settings UI communicates to make that boundary clear
- What the bug-report chat page injects into the bootstrap prompt before the first message
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
Recap
LocalCliServicespawnsclaude --output-format stream-jsonand emits Tauri events as delta lines arrive; it shares the same trait shape as the Anthropic and Gemini providers.- The Settings → AI provider picker defaults to
LocalCliand labels it “Developer mode (requiresclaudeCLI)” — beta testers use the HTTPS providers instead. - The bug-report page bootstraps the conversation with route, logs, screenshot, and store snapshot before the first user message.
What changed {#what-changed}
This feature shipped in CAS-1931. See: CHANGELOG → 2026-05-18