Skip to content

[Bug][Windows][Codex App Beta]: zero-byte coordinator blocks sync and obscures Desktop picker diagnosis #2291

Description

@lidge-jun

Client or integration

Codex App

Area

Catalog / models

Summary

On Windows with the current Codex App Beta, a zero-byte native write-coordinator database caused every ocx sync / startup sync to regenerate the routed catalog but refuse the config injection:

A missing coordinator row cannot be initialized while native Codex routing residue exists.

The CLI left the user with a partially updated state: opencodex-catalog.json contained routed models, but config.toml had no model_catalog_json or openai_base_url, so the Beta app restarted onto the native OpenAI catalog. ocx doctor reported the app-server catalog as current and did not identify the rowless coordinator or provide a recovery command.

After moving the proven-empty coordinator file aside, ocx sync succeeded and wrote the two root config keys. The fresh cache then contained 12 rows, including five routed rows. The Beta Desktop picker still displayed only OpenAI models, which is a separate renderer allowlist/compatibility condition related to #241 and the explicit nativeAlias workaround from #1244. This report is primarily about the unrecoverable rowless coordinator state and missing diagnosis; the Beta picker behavior is included so the two failure layers are not conflated.

Expected behavior:

  • OpenCodex must not leave or reuse a zero-byte coordinator as permanent authority.
  • ocx doctor should identify an empty/unversioned/rowless coordinator and print a safe, actionable recovery.
  • A failed config injection should be surfaced prominently enough that a successful catalog write is not mistaken for a successful sync.
  • The Codex App Beta renderer allowlist should be named separately when the on-disk catalog/cache and app-server side are already correct.

Reproduction

  1. Use Codex App Beta on Windows with a running OpenCodex service and at least one routed provider.
  2. Reach a state where the effective coordinator path exists as a zero-byte file while ~/.codex/opencodex-catalog.json contains routed entries.
  3. Run ocx sync or restart the service.
  4. Observe that provider discovery/catalog generation succeeds, then config injection fails with the missing-coordinator/native-residue message.
  5. Restart the Codex app-server.
  6. Observe that the app rebuilds models_cache.json from the native OpenAI path because the root injection keys were not written.
  7. Move only the proven-zero-byte coordinator aside and rerun ocx sync.
  8. Observe successful injection and a deliberately stale 12-row models_cache.json containing five routed rows.
  9. Restart the Beta app-server. If no explicit nativeAlias combo is configured, the Desktop picker may still show only OpenAI models due to the separate renderer allowlist behavior tracked by [Bug]: Routed models are loaded by Codex app-server but missing from Desktop model picker #241/fix(codex): preserve routed models in desktop picker #1244.

Recovery performed on the affected device:

  • Verified coordinator: size 0, PRAGMA user_version = 0, no tables, no rows.
  • Verified residue: routed opencodex-catalog.json; integration record missing.
  • Moved the empty file to a same-directory .rowless-backup-20260821T2045 path; did not delete it.
  • Ran ocx sync: exit 0, config injection succeeded.
  • Ran ocx sync --restart-codex: the stale app-server and code-mode host stopped and respawned.
  • Verified fresh state: model_catalog_json and openai_base_url present; cache has 12 rows and five routed entries; proxy/service healthy.

Version

OpenCodex 2.27.0, dev checkout 3e130d239a98

Operating system

Windows 11 Insider build 26200; OpenAI.CodexBeta 26.727.4816.0 x64

Provider and model

Anthropic OAuth plus OpenCode Go routed models; not specific to one model

Logs or error output

+ 5 models appended to Codex catalog
Codex configuration was not written: A missing coordinator row cannot be initialized while native Codex routing residue exists.

# coordinator inspection before recovery
size: 0
PRAGMA user_version: 0
tables: []
rows: []
residue: catalog
integration record: missing

# after moving only the empty coordinator aside
+ 5 models appended to Codex catalog
Pointed Codex's built-in openai provider at the opencodex proxy (openai_base_url).
All models now route through opencodex proxy (like OpenRouter).

# post-recovery cache
fetched_at: 2000-01-01T00:00:00Z
client_version: 0.0.0
models: 12
routed models: 5

The repeated Removed unsupported reasoning efforts: max, ultra warning is a separate runtime skew: OpenCodex selected global codex.cmd 0.141.0 for catalog clamping while the Codex App Beta cache identified client 0.146.0. It did not cause the missing routed rows, but it adds misleading noise during recovery.

Screenshots and supporting files

No screenshot attached. Relevant related work:

Redacted configuration

{
  "defaultProvider": "openai",
  "providers": {
    "openai": { "authMode": "forward" },
    "anthropic": { "authMode": "oauth", "models": ["<redacted>"] },
    "opencode-go": { "baseUrl": "<redacted>" }
  },
  "combos": {}
}

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 workingcatalogModel catalog, slugs, visibility, routed entriescliCLI, config inject, packaging flagsplatformOS/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