Skip to content

fix(codex): treat expired subscriptions as free - #1986

Open
Jonesxq wants to merge 1 commit into
jlcodes99:mainfrom
Jonesxq:fix/codex-expired-subscription-plan
Open

fix(codex): treat expired subscriptions as free#1986
Jonesxq wants to merge 1 commit into
jlcodes99:mainfrom
Jonesxq:fix/codex-expired-subscription-plan

Conversation

@Jonesxq

@Jonesxq Jonesxq commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 根据 plan_typesubscription_active_until 计算 Codex 账号的有效套餐,启动时就把已过期的 Plus/Pro 账号显示并分组为 FREE。
  • 保留 API key、待授权、Agent Identity 和 ChatGPT Web Session 的特殊分类,不误降级这些账号。
  • 让 Codex 本地 API 服务的免费账号限制也使用有效套餐判断,避免过期付费账号绕过或错误占用免费账号策略。
  • 增加过期 Plus/Pro、有效订阅、缺失/非法有效期、特殊账号和本地 API 服务限制的回归测试。

Root cause

应用启动时读取的账号缓存仍保留原始付费 plan_type,而标签、筛选分组和本地 API 服务限制直接使用该字段。手动刷新订阅后数据才被更新,所以首次打开会暂时显示 PLUS。

Validation

  • node --test --test-isolation=none --test-concurrency=1 src/types/codex.test.ts src/utils/codexLocalAccessAccounts.test.ts src/utils/codexApiKeyAccountScope.test.ts(19/19)
  • npm run typecheck
  • npm run build

Related

Fixes #1895

Related to #1907; this branch is rebased on the current v1.3.22 main so the fix can be reviewed against the latest code.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex Plus等已过期账号 为什么还出现在Plus组里面,他已经变成Free了。但是每次还是会出现在Plus组里面

1 participant