From 2f6b53776f7192e2de3a3d834d4fc56b9b803568 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Sat, 28 Mar 2026 18:44:46 +0100 Subject: [PATCH] =?UTF-8?q?docs:=20ADR-0028=20=E2=80=94=20CLI=20agent=20on?= =?UTF-8?q?ly,=20remove=20API=20key=20(supersedes=20ADR-0027)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/adr/0027-dual-ai-architecture.md | 3 +- docs/adr/0028-cli-agent-only-no-api-key.md | 33 ++++++++++++++++++++++ docs/adr/README.md | 3 +- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 docs/adr/0028-cli-agent-only-no-api-key.md diff --git a/docs/adr/0027-dual-ai-architecture.md b/docs/adr/0027-dual-ai-architecture.md index fe8a5151..42eb4228 100644 --- a/docs/adr/0027-dual-ai-architecture.md +++ b/docs/adr/0027-dual-ai-architecture.md @@ -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 --- diff --git a/docs/adr/0028-cli-agent-only-no-api-key.md b/docs/adr/0028-cli-agent-only-no-api-key.md new file mode 100644 index 00000000..d8929abc --- /dev/null +++ b/docs/adr/0028-cli-agent-only-no-api-key.md @@ -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 diff --git a/docs/adr/README.md b/docs/adr/README.md index 64e52aa7..250c771c 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -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 |