Skip to content

[Bug][Windows]: ocx update aborts on pending shared teardown when paginated-history restore is refused #4718

Description

@SeanChengN

Client or integration

OpenCodex dashboard

Area

Installation or packaging

Summary

ocx update aborts on Windows after the service manager has already stopped the proxy when the updater enters the pending shared teardown path and native history restore refuses with history_paginated_requires_native_writer.

This appears to be a regression or uncovered sibling path of #3008. The paginated-history refusal itself is expected and should remain fail-closed. The defect is that the history-only refusal is promoted to a generic stop failure after the service has already stopped, so package replacement never begins.

Expected: if the proxy/service is proven down and the only remaining failure is paginated-history finalization, preserve config/catalog/history/provenance and the backup manifest, warn, and continue package replacement under the same history-only contract introduced for #3008.

Previous non-template report: #4716.

Reproduction

  1. Windows x64 with OpenCodex installed globally through npm and the Windows Task Scheduler service enabled.
  2. Existing paginated Codex history state with a backup manifest/integrity warning already present.
  3. syncResumeHistory is false.
  4. Starting from OpenCodex 2.54.0, run:
ocx update
  1. The updater verifies @bitkyc08/opencodex@2.56.0, stops the service manager, then enters the pending shared teardown path.
  2. Observe:
opencodex v2.54.0 (installed via npm, tag latest)
Verified @bitkyc08/opencodex@2.56.0 integrity metadata sha512-4YXYcCUMG5NUU4sjg…
⏹  Stopping the running proxy before updating...
🛑 Service manager stopped.
↩️  Finishing a shared teardown left unfinished by an earlier stop.
⚠️  Native restore refused: history_paginated_requires_native_writer. Config, catalog, history and provenance were preserved.
opencodex: could not stop the running proxy; aborting the update. Run 'ocx stop' and retry.
  1. Package replacement does not run.
  2. While the service is down, manually install the same target package:
npm install -g @bitkyc08/opencodex@2.56.0
ocx service start
ocx status
ocx doctor
  1. The manual install succeeds and 2.56.0 runs normally.

Current healthy post-upgrade checks:

opencodex 2.56.0
Proxy: running
routing=opencodex-local, service=viable, shim=absent
Codex runtime: codex.exe
Codex version: 0.154.0
OAuth health: ok
ok ocx 2.56.0 matches the running proxy
WHAM reachability: status=200, authenticated
memory usage looks normal

The pre-existing doctor warning remains:

Codex native-write coordinator
ok native-write coordinator not created yet
-- backup manifest or restore target failed integrity checks — manual review required

No history recovery, manifest deletion, SQLite modification, or rollout modification was performed.

Version

2.54.0 -> 2.56.0

Operating system

Windows x64, Windows Task Scheduler service

Provider and model

Not provider-specific

Logs or error output

opencodex v2.54.0 (installed via npm, tag latest)
Verified @bitkyc08/opencodex@2.56.0 integrity metadata sha512-4YXYcCUMG5NUU4sjg…
⏹  Stopping the running proxy before updating...
🛑 Service manager stopped.
↩️  Finishing a shared teardown left unfinished by an earlier stop.
⚠️  Native restore refused: history_paginated_requires_native_writer. Config, catalog, history and provenance were preserved.
opencodex: could not stop the running proxy; aborting the update. Run 'ocx stop' and retry.

Screenshots and supporting files

Related prior issue: #3008

Previous non-template submission: #4716

The important branch-specific marker in this reproduction is:

Finishing a shared teardown left unfinished by an earlier stop.

This suggests the pending-teardown completion path may not preserve the same history-only classification used by the ordinary stop/update path after #3008.

Redacted configuration

{
  "syncResumeHistory": false
}

The Codex history store is paginated and there is an existing backup manifest under the OpenCodex/Codex recovery state. The manifest/integrity warning predates this update attempt.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, 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, plansbugSomething isn't workingcliCLI, config inject, packaging flagsinstallInstallation or packaginglanded-via-maintainerOriginal PR closed after landing via a maintainer merge trainplatformOS/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