Skip to content

feat: show plan and auth expiry in list output - #174

Merged
Loongphy merged 7 commits into
mainfrom
feat/list-plan-expiry
Oct 25, 2026
Merged

Loongphy merged 7 commits into
mainfrom
feat/list-plan-expiry

Conversation

@Loongphy

@Loongphy Loongphy commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Plain list now shows both PLAN EXPIRE and AUTH EXPIRE as deferred columns. list --live already showed both; the two columns are hidden before CREDITS and the rest of the normal columns.

Summary

Adds a PLAN EXPIRE column to list output, sourced from the stored id_token claim https://api.openai.com/auth.chatgpt_subscription_active_until.

  • Parse ISO-8601 and epoch seconds/milliseconds claim values.
  • Persist plan_expires_at and expose it in list --json.
  • Show the local date in plain and live list tables when the timestamp is in the future.
  • Render - for missing, invalid, or already-expired timestamps so stale snapshots do not look current.
  • Refresh the field from auth sync and API usage refresh. Schema stays 4 because the field is optional/additive and self-heals on refresh.
  • The plain table defers PLAN EXPIRE until other columns have their width, so mid-sized terminals keep status/usage cells readable.

Closes #157.

Tests

  • zig build test -j1
  • zig build run -- list
  • zig fmt --check src tests build.zig

- Parse chatgpt_subscription_active_until from the stored id_token.
- Persist plan_expires_at and expose it in list JSON.
- Add PLAN EXPIRE to plain and live list tables; missing or past timestamps render as '-'.
- Refresh plan expiry from auth and usage sync; keep schema version 4 because the field is optional.
- Cover ISO-8601/numeric claim parsing and expired display in tests.

Closes #157
@pkg-pr-new

pkg-pr-new Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@loongphy/codex-auth-darwin-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-arm64@97352e4

@loongphy/codex-auth-darwin-x64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-x64@97352e4

@loongphy/codex-auth-linux-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-arm64@97352e4

@loongphy/codex-auth-linux-x64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-x64@97352e4

@loongphy/codex-auth-win32-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-arm64@97352e4

@loongphy/codex-auth-win32-x64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-x64@97352e4

@loongphy/codex-auth

npx https://pkg.pr.new/@loongphy/codex-auth@97352e4

commit: 97352e4

Use the shared column allocator for list, live details, switch, and remove. PLAN EXPIRE is a deferred column in the allocator instead of a hardcoded special case, so it only appears after normal columns have grown.

Keep each view's visual order, preserve complete percentages, and document the dynamic column model in docs/dynamic-columns.md. Add width-sweep coverage for deferred plan expiry and live column order.
- Rename docs/schema-migration.md to docs/schema.md.
- Define schema_version as a compatibility gate rather than a shape changelog.
- Add data-authority, reader/writer, recovery, and mixed-fleet criteria.
- Document optional derived/cache fields such as plan_expires_at.
- Move migration details under a dedicated Migration section.
- Update implementation and changelog references.
Use one shared first/grow/deferred order for every view. CREDITS now sits just above the deferred expiry fields, so expiry columns hide first, then CREDITS, then the remaining metadata.

Unsupported columns are skipped without changing the shared order. Update the dynamic-columns document and add a regression test for CREDITS hiding before LAST.
@Loongphy
Loongphy force-pushed the feat/list-plan-expiry branch from ae77b14 to de9d04a Compare October 22, 2026 11:21
Show both PLAN EXPIRE and AUTH EXPIRE in plain list output. Both remain deferred columns, so they still hide before CREDITS and other normal columns.
@Loongphy Loongphy changed the title feat: show plan expiry in list output feat: show plan and auth expiry in list output Oct 25, 2026
Keep PLAN and PLAN EXPIRE adjacent in both views, move AUTH EXPIRE and RESET CREDITS before LAST ACTIVITY, and make LAST ACTIVITY the final and lowest-priority column. It is now deferred and hides first.

Update the shared dynamic-column document and order/hide tests.
Grow ACCOUNT only after deferred columns, so long labels cannot hide expiry or last-activity fields. Render zero reset credits as 0 without an expiry marker.

Keep CREDITS and RESET CREDITS adjacent, LAST ACTIVITY at the end, and update the dynamic-column docs and regression tests.
@Loongphy
Loongphy merged commit a830597 into main Oct 25, 2026
12 checks passed
@Loongphy
Loongphy deleted the feat/list-plan-expiry branch October 25, 2026 09:01
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.

增加plan的剩余过期时间

1 participant