Skip to content

Start idle Codex 5-hour windows with a real new-session request instead of a synthetic warmup #5833

Description

@terrytan95

Area

Authentication and account pool

What are you trying to accomplish?

I run a Codex account pool and want each account's 5-hour reset clock to start as early as possible, without OpenCodex sending synthetic traffic. An account whose window has not started wastes time: its clock only begins on the first real request.

What prevents this today?

OpenCodex already records quota passively from every response's x-codex-* headers and from operator refreshes. The only way to start an idle window today is codexQuotaAutoRefresh, which sends a synthetic warmup request. Constructed probe requests are a known account-risk pattern (in one report, self-built pings led to every account being logged out).

What should OpenCodex do?

With an opt-in flag, when a brand-new conversation (no thread binding) arrives and an eligible pool account's last recorded short window reads 0% with a reset a full window after the observation, route that one real request to it. That request starts the clock; routing then returns to the configured strategy. Bound conversations are never moved, a pinned account wins, and each account is steered at most once per window. Nothing extra is sent.

Example usage or interface

ocx config set codexPool '{"startIdleWindows":true}'

Alternatives or workarounds

codexQuotaAutoRefresh (synthetic warmup), or an external scheduler that polls usage every minute and sends pings. Both add traffic that looks unlike a real client.

Additional context

Open question: the "not started" signal (0% usage, reset about one full window after the observation) is inferred from how an idle window's reset slides with the clock. It has not yet been checked against a captured live response for an idle account, so detection uses a one-minute tolerance and fails closed (no match means ordinary routing).

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansenhancementNew feature or requestplatformOS/service/tray/ACL (Windows-heavy, not Windows-only)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions