docs: ADR-0028 — CLI agent only, remove API key (supersedes ADR-0027)

This commit is contained in:
Test
2026-03-28 18:44:46 +01:00
parent f80339a0ed
commit d7f18f79c1
3 changed files with 37 additions and 2 deletions

View File

@@ -2,7 +2,8 @@
type: ADR
id: "0027"
title: "Dual AI architecture (API chat + CLI agent)"
status: active
status: superseded
superseded_by: "0028"
date: 2026-03-01
---

View File

@@ -0,0 +1,33 @@
---
type: ADR
id: "0028"
title: "AI integration via CLI agents only — no API key"
status: active
date: 2026-03-28
supersedes: "0027"
---
## Context
Supersedes [ADR-0027](0027-dual-ai-architecture.md).
The dual AI architecture (direct Anthropic API chat + Claude CLI agent) added two codepaths and required users to manage an Anthropic API key in settings — additional friction and complexity for v1. The lightweight API chat panel provided marginal value over the CLI agent for simple questions. Keeping things simple is the priority for the first version of Laputa.
## Decision
**Remove the direct Anthropic API integration (AIChatPanel, api key settings). AI is available exclusively via Claude CLI subprocess with MCP vault integration (AiPanel).** Future CLI agents (Codex, others) may be added as additional options under the same architecture.
## Options considered
- **Option A** (chosen): CLI-agent only. One codepath, no API key management, Claude CLI handles auth. Simpler settings, simpler codebase.
- **Option B** (prior decision): Dual — API chat + CLI agent. Two codepaths, API key required in settings. Rejected: unnecessary complexity for v1.
- **Option C**: API-only with tool calling. Rejected: complex tool-calling loop, no MCP, more code to maintain.
## Consequences
- Remove `AIChatPanel`, `useAIChat` hook, and Rust `ai_chat` command
- Remove Anthropic API key field from settings UI and `useSettings`
- `AiPanel` + `useAiAgent` → Claude CLI subprocess remains as the single AI interface
- Context builder (`ai-context.ts`) stays — used by the agent
- Future: other CLI agents (Codex, etc.) can be added as options in the same agent panel
- Re-evaluation trigger: Claude CLI becomes unavailable or unreliable; or a lightweight SDK handles both simple chat and tool calling with no key management friction

View File

@@ -82,4 +82,5 @@ proposed → active → superseded
| [0024](0024-cache-outside-vault.md) | Vault cache stored outside vault directory | active |
| [0025](0025-type-field-canonical.md) | type: as canonical field (replacing Is A:) | active |
| [0026](0026-props-down-no-global-state.md) | Props-down callbacks-up (no global state) | active |
| [0027](0027-dual-ai-architecture.md) | Dual AI architecture (API chat + CLI agent) | active |
| [0027](0027-dual-ai-architecture.md) | Dual AI architecture (API chat + CLI agent) | superseded |
| [0028](0028-cli-agent-only-no-api-key.md) | AI integration via CLI agents only — no API key | active |