mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #990] [Feature]: X Claude Subscription #481
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#481
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?
Originally created by @aeriondyseti on GitHub (May 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/990
What problem does this solve?
The claude_subscription provider folds the whole chat history into one big User: ... / Assistant: ... string prompt, then sends that as the request. This kills prompt caching — every turn, that string is slightly different (new user message at the end), so the cache key changes and we pay full input-token cost every time. With real multi-turn messages we'd actually get cache hits on the stable prefix.
Two other things break as side effects:
Proposed solution
Stop folding. Use the Claude Agent SDK's resume option — it's exactly built for this.
Before each query() call, write a temp JSONL file at ~/.claude/projects/{cwd-as-dashes}/{uuid}.jsonl with one entry per prior turn (proper tool_use / tool_result / image blocks). Pass resume: {uuid} in SDK options. Send only the current user message as prompt. Delete the file in finally. Sweep orphans on server boot.
Two new modules under packages/server/src/services/llm/providers/claude-subscription/:
Kill switch: env var CLAUDE_SUBSCRIPTION_USE_RESUME (default false to make this opt-in). Set to false to go back to the current fold path if anything explodes. On Windows or if ~/.claude/projects/ isn't writable, falls back automatically with a one-time warn. (I don't have access to a Windows machine to see how the project directories are constructed.)
Alternatives considered
Additional context
~/.claude/projects/{cwd-with-slashes-as-dashes}/{sessionId}.jsonl. We just write the file ourselves before calling.
node:test via tsx --test, no new devDependencies, 34 unit tests for the new modules only. Doesn't touch pnpm check. I can remove this if you'd likeTemplate check
@aeriondyseti commented on GitHub (May 19, 2026):
Picking this up on
feat/claude-subscription-jsonl-resume(work-in-progress fork: https://github.com/aeriondyseti/Marinara-Engine/tree/feat/claude-subscription-jsonl-resume).Current status: pure JSONL builder + FS lifecycle modules landed on the branch with 34 unit tests passing. Provider rewiring (the actual swap from transcript-fold to SDK
resume) is the next commit. Draft PR will go up againststagingonce that lands.@cha1latte commented on GitHub (May 19, 2026):
Triage note: labeling this as
scope-riskbecause the request replaces Claude Subscription transcript folding with SDK resume plus JSONL session lifecycle, cleanup behavior, and tool/image history preservation.The least risky next step is to keep this tied to the active draft PR and require focused provider verification before it is marked ready.