Skip to main content

Module proxy

Module proxy 

Source

Functions§

cooldown_watcher
Watches for account cooldowns expiring and triggers a post-cooldown prefetch so each account re-enters rotation with fresh rate-limit metrics.
create_app
create_app_with_state
openai_token_refresh_loop
Keeps shunt’s live credentials in sync with Codex CLI’s auth.json.
prefetch_rate_limits
For any account with no rate-limit data yet, make a cheap request directly to the upstream API so we populate metrics without waiting for a real user request. Runs as a background task after startup.
recovery_watcher
Runs as a background task. Every 2 minutes, tries to refresh tokens for any auth_failed account. If refresh succeeds the account is brought back online without a process restart. If all accounts remain unrecoverable, fires a macOS notification (at most once per hour).

Type Aliases§

LiveCredentials
Shared live credentials map — can be written to without restarting the proxy.