codex-multi-auth icon indicating copy to clipboard operation
codex-multi-auth copied to clipboard

[feature] Improve human status output, locale selection, and cross-provider resume

Open maomaocun opened this issue 1 month ago • 5 comments

Summary

The default codex-multi-auth status output is difficult to scan: it repeats verbose per-account diagnostics, mixes routing and health details, and exposes account labels that are unnecessary for a quick health check. The CLI also has no consistent English/Chinese output setting. In addition, mcodex resume can hide sessions created by normal codex because Codex filters the resume catalog by model_provider.

Expected behavior

  • status should show a compact summary with ready / login-required / disabled counts, route, recommendation, quota, and a clear next action.
  • Users should be able to follow the system language or select English/Chinese explicitly, without changing JSON output.
  • mcodex resume <id> and mcodex resume --last should find normal codex sessions and still route resumed requests through the managed account pool.

Observed behavior

  • The default status view is long and requires reading each account's diagnostic block.
  • Native openai rollouts and rotation-provider rollouts are split by Codex's provider filter, so one provider's sessions can be absent from /resume.

Proposed implementation

  • Compact status by default, with --details for diagnostics and unchanged --json for automation.
  • auto|en|zh locale selection from system locale, --locale, or persisted config locale.
  • Provider-aware resume: preserve openai as the lookup provider while temporarily routing its endpoint to the local rotation proxy.

Privacy

No credentials, account identifiers, session contents, or host paths are included in this report.

maomaocun avatar Oct 15 '26 18:10 maomaocun

Implementation PR: https://github.com/maomaocun/codex-multi-auth/pull/1

maomaocun avatar Oct 15 '26 18:10 maomaocun

Implementation update is now in PR #1.

The status work now includes Unicode quota bars with explicit used/remaining percentages and a fully localized Chinese detailed view (status --details --locale zh).

The resume failure was reproduced with Codex 0.162.1: native sessions use model_provider = "openai", but injecting [model_providers.openai] makes Codex reject the configuration because openai is reserved. The wrapper now keeps the native provider name for session lookup and uses the supported top-level openai_base_url override to route resumed requests through the local rotation proxy. The canonical CODEX_HOME and SQLite state remain shared.

maomaocun avatar Oct 15 '26 19:10 maomaocun

Follow-up fix is included in PR #1 at e14fcd09.

A second resume-specific failure was reproduced: the wrapper's forced output capture changed the official Codex child's stdout into a pipe, producing stdout is not a terminal. Interactive TUI, resume, and fork now always inherit terminal streams. With rotation enabled, the installed mcodex resume <native-session-id> reached the official “Resuming session…” screen after the provider fix.

maomaocun avatar Oct 15 '26 19:10 maomaocun

The PR now also includes the delivery-ready local web dashboard and alias:

  • codex-multi-auth web / codex-ma web opens a bilingual real-time account-pool page.
  • It reuses the sanitized status --json data, renders 5-hour and 7-day quota bars, routing/runtime metrics, and account risk cards.
  • Updates use server-sent events; default bind is 127.0.0.1:4317, --no-open supports headless machines, and non-loopback binds require a token.
  • codex-ma --version and codex-ma web --help were verified from the installed package.

maomaocun avatar Oct 15 '26 19:10 maomaocun

The alias is now covered by package metadata tests and pushed with the web dashboard: codex-ma points to the same manager entrypoint as codex-multi-auth, so codex-ma web, codex-ma status, and all manager commands share the same behavior.

maomaocun avatar Oct 15 '26 19:10 maomaocun