Skip to content

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

Closed as not planned

Description

@SeanChengN

Client or integration

OpenCodex CLI / dashboard updater

Area

Installation or packaging

Summary

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

This looks like a regression or an uncovered sibling path of #3008. The #3008 fix established that a history-only restore failure must be distinguished from a real stop failure: once the proxy/service is confirmed down, the updater may continue package replacement while preserving the history manifest for later review. In this case the pending-teardown branch appears to lose that classification and reports could not stop the running proxy instead.

The history refusal itself is expected and should remain fail-closed. The problem is that it is promoted to an updater stop failure after the service has already stopped.

Observed upgrade

Attempted upgrade:

OpenCodex 2.54.0 -> 2.56.0
installer: npm
service: Windows Task Scheduler
Codex CLI: 0.154.0

Command and output:

ocx update
opencodex v2.54.0 (installed via npm, tag latest)
Verified @bitkyc08/[email protected] 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.

Package replacement did not run.

I then performed the package update manually while the service was down:

npm install -g @bitkyc08/opencodex@2.56.0
ocx service start
ocx status
ocx doctor

The manual install succeeded and the new service is healthy:

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

ocx doctor confirms:

ok ocx 2.56.0 matches the running proxy
WHAM reachability: status=200, authenticated
memory usage looks normal

The pre-existing history 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 edit, or rollout edit was performed.

Expected behavior

If the Task Scheduler service/proxy has been confirmed stopped and the only remaining failure is the permanent paginated-history refusal:

history_paginated_requires_native_writer

then the updater should preserve config/catalog/history/provenance and the backup manifest, classify the result as history-only/incomplete-history, warn, and continue package replacement — the same safety contract implemented for #3008.

It should not weaken or bypass the paginated-history guard.

Actual behavior

The pending shared teardown branch emits:

Service manager stopped.
Finishing a shared teardown left unfinished by an earlier stop.
Native restore refused: history_paginated_requires_native_writer.

but then treats the result as if the proxy could not be stopped:

opencodex: could not stop the running proxy; aborting the update.

This aborts the updater before package replacement even though the service manager had already stopped the service.

Why this appears related to #3008

#3008 was closed after the updater/stop contract was changed so a history-only failure could use a distinct outcome (exit 79) rather than being interpreted as a live-proxy stop failure.

This incident has the same external failure shape, but specifically after:

Finishing a shared teardown left unfinished by an earlier stop.

That suggests the pending-teardown completion path may not preserve the same history-only classification used by the normal stop/update path.

Version

Observed while upgrading:

2.54.0 -> 2.56.0

The manually installed target version is now running successfully as 2.56.0.

Operating system

Windows x64, OpenCodex service installed through Windows Task Scheduler.

Provider and model

Not provider-specific. Local Codex integration with ChatGPT-family routing through OpenCodex.

Redacted configuration / relevant state

{
  "syncResumeHistory": false
}

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

Suggested investigation

Please check whether the pending shared teardown completion path maps history_paginated_requires_native_writer / history-only restore failure to the same stop classification used by the ordinary updater path after #3008.

The desired invariant seems to be:

  • proxy/service still live or stop state unknown -> abort update;
  • config/catalog/shared routing teardown failure -> abort update;
  • proxy/service proven down + only history finalization refused -> preserve manifest/history and continue update with warning.

Checks

Activity

  1. added
    cli
    install
    platform
    on Sep 15, 2026
  2. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

    Issue closed: use an issue template

    Thanks for taking the time to submit this issue. It was closed automatically because it was not opened with a recognized issue template (Bug report, Feature request, Documentation, or Provider compatibility). Freeform and API-opened issues cannot skip this check.

    • This issue does not use a recognized issue template.

    Please edit the issue to add:

    • Open a new issue with the Bug report, Feature request, Documentation, or Provider compatibility template.
    • Or edit this issue so the body uses the template section headings for the kind of report you are filing.

    See the Contributing guide for details.

    Once the report passes the automated checks, it will be reopened automatically unless a maintainer has changed its state.

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

    cliinstallplatform

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions