[PR #7314] [MERGED] fix(claude-subscription): use the installed Claude Code and its model catalog #7681

Closed
opened 2026-10-24 04:06:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7314
Author: @dariusjm290-code
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/claude-subscription-installed-cli


📝 Commits (8)

  • 8dc4c80 fix(claude-subscription): use the installed Claude Code and its model catalog
  • b13baca fix(claude-subscription): use the curated list only when Claude Code has no catalog
  • 3d56508 fix(claude-subscription): keep the curated list for API-key connections
  • 01ef90a fix(claude-subscription): skip the catalog without a known Claude Code version
  • 88ae21b fix(claude-subscription): address review on installed Claude Code selection
  • 852969a feat(claude-subscription): add CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI opt-out
  • 5cf7727 fix(claude-subscription): keep the username out of the Claude Code debug log
  • ecdb5ac Merge branch 'staging' of https://github.com/Pasta-Devs/Marinara-Engine into fix/claude-subscription-installed-cli

📊 Changes

10 files changed (+308 additions, -19 deletions)

View changed files

📝 .env.example (+4 -0)
📝 CHANGELOG.md (+1 -0)
📝 docs/CONFIGURATION.md (+13 -12)
📝 packages/server/src/config/runtime-config.ts (+11 -0)
📝 packages/server/src/routes/connections.routes.ts (+20 -3)
📝 packages/server/src/services/llm/providers/claude-subscription.provider.ts (+4 -0)
➕ packages/server/src/services/llm/providers/claude-subscription/installed-cli.ts (+166 -0)
📝 packages/shared/src/constants/model-lists.ts (+6 -3)
➕ scripts/regressions/claude-subscription-installed-cli.regression.ts (+81 -0)
📝 scripts/regressions/provider-compat.regression.ts (+2 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7313

Why this change

Claude (Subscription) runs the Claude Code build bundled with @anthropic-ai/claude-agent-sdk (2.1.282 with SDK 0.3.282) and shows a hard-coded model list. New Claude models, most recently Claude Haiku 5.5, need a newer Claude Code than the bundled build and are missing from the list, so they can't be used until someone bumps the SDK and edits the list. That has already happened several times. The native claude install updates itself and Claude Code caches the account's model list locally, so Marinara can follow both instead of waiting for a release.

What changed

  • New claude-subscription/installed-cli.ts: finds the host's Claude Code (~/.local/bin/claude, then claude on PATH; claude.exe on Windows), reads its version, and uses it only when it is at least as new as the SDK's bundled build (read from the SDK's manifest.json). The result is cached for 5 minutes, so auto-updates are picked up without a restart.
  • The chat provider and the Diagnose route pass that path as the Agent SDK's pathToClaudeCodeExecutable. Without a host install, or when it is older, the bundled build is used exactly as before (Docker, fresh hosts).
  • The model picker for Claude (Subscription) now lists Claude Code's cached catalog for the signed-in organization (<config dir>/cache/model-catalog/<org>-*-cc.json, honoring CLAUDE_CONFIG_DIR). It drops models whose min_claude_code_version is newer than the build in use and never reads another organization's catalog. The curated list remains the fallback when no catalog exists, the Claude Code version is unknown, or the connection bills an API key.
  • Added claude-haiku-5-5 and claude-fable-5-1 to the curated fallback list.
  • Regression: scripts/regressions/claude-subscription-installed-cli.regression.ts (version compare, install selection and no-downgrade, catalog org/version filtering, CLAUDE_CONFIG_DIR).
  • CHANGELOG entry under [Unreleased].

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

What the agent ran (not a substitute for the checks above):

  • pnpm check passed on the final commit.
  • node ./scripts/run-regressions.mjs --filter scripts/regressions/claude-subscription passed (new regression and the existing cache regression); claude-opus55 and claude-sonnet55 regressions passed earlier on this branch.
  • On macOS (Apple silicon) with host Claude Code 2.1.294, a script calling the provider picked ~/.local/bin/claude over the bundled 2.1.282, the catalog listed claude-haiku-5-5 and claude-fable-5-1, and real claude-haiku-5-5 requests succeeded for a single message and for a multi-turn chat (resume path).

Still to verify by hand:

  • Manually verify in the app that a Claude (Subscription) connection's model picker lists Claude Haiku 5.5 when Claude Code is installed and signed in, and that a chat on Haiku 5.5 replies.
  • Manually verify Diagnose on a Claude (Subscription) connection still reports the requested model.
  • Manually verify in Docker (no host Claude Code) that the picker shows the curated list and chats still work with the bundled build.
  • Manually verify a Claude (Subscription) connection with an API key set shows the curated list.

Local CodeRabbit review

Ran coderabbit review --committed --base origin/staging three times (six findings):

  • Fixed: the curated list re-added models the account's catalog left out → curated list is now used only without a catalog.
  • Fixed: API-key connections were shown the subscription catalog → they keep the curated list.
  • Fixed: version probe timeout lowered from 10 s to 5 s (a timeout falls back to the bundled build).
  • Fixed: catalog is skipped when no Claude Code version is known, since min_claude_code_version can't be checked.
  • Not changed: npm-installed Claude Code on Windows (claude.cmd shim) is not detected. That case keeps the bundled build, same as before this PR; the native installer (claude.exe) is detected.
  • Not changed: background refresh of the cached install check. The probe is a ~100 ms claude --version at most every 5 minutes, so it isn't worth the extra code.

The last two fixes were not re-reviewed locally because the free OSS CodeRabbit limit was reached; GitHub CodeRabbit will review the full PR.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Only CHANGELOG.md changed; no files under docs/ were touched.

UI evidence (if applicable)

No UI changes; the existing model picker receives a different list.

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary

  • New Features
    • Claude Subscription can use an installed Claude Code version when it is at least as recent as Marinara’s bundled version. Set CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI=false to always use the bundled version.
    • When available, the model list reflects models in your account that are supported by the installed version. Otherwise, Marinara uses its curated list, now including Claude Haiku 5.5 and Claude Fable 5.1. API-key connections use the curated list.
  • Documentation
    • Added configuration guidance for the installed CLI option, including that changes take effect within five minutes without a restart.

🔄 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/7314 **Author:** [@dariusjm290-code](https://github.com/dariusjm290-code) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/claude-subscription-installed-cli` --- ### 📝 Commits (8) - [`8dc4c80`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8dc4c80fa261f5c44f041887885e6db834f45f0f) fix(claude-subscription): use the installed Claude Code and its model catalog - [`b13baca`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b13bacaf558cadb14e4ef8124f5decbb1139b65a) fix(claude-subscription): use the curated list only when Claude Code has no catalog - [`3d56508`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d565081e733a78e13dca3a6a74b476142eb2e5b) fix(claude-subscription): keep the curated list for API-key connections - [`01ef90a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/01ef90a270af5991aa126d2bfda7d2d182f33b4f) fix(claude-subscription): skip the catalog without a known Claude Code version - [`88ae21b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/88ae21bf00d2921f3c5f2fd0e76d2cbcd0fb2993) fix(claude-subscription): address review on installed Claude Code selection - [`852969a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/852969aebc1310d0bf04ddca500d4d6bc88679bd) feat(claude-subscription): add CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI opt-out - [`5cf7727`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5cf77274b38b970b6231c6e6801996a38f1498d8) fix(claude-subscription): keep the username out of the Claude Code debug log - [`ecdb5ac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ecdb5ac7dc6fce199e1c31a40016e9bbfe685dfe) Merge branch 'staging' of https://github.com/Pasta-Devs/Marinara-Engine into fix/claude-subscription-installed-cli ### 📊 Changes **10 files changed** (+308 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+4 -0) 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/CONFIGURATION.md` (+13 -12) 📝 `packages/server/src/config/runtime-config.ts` (+11 -0) 📝 `packages/server/src/routes/connections.routes.ts` (+20 -3) 📝 `packages/server/src/services/llm/providers/claude-subscription.provider.ts` (+4 -0) ➕ `packages/server/src/services/llm/providers/claude-subscription/installed-cli.ts` (+166 -0) 📝 `packages/shared/src/constants/model-lists.ts` (+6 -3) ➕ `scripts/regressions/claude-subscription-installed-cli.regression.ts` (+81 -0) 📝 `scripts/regressions/provider-compat.regression.ts` (+2 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #7313 ## Why this change Claude (Subscription) runs the Claude Code build bundled with `@anthropic-ai/claude-agent-sdk` (2.1.282 with SDK 0.3.282) and shows a hard-coded model list. New Claude models, most recently Claude Haiku 5.5, need a newer Claude Code than the bundled build and are missing from the list, so they can't be used until someone bumps the SDK and edits the list. That has already happened several times. The native `claude` install updates itself and Claude Code caches the account's model list locally, so Marinara can follow both instead of waiting for a release. ## What changed - New `claude-subscription/installed-cli.ts`: finds the host's Claude Code (`~/.local/bin/claude`, then `claude` on PATH; `claude.exe` on Windows), reads its version, and uses it only when it is at least as new as the SDK's bundled build (read from the SDK's `manifest.json`). The result is cached for 5 minutes, so auto-updates are picked up without a restart. - The chat provider and the **Diagnose** route pass that path as the Agent SDK's `pathToClaudeCodeExecutable`. Without a host install, or when it is older, the bundled build is used exactly as before (Docker, fresh hosts). - The model picker for Claude (Subscription) now lists Claude Code's cached catalog for the signed-in organization (`<config dir>/cache/model-catalog/<org>-*-cc.json`, honoring `CLAUDE_CONFIG_DIR`). It drops models whose `min_claude_code_version` is newer than the build in use and never reads another organization's catalog. The curated list remains the fallback when no catalog exists, the Claude Code version is unknown, or the connection bills an API key. - Added `claude-haiku-5-5` and `claude-fable-5-1` to the curated fallback list. - Regression: `scripts/regressions/claude-subscription-installed-cli.regression.ts` (version compare, install selection and no-downgrade, catalog org/version filtering, `CLAUDE_CONFIG_DIR`). - CHANGELOG entry under `[Unreleased]`. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes What the agent ran (not a substitute for the checks above): - `pnpm check` passed on the final commit. - `node ./scripts/run-regressions.mjs --filter scripts/regressions/claude-subscription` passed (new regression and the existing cache regression); `claude-opus55` and `claude-sonnet55` regressions passed earlier on this branch. - On macOS (Apple silicon) with host Claude Code 2.1.294, a script calling the provider picked `~/.local/bin/claude` over the bundled 2.1.282, the catalog listed `claude-haiku-5-5` and `claude-fable-5-1`, and real `claude-haiku-5-5` requests succeeded for a single message and for a multi-turn chat (resume path). Still to verify by hand: - Manually verify in the app that a Claude (Subscription) connection's model picker lists Claude Haiku 5.5 when Claude Code is installed and signed in, and that a chat on Haiku 5.5 replies. - Manually verify **Diagnose** on a Claude (Subscription) connection still reports the requested model. - Manually verify in Docker (no host Claude Code) that the picker shows the curated list and chats still work with the bundled build. - Manually verify a Claude (Subscription) connection with an API key set shows the curated list. ### Local CodeRabbit review Ran `coderabbit review --committed --base origin/staging` three times (six findings): - Fixed: the curated list re-added models the account's catalog left out → curated list is now used only without a catalog. - Fixed: API-key connections were shown the subscription catalog → they keep the curated list. - Fixed: version probe timeout lowered from 10 s to 5 s (a timeout falls back to the bundled build). - Fixed: catalog is skipped when no Claude Code version is known, since `min_claude_code_version` can't be checked. - Not changed: npm-installed Claude Code on Windows (`claude.cmd` shim) is not detected. That case keeps the bundled build, same as before this PR; the native installer (`claude.exe`) is detected. - Not changed: background refresh of the cached install check. The probe is a ~100 ms `claude --version` at most every 5 minutes, so it isn't worth the extra code. The last two fixes were not re-reviewed locally because the free OSS CodeRabbit limit was reached; GitHub CodeRabbit will review the full PR. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Only `CHANGELOG.md` changed; no files under `docs/` were touched. ## UI evidence (if applicable) No UI changes; the existing model picker receives a different list. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary * **New Features** * Claude Subscription can use an installed Claude Code version when it is at least as recent as Marinara’s bundled version. Set `CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI=false` to always use the bundled version. * When available, the model list reflects models in your account that are supported by the installed version. Otherwise, Marinara uses its curated list, now including Claude Haiku 5.5 and Claude Fable 5.1. API-key connections use the curated list. * **Documentation** * Added configuration guidance for the installed CLI option, including that changes take effect within five minutes without a restart. <!-- 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-24 04:06:28 +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#7681
No description provided.