Conversation
Fetch /backend-api/subscriptions independently of quota refresh, share records by chatgpt_account_id, and prefer subscriptions.activeUntilMs for list remaining days. Paid Codex gets a gated Subscription tab. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Replace the brittle renderer tab test with field-builder coverage and assert the demo api-call subscriptions payload. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Replace the unstyled field dump with Quota-style summary metric cards and an Overview field grid for secondary billing details. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Keep the new tab tests stable under react-test-renderer and match Prettier. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Show the formatted until time as the metric value and remaining days as a second line so the 4-card row no longer ellipsizes "2 days". Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Subscription tab UI (visual check)Local dev:demo after polish commits 6c0c77b / 3be5656 (Quota-style summary cards + until two-line). BeforeAfter — Subscription (Pro 20x)
After — Quota still OK (no regression) |
Keep the absolute until timestamp as the overview card hero and leave remaining days only in the value tooltip. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Replace the seakee#745 After shot so 有效期至 / Active until shows the absolute timestamp only, with no remaining-days line on the card face. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
|
感谢实现。方向本身和 #743 一致,但这里有一个更前置的问题需要先确认。 当前核心链路是: CPAMP -> CPA /v0/management/api-call -> /backend-api/subscriptions 我检查了 CPA 当前正式 release / main,现有 management/api-call 仍使用标准 Go HTTP transport,并没有 #5769 / #5774 中增加的 ChatGPT Web TLS fingerprint 能力。#5774 目前也未合并,因此 CPAMP 不能把这类未进入正式 CPA 的能力作为功能成立前提。 请先使用未经修改的当前正式 CPA验证 /backend-api/subscriptions?account_id=... 是否能通过现有 management/api-call 稳定返回 JSON。 如果只有应用 #5774 这类修改后才能正常工作,那么当前方案缺少 CPAMP 可依赖的正式上游能力。仅靠 subscriptions -> wham -> JWT fallback 只能保证不回归,并不能真正解决 #743 中 wham 不可用、JWT 可能陈旧的问题。 CPAMP 侧也不适合自行实现 ChatGPT Web TLS / fingerprint transport,这部分应继续属于 CPA。 所以先确认这个前置条件:
#5769 / #5774 可以作为技术验证参考,但目前不能作为 CPAMP 的正式依赖。 |
|
感谢确认前置条件。我按你的要求做了对照: 环境:官方镜像
结论:当前正式 CPA 的 management/ 同意:CPAMP 不应自行实现 ChatGPT Web TLS / fingerprint,这部分继续属于 CPA。#5774 仅作技术验证参考,不作为 CPAMP 正式依赖。 |
Reject unmatched array payloads, mark post-ready fetch failures as soft_failed with retry cooldown, resolve ready store records when callers omit subscriptionsRecord, and rotate a sibling authIndex after http/network soft-fail. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
…builds Keep token-scoped objects without account-id, but return null for mismatched object/nested payloads. Preserve a fresh ready record when a chained force soft-fails. Re-run target ensure when subscriptionEntries change so sibling authIndex rotate actually schedules, and include subscriptionEntries in the rows useMemo deps for seakee#742 sort bake timing. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
…n objects A parent account-id that is not the requested account must not adopt a nested token-scoped object. Nested arrays under an envelope id can still select a matching per-account element. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Honor triedAuthIndexes for 3+ siblings, keep ready only for chained force after a just-ready inflight, default demo subscriptions to free when plan is missing, hide the tab when the API plan is free, and search dual-key subscriptions arrays before token-scoped sibling objects. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>
Replace the seakee#745 After shot so 有效期至 / Active until is date-only, with remaining days only in the tooltip. Refresh quota tab shot too. Co-authored-by: 程辉 <HuiCheng@users.noreply.github.com>



Screenshots (Subscription UI polish)
Quota unchanged:
Summary
按 #743 维护者方向,增加轻量 Codex Subscription:慢刷新、按
chatgpt_account_id共享、非 Free 详情 Tab;套餐到期时间优先级为 subscriptions > wham > JWT。配额(wham/usage)刷新链路不变。Scope
Changes
codexSubscription模块:解析/backend-api/subscriptions、30 分钟 TTL store、同账号去重、soft-fail。resolveCodexSubscriptionUntilMs/ 列表「剩余天数」统一走 subscriptions > wham > JWT 的同一subscriptionUntilMs(与 fix(accounts): sort Codex rows by plan remaining time #742sort=remaining兼容)。utils/quota/*与AccountQuotaTab的配额刷新语义。User Impact
付费 Codex 账号可在详情看到订阅元数据;列表剩余天数在 subscriptions 可用时更贴近真实
active_until。Free / 其他 Provider 无此 Tab。依赖 CPA managementapi-call能对 ChatGPT 返回 JSON(Chrome TLS,见 CLIProxyAPI 相关修复)。Compatibility / Runtime Notes
api-call拉 subscriptions。Data / Security Notes
经已有 management
api-call使用账号 token 请求 ChatGPT;不新增密钥存储。soft-fail 不清理配额状态。Risk / Rollback
Risk level: Medium
Rollback notes: 回退本 PR 提交即可;配额链路未改。若 CPA 侧 TLS 未就绪,subscriptions 会 soft-fail 并回落 wham/JWT。
Verification
Commands / evidence:
Screenshots / Recordings
待合入前补录:付费 Codex 详情 Subscription Tab;列表剩余天数在 subscriptions 成功时的展示。可先看 fork 工作 PR:HuiCheng#4
Docs
Docs decision: 沿用现有账号详情 Tab / 列表控件;新增能力以 Issue #743 与本 PR 说明为准,暂不扩 README(若维护者要求再补)。
Related
Refs #743
Fork working PR: HuiCheng#4
CPA TLS 依赖: router-for-me/CLIProxyAPI#5769