[PR #243] [MERGED] feat(connections): add Claude (Subscription) provider via Claude Agent SDK #4528

Closed
opened 2026-10-22 04:08:26 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/243
Author: @LukaTheHero
Created: 4/26/2026
Status: ✅ Merged
Merged: 4/26/2026
Merged by: @LukaTheHero

Base: main ← Head: feat/claude-subscription-provider


📝 Commits (2)

  • d38e4ed feat(connections): add Claude (Subscription) provider via Claude Agent SDK
  • cf39735 Potential fix for pull request finding 'Useless conditional'

📊 Changes

14 files changed (+1165 additions, -18 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/FAQ.md (+1 -1)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+70 -15)
📝 packages/server/package.json (+1 -0)
📝 packages/server/src/db/schema/connections.ts (+12 -1)
📝 packages/server/src/routes/connections.routes.ts (+33 -1)
📝 packages/server/src/services/llm/provider-registry.ts (+9 -0)
➕ packages/server/src/services/llm/providers/claude-subscription.provider.ts (+226 -0)
➕ packages/server/test/claude-subscription-provider.test.ts (+223 -0)
📝 packages/shared/src/constants/model-lists.ts (+16 -0)
📝 packages/shared/src/constants/providers.ts (+12 -0)
📝 packages/shared/src/schemas/connection.schema.ts (+1 -0)
📝 packages/shared/src/types/connection.ts (+1 -0)
📝 pnpm-lock.yaml (+559 -0)

📄 Description

…t SDK

Routes chat through the locally-installed Claude Agent SDK so requests bill against the user's Anthropic Pro / Max subscription instead of an sk-ant-* API key. Same auth mechanism Anthropic-endorsed integrations like Visual Studio Code, Cursor, and Zed use — no proxy or third-party shim is involved.

Why: Marinara users with paid Claude subscriptions previously had no path to use them inside Marinara without buying additional API credits on top of the subscription they already pay for. The Agent SDK is Anthropic's public, documented mechanism for this exact use case.

Changes:

  • New claude_subscription provider registered in shared types, providers constant, model lists, Zod schema, and DB schema enum
  • New ClaudeSubscriptionProvider wrapping query() from @anthropic-ai/claude-agent-sdk — streams text deltas, forwards thinking content, defaults to adaptive thinking on Opus 4.7+
  • Connection routes short-circuit HTTP-only paths (test, /models, test-message) for the SDK provider since there is no remote endpoint
  • Connection editor: themed prerequisites notice (Visual Studio Code reference for context), disables Base URL and API Key inputs (managed by the SDK), hides irrelevant fields (Max Tokens Override, embedding model/endpoint/connection, base-URL warning)
  • 9 unit tests covering streaming, transcript rendering, thinking, env fallback, error surfacing, embeddings rejection
  • CHANGELOG and docs/FAQ updated; pnpm-lock regenerated

Built-in agent tools (Bash, Read, Write, etc.) are explicitly disabled — Marinara has its own agent/tool layer. Embeddings are not supported on this provider; users must configure a separate connection for them.

Prerequisites for the host running Marinara:

  1. npm i -g @anthropic-ai/claude-code
  2. claude login

Why this change

What changed

Validation

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Claude (Subscription) connection provider to bill against Anthropic Pro/Max subscription instead of API keys
    • Requires locally-installed Claude Code Agent SDK and claude login authentication
    • Agent tools managed by Marinara for this provider
    • Embeddings unsupported for Claude subscription
  • Documentation

    • Updated FAQ and changelog with Claude subscription provider details

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for Claude Subscription as a new LLM provider, enabling routing through locally-installed Claude Agent SDK to bill against Anthropic Pro/Max subscriptions.
    • Claude Subscription connections authenticate via Claude CLI instead of API keys.
    • Added Claude model catalog with context window specifications.
  • Documentation

    • Updated FAQ to clarify Anthropic connectivity via Claude Pro/Max subscription option.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/243 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/26/2026 **Status:** ✅ Merged **Merged:** 4/26/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `feat/claude-subscription-provider` --- ### 📝 Commits (2) - [`d38e4ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d38e4ed164599ad0b1c7b6f49402fd524991f284) feat(connections): add Claude (Subscription) provider via Claude Agent SDK - [`cf39735`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf39735f14b93c640e720e63b3568c0861da241a) Potential fix for pull request finding 'Useless conditional' ### 📊 Changes **14 files changed** (+1165 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/FAQ.md` (+1 -1) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+70 -15) 📝 `packages/server/package.json` (+1 -0) 📝 `packages/server/src/db/schema/connections.ts` (+12 -1) 📝 `packages/server/src/routes/connections.routes.ts` (+33 -1) 📝 `packages/server/src/services/llm/provider-registry.ts` (+9 -0) ➕ `packages/server/src/services/llm/providers/claude-subscription.provider.ts` (+226 -0) ➕ `packages/server/test/claude-subscription-provider.test.ts` (+223 -0) 📝 `packages/shared/src/constants/model-lists.ts` (+16 -0) 📝 `packages/shared/src/constants/providers.ts` (+12 -0) 📝 `packages/shared/src/schemas/connection.schema.ts` (+1 -0) 📝 `packages/shared/src/types/connection.ts` (+1 -0) 📝 `pnpm-lock.yaml` (+559 -0) </details> ### 📄 Description …t SDK Routes chat through the locally-installed Claude Agent SDK so requests bill against the user's Anthropic Pro / Max subscription instead of an sk-ant-* API key. Same auth mechanism Anthropic-endorsed integrations like Visual Studio Code, Cursor, and Zed use — no proxy or third-party shim is involved. Why: Marinara users with paid Claude subscriptions previously had no path to use them inside Marinara without buying additional API credits on top of the subscription they already pay for. The Agent SDK is Anthropic's public, documented mechanism for this exact use case. Changes: - New `claude_subscription` provider registered in shared types, providers constant, model lists, Zod schema, and DB schema enum - New `ClaudeSubscriptionProvider` wrapping `query()` from `@anthropic-ai/claude-agent-sdk` — streams text deltas, forwards thinking content, defaults to adaptive thinking on Opus 4.7+ - Connection routes short-circuit HTTP-only paths (test, /models, test-message) for the SDK provider since there is no remote endpoint - Connection editor: themed prerequisites notice (Visual Studio Code reference for context), disables Base URL and API Key inputs (managed by the SDK), hides irrelevant fields (Max Tokens Override, embedding model/endpoint/connection, base-URL warning) - 9 unit tests covering streaming, transcript rendering, thinking, env fallback, error surfacing, embeddings rejection - CHANGELOG and docs/FAQ updated; pnpm-lock regenerated Built-in agent tools (Bash, Read, Write, etc.) are explicitly disabled — Marinara has its own agent/tool layer. Embeddings are not supported on this provider; users must configure a separate connection for them. Prerequisites for the host running Marinara: 1. npm i -g @anthropic-ai/claude-code 2. claude login ## Why this change <!-- What user problem, bug, or goal does this solve? --> ## What changed <!-- List the key changes in this PR --> - ## Validation ## Summary by CodeRabbit ## Release Notes * **New Features** * Added Claude (Subscription) connection provider to bill against Anthropic Pro/Max subscription instead of API keys * Requires locally-installed Claude Code Agent SDK and `claude login` authentication * Agent tools managed by Marinara for this provider * Embeddings unsupported for Claude subscription * **Documentation** * Updated FAQ and changelog with Claude subscription provider details <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added support for Claude Subscription as a new LLM provider, enabling routing through locally-installed Claude Agent SDK to bill against Anthropic Pro/Max subscriptions. * Claude Subscription connections authenticate via Claude CLI instead of API keys. * Added Claude model catalog with context window specifications. * **Documentation** * Updated FAQ to clarify Anthropic connectivity via Claude Pro/Max subscription option. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:08:26 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4528
No description provided.