mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #549] [MERGED] Fix Claude (Subscription) silent model identity loss #4667
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#4667
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/549
Author: @LukaTheHero
Created: 5/8/2026
Status: ✅ Merged
Merged: 5/8/2026
Merged by: @LukaTheHero
Base:
main← Head:fix/claude-subscription-fast-mode-downgrade📝 Commits (1)
332ebacFix Claude (Subscription) silent model identity loss📊 Changes
10 files changed (+414 additions, -1 deletions)
View changed files
📝
packages/client/src/components/connections/ConnectionEditor.tsx(+223 -0)📝
packages/client/src/hooks/use-connections.ts(+19 -0)📝
packages/server/src/db/migrate.ts(+5 -0)📝
packages/server/src/db/schema/connections.ts(+8 -0)📝
packages/server/src/routes/connections.routes.ts(+92 -0)📝
packages/server/src/routes/generate.routes.ts(+1 -0)📝
packages/server/src/services/llm/provider-registry.ts(+3 -0)📝
packages/server/src/services/llm/providers/claude-subscription.provider.ts(+57 -1)📝
packages/server/src/services/storage/connections.storage.ts(+5 -0)📝
packages/shared/src/schemas/connection.schema.ts(+1 -0)📄 Description
Summary
Roleplays on Claude (Subscription) felt much dumber than they should because the SDK was stripping the model's version awareness, and quality regressions were impossible to diagnose because the model itself would lie about which model it was.
Root cause
The Claude Agent SDK strips a model's version awareness when
systemPromptis passed as a plain string. Without theclaude_codepreset wrapping, every model — Opus, Sonnet, Haiku — falsely answers"Sonnet"when asked which model it is, because it has no framing for its own identity and falls back to the most-mentioned variant in its training data. Self-id is reliable when the preset is in place:opus → "Opus",sonnet → "Sonnet",haiku → "Haiku".What changed
claude-subscription.provider.ts— wraps the caller's system content as theappendof{ type: 'preset', preset: 'claude_code' }. Identity now matches the model that's actually running, matching theclaudeCLI default. This is the load-bearing fix for the roleplay quality issue.UserPromptSubmithook for auto-titling (overhead, not your output). The card explains this so users don't misread it as a downgrade.modelUsageshows the SDK billed against a model different from the one requested — catches future silent downgrades.claude_fast_modecolumn onapi_connections, applied automatically on next server start.Notes
CONTRIBUTING.md § Before You Open a Pull Request?Roleplay generation: claude-opus-4-7with self-id"Opus". Roleplay quality felt noticeably restored after the fix.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.