Skip to content

feat(summary): "Claude Code" provider — summaries on your subscription - #22

Merged
emretheus merged 1 commit into
mainfrom
feat/claude-code-summary-provider
May 27, 2026
Merged

feat(summary): "Claude Code" provider — summaries on your subscription#22
emretheus merged 1 commit into
mainfrom
feat/claude-code-summary-provider

Conversation

@emretheus

Copy link
Copy Markdown
Owner

Adds a third Generate Summary provider — generate the meeting summary with the locally-installed claude CLI 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

  • Backend (llm/providers.py): new claude-code provider. _claude_code_json runs 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 CLI's result envelope's .result field. (Verified empirically: --json-schema routes data into the agent transcript, not .result, so we prompt + parse.)
  • Keyless: excluded from the no-key→Ollama downgrade and the Ollama model-existence check. Missing CLI / nonzero exit / timeout → ClaudeCodeError → graceful empty schema (same as other providers' parse failures).
  • Frontend: claude-code in the provider union + dropdown; keyless llmRequestConfig; 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, the ProcessRequest route, the schema classes, and the DB write in process_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

…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
emretheus merged commit 4bac9e8 into main May 27, 2026
4 checks passed
@emretheus
emretheus deleted the feat/claude-code-summary-provider branch May 27, 2026 15:41
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant