feat(summary): "Claude Code" provider — summaries on your subscription - #22
Merged
Conversation
…n (no key) Adds a third Generate-Summary provider alongside local Ollama and BYOK cloud: run the locally-installed `claude` CLI headless on the user's own Pro/Max subscription. Plugs into the existing multi-provider layer — same structured schema, same DB write, same UI. Backend (llm/providers.py): - New "claude-code" provider. `_claude_code_json` shells out via `claude -p <prompt> --output-format json --model <opus|sonnet|haiku> --no-session-persistence --max-budget-usd 1.0`, asks for ONLY a JSON object matching the Pydantic schema, and parses the `.result` field of the CLI's result envelope (verified: --json-schema routes data into the agent transcript, not .result, so we prompt + parse instead). - Keyless: excluded from the no-key→Ollama downgrade in with_defaults and from the Ollama model-existence check in resolve. Missing CLI / nonzero exit / timeout raise ClaudeCodeError → graceful empty schema (same as other providers' parse failures). - Tests mock the CLI (no real claude in CI): result parsing, fence stripping, model-alias defaulting, missing-CLI + nonzero-exit degradation, keyless config. Frontend: - prefs: 'claude-code' in the summaryProvider union (default stays ollama). - backend.ts llmRequestConfig: keyless (skip apikeyGet) like ollama. - Settings → Summary: a "Claude Code (your subscription, no key)" option with a model picker (opus/sonnet/haiku), a live "detected / not installed" status (reusing claudeAvailable), and a privacy note (transcript goes to Anthropic via the user's own Claude Code session). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
emretheus
added a commit
that referenced
this pull request
May 27, 2026
…n (no key) (#22) Adds a third Generate-Summary provider alongside local Ollama and BYOK cloud: run the locally-installed `claude` CLI headless on the user's own Pro/Max subscription. Plugs into the existing multi-provider layer — same structured schema, same DB write, same UI. Backend (llm/providers.py): - New "claude-code" provider. `_claude_code_json` shells out via `claude -p <prompt> --output-format json --model <opus|sonnet|haiku> --no-session-persistence --max-budget-usd 1.0`, asks for ONLY a JSON object matching the Pydantic schema, and parses the `.result` field of the CLI's result envelope (verified: --json-schema routes data into the agent transcript, not .result, so we prompt + parse instead). - Keyless: excluded from the no-key→Ollama downgrade in with_defaults and from the Ollama model-existence check in resolve. Missing CLI / nonzero exit / timeout raise ClaudeCodeError → graceful empty schema (same as other providers' parse failures). - Tests mock the CLI (no real claude in CI): result parsing, fence stripping, model-alias defaulting, missing-CLI + nonzero-exit degradation, keyless config. Frontend: - prefs: 'claude-code' in the summaryProvider union (default stays ollama). - backend.ts llmRequestConfig: keyless (skip apikeyGet) like ollama. - Settings → Summary: a "Claude Code (your subscription, no key)" option with a model picker (opus/sonnet/haiku), a live "detected / not installed" status (reusing claudeAvailable), and a privacy note (transcript goes to Anthropic via the user's own Claude Code session). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a third Generate Summary provider — generate the meeting summary with the locally-installed
claudeCLI on the user's own Pro/Max subscription (no API key). Complements the embedded-terminal feature (#19–21): that was interactive; this is the deterministic, one-click summary path. Saves through the existing pipeline (same schema, same DB write, same UI).How
llm/providers.py): newclaude-codeprovider._claude_code_jsonrunsclaude -p <prompt> --output-format json --model <opus|sonnet|haiku> --no-session-persistence --max-budget-usd 1.0, asks for ONLY a JSON object matching the Pydantic schema, and parses the CLI's result envelope's.resultfield. (Verified empirically:--json-schemaroutes data into the agent transcript, not.result, so we prompt + parse.)ClaudeCodeError→ graceful empty schema (same as other providers' parse failures).claude-codein the provider union + dropdown; keylessllmRequestConfig; Settings → Summary shows a model picker (opus/sonnet/haiku), a live "detected/not installed" status, and a privacy note (transcript goes to Anthropic via the user's own Claude session).Why minimal
Reuses
structured_complete,LlmConfig, theProcessRequestroute, the schema classes, and the DB write inprocess_meeting— all unchanged. Only the source of the summary JSON changes.Verified
Backend: ruff + mypy (45 files) + pytest (82, incl. 6 new mocked-CLI tests). Frontend: typecheck + lint + build green. Mocked CLI in CI (no real
claude).🤖 Generated with Claude Code