Skip to content

[Bug][Windows]: reboot leaves native-main gate stuck; GPT-only 503 until ocx restart #2108

Description

@hoonysis

Client or integration

Direct HTTP/API client

Area

Service lifecycle

Summary

On Windows 11 with the Task Scheduler service backend, a reboot/login can leave only the native OpenAI/Codex-login models blocked behind the process-wide native-main startup gate.

The proxy itself is healthy (/healthz returns 200), the model remains in the catalog, and non-native providers such as Anthropic continue returning 200. Native GPT requests fail locally with HTTP 503:

OpenCodex local native-main profile maintenance is active; retry this request

The state does not recover on its own. Running ocx restart (or pressing the dashboard/launcher restart control) immediately restores the same GPT model without reauthentication or configuration changes.

This has recurred after multiple Windows reboots. I expected startup recovery to reacquire native-main ownership and reopen admission automatically.

Reproduction

  1. Install OpenCodex as the per-user Windows Task Scheduler service (logon trigger).
  2. Use a valid native Codex/OpenAI login and confirm a native GPT model works.
  3. Reboot Windows and log in.
  4. Wait for the scheduled OpenCodex proxy to start.
  5. Confirm:
    • GET /healthz returns 200.
    • Anthropic or another non-native provider still works.
    • A native GPT Responses request (stream: true, store: false, list-form input) returns local HTTP 503 with the native-main maintenance message.
  6. Wait/retry: the GPT-only 503 persists.
  7. Run ocx restart.
  8. Send the same GPT request again. It returns 200 without login or config changes.

The Windows scheduled task currently reports AllowHardTerminate=True and MultipleInstances=IgnoreNew.

Version

2.26.0 (installed and running runtime both 2.26.0)

Codex runtime reported by OpenCodex: 0.148.0

Operating system

Windows 11 Home, version 10.0.26200, build 26200

Provider and model

OpenAI (Codex login / native main) / gpt-5.6-sol

Logs or error output

[17:25:23] opencodex service wrapper start
Previous session (PID <redacted>) did not shut down cleanly. Codex state restored from journal.
opencodex proxy running on http://localhost:10100

# /healthz remained HTTP 200.

17:26:37 | gpt-5.6-sol | openai | 503 | OpenCodex local native-main profile maintenance is active; retry this request
17:26:37 | gpt-5.6-sol | openai | 503 | OpenCodex local native-main profile maintenance is active; retry this request
17:26:48 | gpt-5.6-sol | openai | 503 | OpenCodex local native-main profile maintenance is active; retry this request

# Manual ocx restart:
[17:26:56] child exited with code 1; restarting
[17:27:03] opencodex service wrapper start

17:27:12 | gpt-5.6-sol | openai | 200
17:27:17 | gpt-5.6-sol | openai | 200

The exact internal blocked reason is not exposed in the request log. The installed source suggests the relevant path may be:

  • native-profile-startup.ts: owner acquisition/recovery updates the process-wide snapshot to blocked.
  • isNativeMainTrafficBlocked() keeps native traffic fenced while that snapshot remains blocked.
  • auth-context.ts converts this state to the generic native-main maintenance 503.

The preceding unclean-shutdown/journal-recovery line is consistently associated with the post-reboot failure, but I cannot confirm whether the specific retained reason is recovery-pending, owner-unavailable, or another startup block because it is not logged.

It would help if OpenCodex:

  1. logged the concrete native-main block reason;
  2. retried or completed recovery after stale journal/ownership cleanup; and
  3. ensured the Windows scheduler shutdown/startup path releases or reacquires native-main ownership cleanly.

Screenshots and supporting files

Screenshots are available if needed. They show repeated client-visible “Selected model is at capacity” errors, while OpenCodex request logs reveal the actual native-main maintenance 503.

Redacted configuration

{
  "serviceBackend": "Windows Task Scheduler",
  "trigger": "logon",
  "allowHardTerminate": true,
  "multipleInstances": "IgnoreNew",
  "proxyPort": 10100,
  "nativeProvider": "openai (Codex login)",
  "nativeModel": "gpt-5.6-sol",
  "otherProvidersRemainHealthy": true
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCLI, config inject, packaging flagsplatformOS/service/tray/ACL (Windows-heavy, not Windows-only)serviceService lifecycle (WinSW/launchd/scheduler)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions