mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7648] [MERGED] feat(connections): Claude and ChatGPT plan usage in the subscription meter #7855
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#7855
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/7648
Author: @ylli-selmani
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @ylli-selmani
Base:
staging← Head:feat/claude-subscription-usage📝 Commits (6)
77857defeat(connections): show Claude plan usage on Claude (Subscription) connectionsf653a71feat(connections): show ChatGPT plan usage on OpenAI (ChatGPT) connections8363048feat(connections): show when NanoGPT's usage window resets9b13745fix(connections): never read a reset under an hour away as "in 0h"093670edocs(connections): say the NanoGPT meter shows when its window resets12dd69afix(connections): read Claude plan usage with the same Claude Code as chat📊 Changes
23 files changed (+838 additions, -110 deletions)
View changed files
📝
docs/connections/providers-reference.md(+32 -1)📝
e2e/nanogpt-usage.e2e.ts(+2 -2)📝
packages/client/src/components/chat/QuickConnectionSwitcher.tsx(+4 -4)📝
packages/client/src/components/chat/QuickSwitcherMobile.tsx(+4 -4)📝
packages/client/src/components/connections/ConnectionEditor.tsx(+91 -31)📝
packages/client/src/components/connections/SubscriptionUsageWidget.tsx(+116 -25)📝
packages/client/src/features/chat-settings/sections/ConnectionSection.tsx(+5 -5)📝
packages/client/src/hooks/use-connections.ts(+8 -4)📝
packages/client/src/lib/connection-filters.ts(+29 -5)📝
packages/client/src/lib/relative-time.ts(+19 -0)📝
packages/client/src/localization/locales/en.json(+13 -0)📝
packages/server/src/db/schema/connections.ts(+4 -1)📝
packages/server/src/routes/connections.routes.ts(+37 -5)➕
packages/server/src/services/llm/openai-chatgpt-usage.ts(+104 -0)📝
packages/server/src/services/llm/providers/claude-subscription.provider.ts(+1 -1)➕
packages/server/src/services/llm/providers/claude-subscription/plan-usage.ts(+117 -0)📝
packages/server/src/services/storage/connections.storage.ts(+10 -5)📝
packages/shared/src/constants/providers.ts(+13 -0)📝
packages/shared/src/schemas/connection.schema.ts(+4 -1)📝
packages/shared/src/types/connection.ts(+30 -1)...and 3 more files
📄 Description
Requested by Ylli
Linked issue
Closes #7646
Why this change
What changed
/usage). No prompt is sent, so a reading spends nothing. The SDK marks this call as experimental, so it lives in one file (claude-subscription/plan-usage.ts) and a failure shows "unavailable", never a fake 0%.openai-chatgpt-usage.ts).NanoGptUsageWidgetbecameSubscriptionUsageWidget, and the gate and hook got provider-neutral names. Plan windows render as "58% · resets in 2h" in the connection editor, the chat's Connection settings and the Connections quick switcher (desktop and phone).docs/connections/providers-reference.md.claude-plan-usageandopenai-chatgpt-plan-usagecover window parsing, fractions and unavailable plans;nanogpt-usage-meter-gatecovers the new providers.Plans report percentages and reset times only, and their numbers are account-wide, not Marinara's share; the editor says so under the bars. Grok CLI (Subscription) is left out because it has no documented way to read usage, and Google Vertex AI is pay-per-use. Other subscriptions with a usage endpoint can be added later on the same
windowsshape.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What the agent ran:
pnpm check(including the build) passed after the rebase onto current staging, andnode scripts/run-regressions.mjs --filter plan-usage/--filter nanogptpassed (6/6). The Claude meter was checked against a real Pro plan, and the NanoGPT "resets in" against a real NanoGPT subscription, both in the editor and the quick switcher. Local CodeRabbit found two items: a reset just under an hour away could read "in 0h" (fixed), and the docs-i18n follow-up (opened, see below).Still to verify by hand:
codex login. It has only been tested against the payload shape from the Codex source.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/connections/providers-reference.mdchanged; the translated packs are tracked in #7647.UI evidence (if applicable)
Screenshots to be attached: the Claude meter in the connection editor, the quick switcher, and the NanoGPT "resets in" in both.
🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.