Skip to content

[Bug]: On battery with macOS Low Power Mode, a timed-out Codex status probe is never re-checked even with a focused client (balanced profile pauses provider refresh) #16405

Open

Description

@Mput13

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. macOS laptop with Low Power Mode set to "Only on Battery" (pmset -g custom shows lowpowermode 1 under Battery Power, 0 under AC Power).
  2. T3 Code desktop with the default background activity profile (balanced, no overrides) and Codex enabled.
  3. Unplug the laptop and keep using the app in the foreground (window visible and focused, threads running).
  4. Have one Codex status probe exceed AUTH_PROBE_TIMEOUT_MS (10 s). On this machine an unloaded probe takes 3.4–5.3 s, almost all of it Codex's own network calls, so a slow network moment is enough. I could not make this step deterministic.
  5. Keep working on battery without opening Settings → Providers.

Expected behavior

A connected, focused client gets the provider re-checked within one providerHealthRefreshInterval (5 min on balanced), so a transient timeout clears by itself. If Low Power Mode is meant to pause routine health polling, it should still not pin a provider in an error state: a failed or timed-out snapshot should be retried at least once regardless of the host power gate.

Actual behavior

Codex stays "Unavailable. Timed out while checking Codex app-server provider status." in the model picker and as a toast until I open Settings → Providers and press refresh. The manual refresh succeeds immediately.

The periodic loop in makeManagedServerProvider only refreshes when hasProviderStatusDemand is true, and backgroundPolicy.shouldRunScopeWork returns false first thing when isHostConstrained(hostPower, settings) is true. balanced has pauseWhenHostLowPower: true, so on battery with Low Power Mode on, no provider is ever re-checked, even with a foreground client holding a provider-status lease.

This is the case the triage on #13635 treats as covered ("a connected client already retries within one interval once the cached failure is gone"). That holds on AC power only. On a MacBook with the common "Low Power Mode on battery" setting, the connected client does not retry.

Related, but different trigger: #13635 (no client lease), #7230 (timeout stored as an error), #7513 (10 s Codex probe bound).

What I did not verify: I read the gate from the shipped bundle and the OS state from pmset; I did not capture the hostPower snapshot the server held. The timed-out probe itself happened before the start of the retained trace window, so its cause is inferred from the timings below.

Impact

Major degradation or frequent failure

Version or commit

0.0.46-nightly.20261004.2648

Environment

macOS 26.3.1 (Apple M4), T3 Code (Nightly) desktop, on battery with Low Power Mode on, Codex CLI 0.160.1 (ChatGPT login), background activity profile balanced (default, no overrides)

Logs or stack traces

# server.trace.ndjson*, retained window 09:28:49–11:16:15 local, app in active foreground use on battery.
# Every refreshSnapshot / checkCodexProviderStatus span in that window:

11:12:35  ws.rpc.server.refreshProviders   16285 ms  Success   <- manual refresh from Settings
11:12:35  checkCodexProviderStatus          5243 ms  Success
11:12:57  checkCodexProviderStatus          5026 ms  Success
# No periodic refresh in the preceding 1 h 44 min (expected about 20 at the 5 min interval).

# Same probe sequence run by hand against `codex app-server` (initialize, account/read,
# then skills/list + model/list + account/rateLimits/read in parallel), 4 runs, idle machine:
init 0.18  account/read +1.83  skills +0.05  models +3.28  rateLimits +1.82  total 5.29 s
init 0.12  account/read +1.45  skills +0.03  models +0.00  rateLimits +2.22  total 3.79 s
init 0.12  account/read +1.29  skills +0.03  models +0.00  rateLimits +1.99  total 3.42 s
init 0.12  account/read +1.95  skills +0.03  models +0.00  rateLimits +2.82  total 4.89 s

# pmset -g custom
Battery Power:  lowpowermode 1
AC Power:       lowpowermode 0

# shipped bundle (apps/server/dist)
const AUTH_PROBE_TIMEOUT_MS = 1e4;
balanced: { providerHealthRefreshInterval: minutes(5), pauseWhenHostLowPower: true, ... }
const shouldRunScopeWork = (scope) => gen(function* () {
  const [current, settings] = yield* all([snapshot, backgroundActivitySettings]);
  if (isHostConstrained(current.hostPower, settings)) return false;
  return current.leases.some((lease) => leaseMayRunScopedWork(lease, scope, current.updatedAt, settings));
});

Workaround

Press refresh in Settings → Providers each time. To stop it recurring: turn off "Pause on host low power" in the background activity settings (or use the performance profile), or disable Low Power Mode on battery in macOS.

Activity

  1. added
    needs more infoInitial triage showed no bug. Awaiting more info
    and removed
    needs more infoInitial triage showed no bug. Awaiting more info
    on Oct 22, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions