[PR #294] [MERGED] fix(connections): support Claude Subscription helper routes #4550

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/294
Author: @Morgul
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @SpicyMarinara

Base: main ← Head: codex/fix-claude-subscription-provider


📝 Commits (1)

  • 5a7851b fix(connections): support Claude Subscription helper routes

📊 Changes

10 files changed (+25 additions, -3 deletions)

View changed files

📝 packages/server/src/routes/character-maker.routes.ts (+2 -0)
📝 packages/server/src/routes/encounter.routes.ts (+3 -0)
📝 packages/server/src/routes/game.routes.ts (+3 -0)
📝 packages/server/src/routes/lorebook-maker.routes.ts (+2 -0)
📝 packages/server/src/routes/persona-maker.routes.ts (+2 -0)
📝 packages/server/src/routes/prompt-reviewer.routes.ts (+2 -0)
📝 packages/server/src/routes/scene.routes.ts (+3 -0)
📝 packages/server/src/routes/translate.routes.ts (+2 -0)
📝 packages/server/src/services/llm/providers/claude-subscription.provider.ts (+5 -2)
📝 packages/server/test/claude-subscription-provider.test.ts (+1 -1)

📄 Description

Linked issue

Closes #292

Why this change

  • /scene from a DM fails when Claude Subscription is selected as the connection.
  • The helper route connection resolver expects a normal HTTP base URL, but Claude Subscription is backed by the local Claude Agent SDK.
  • Claude Subscription requests can also fail with error_max_turns because the provider forces maxTurns: 1.

What changed

  • Treats Claude Subscription as a local SDK-backed connection in helper routes by assigning a local sentinel base URL.
  • Updates the Claude Subscription provider so it does not force maxTurns: 1.
  • Updates the Claude Subscription provider test to assert that maxTurns is omitted.

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

  • Manually tested with Claude Subscription selected as the connection.
  • The original failure was encountered by calling /scene from a DM.
  • Observed local failures included:
    • No base URL configured for this connection
    • [commands] Scene creation failed
    • Claude (Subscription) request failed (error_max_turns) — Reached maximum number of turns (1)
  • With this change, the Claude Subscription route path uses the local SDK connection path and does not force a one-turn limit.
  • Also ran pnpm --dir packages/server exec tsx --test test/claude-subscription-provider.test.ts successfully.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No screenshot attached. Relevant runtime errors are included in the linked issue.

Summary by CodeRabbit

  • Bug Fixes

    • Removed turn limit constraint from Claude Subscription connections that was prematurely interrupting conversations and causing failures.
  • Chores

    • Enhanced Claude Subscription provider support across API routes to enable local SDK endpoint handling, eliminating configuration errors when external HTTP endpoints are unavailable.

🔄 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/294 **Author:** [@Morgul](https://github.com/Morgul) **Created:** 4/28/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `codex/fix-claude-subscription-provider` --- ### 📝 Commits (1) - [`5a7851b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5a7851b6470d84162e7ef46e2934acd45c0bfebc) fix(connections): support Claude Subscription helper routes ### 📊 Changes **10 files changed** (+25 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/character-maker.routes.ts` (+2 -0) 📝 `packages/server/src/routes/encounter.routes.ts` (+3 -0) 📝 `packages/server/src/routes/game.routes.ts` (+3 -0) 📝 `packages/server/src/routes/lorebook-maker.routes.ts` (+2 -0) 📝 `packages/server/src/routes/persona-maker.routes.ts` (+2 -0) 📝 `packages/server/src/routes/prompt-reviewer.routes.ts` (+2 -0) 📝 `packages/server/src/routes/scene.routes.ts` (+3 -0) 📝 `packages/server/src/routes/translate.routes.ts` (+2 -0) 📝 `packages/server/src/services/llm/providers/claude-subscription.provider.ts` (+5 -2) 📝 `packages/server/test/claude-subscription-provider.test.ts` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #292 ## Why this change - `/scene` from a DM fails when Claude Subscription is selected as the connection. - The helper route connection resolver expects a normal HTTP base URL, but Claude Subscription is backed by the local Claude Agent SDK. - Claude Subscription requests can also fail with `error_max_turns` because the provider forces `maxTurns: 1`. ## What changed - Treats Claude Subscription as a local SDK-backed connection in helper routes by assigning a local sentinel base URL. - Updates the Claude Subscription provider so it does not force `maxTurns: 1`. - Updates the Claude Subscription provider test to assert that `maxTurns` is omitted. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] 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 - Manually tested with Claude Subscription selected as the connection. - The original failure was encountered by calling `/scene` from a DM. - Observed local failures included: - `No base URL configured for this connection` - `[commands] Scene creation failed` - `Claude (Subscription) request failed (error_max_turns) — Reached maximum number of turns (1)` - With this change, the Claude Subscription route path uses the local SDK connection path and does not force a one-turn limit. - Also ran `pnpm --dir packages/server exec tsx --test test/claude-subscription-provider.test.ts` successfully. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No screenshot attached. Relevant runtime errors are included in the linked issue. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Removed turn limit constraint from Claude Subscription connections that was prematurely interrupting conversations and causing failures. * **Chores** * Enhanced Claude Subscription provider support across API routes to enable local SDK endpoint handling, eliminating configuration errors when external HTTP endpoints are unavailable. <!-- 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:37 +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#4550
No description provided.