Skip to content

Codex restore leaves ocx1-compacted threads unreplayable on the native backend #3916

Description

@cb8010d6

Client or integration

Codex App

Area

Service lifecycle

Summary

After OpenCodeX has produced a routed remote-compaction V2 item, ocx restore or the dashboard's Codex OFF switch can successfully return Codex to its native ChatGPT path while leaving the persisted thread incompatible with that path. Resuming the affected thread directly sends OpenCodeX's ocx1: envelope to ChatGPT as encrypted_content; ChatGPT rejects it with invalid_encrypted_content. Re-enabling OpenCodeX makes the same thread usable because the proxy lowers ocx1: to plain summary text.

Expected behavior: returning to the native path should either provide a safe, explicit migration for an affected thread or clearly identify the required recovery step. It should not report a complete native restore while leaving previously routed threads with no supported recovery path.

Reproduction

  1. Route Codex through OpenCodeX to a non-native Responses provider.
  2. Continue a thread until remote compaction V2 stores a compacted.payload.replacement_history entry whose compaction encrypted_content begins with ocx1:.
  3. Run ocx restore or disable the Codex integration in the dashboard. Leave the proxy process running; only the Codex route changes.
  4. Resume that same thread through the native ChatGPT backend and send any message.
  5. The request fails before model execution with HTTP 400 invalid_encrypted_content for the persisted cmp_... item.
  6. Run ocx restore back and retry through OpenCodeX. The proxy decodes the same ocx1: envelope and the thread can continue.

The failure is deterministic for a thread containing that persisted envelope. Fresh threads and routed threads that never compacted are unaffected.

Version

Observed with 2.43.0. The incompatible restore path is still present on dev commit f802f71122 (package version 2.47.0).

Operating system

Windows 11

Provider and model

Routed OpenAI Responses-compatible provider, followed by native ChatGPT Codex. The persisted format, rather than a specific routed model, determines the failure.

Logs or error output

HTTP 400 invalid_request_error / invalid_encrypted_content
The encrypted content for item cmp_<redacted> could not be verified.
Reason: Encrypted content could not be decrypted or parsed.

Persisted item shape:
compacted.payload.replacement_history[].encrypted_content = "ocx1:<base64 summary>"

Screenshots and supporting files

Related upstream reports describe the same native replay failure and explicitly identify ocx1: as OpenCodeX-owned state:

OpenCodeX currently decodes the envelope only while its Responses adapter is in the request path (src/responses/compaction.ts and src/adapters/openai-responses.ts). The restore lifecycle changes provider metadata and configuration but does not migrate the persisted compaction snapshot.

Redacted configuration

{
  "providers": {
    "example": {
      "adapter": "openai-responses",
      "baseUrl": "https://example.invalid/v1"
    }
  }
}

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

    bugSomething isn't workinglanded-via-maintainerOriginal PR closed after landing via a maintainer merge trainserviceService lifecycle (WinSW/launchd/scheduler)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions