Skip to content

feat: team name#33

Merged
Loongphy merged 23 commits intomainfrom
codex/account-name-sync
Mar 27, 2026
Merged

feat: team name#33
Loongphy merged 23 commits intomainfrom
codex/account-name-sync

Conversation

@Loongphy
Copy link
Copy Markdown
Owner

@Loongphy Loongphy commented Mar 26, 2026

Summary

  • switch <query> now uses case-insensitive substring matching on email, alias, and account_name.
  • config api enable|disable now toggles both api.usage and api.account.
  • list shows all accounts, but api only works for currently active account:
    • usage refresh
    • team name (only run when the current account belongs to a grouped account set)
  • Display label priority is alias (name) > alias > name > fallback.
  • fallback:
    • team
    • free
    • team #1 / team #2

Example

  ACCOUNT                      PLAN  5H USAGE      WEEKLY USAGE           LAST ACTIVITY
---------------------------------------------------------------------------------------
  test@example.com
*   Acme                       team  100% (22:11)  56% (14:15 on 31 Mar)  37m ago
    Sandbox                    team  -             -                      -
    free                       free  -             -                      -

Validation

  • zig build test
  • zig build run -- list

Note

Add team account name refresh to fetch and display ChatGPT account display names

  • Adds a new account_name field to AccountRecord and a separate api.account config toggle alongside api.usage, with backfill logic for existing registries that only have one flag.
  • Introduces src/account_api.zig to fetch account metadata from the ChatGPT accounts/check endpoint, and src/account_name_refresh.zig for file-based locking and candidate selection for background refresh.
  • Refreshes account names after login, import, switch, and list operations, and adds a periodic background refresh in the daemon cycle with per-account cooldown tracking.
  • Updates display label logic so grouped accounts show alias (account_name) or email / alias formats, and account search now matches against account_name.
  • Moves cross-platform HTTP GET logic into src/chatgpt_http.zig, replacing the per-module curl/PowerShell implementations in src/usage_api.zig.
  • Risk: enabling api enable now toggles both api.usage and api.account simultaneously; previously only usage was affected.

Macroscope summarized 3df9878.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 26, 2026

Open in StackBlitz

@loongphy/codex-auth-darwin-arm64

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

@loongphy/codex-auth-darwin-x64

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

@loongphy/codex-auth-linux-x64

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

@loongphy/codex-auth-win32-x64

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

@loongphy/codex-auth

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

commit: 7805b60

Force the first daemon cycle to sync auth.json into stored account snapshots before grouped account-name refresh runs.

Also free duplicated candidate user ids when appending a refresh candidate fails.
@Loongphy Loongphy merged commit a8e75b0 into main Mar 27, 2026
8 checks passed
@Loongphy Loongphy deleted the codex/account-name-sync branch March 27, 2026 15:06
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.

1 participant