Missing conversation history

Find Codex tasks after switching between subscription and API access, and keep a consistent provider ID.

Tasks disappearing after switching to APIPool usually does not mean they were deleted. Codex filters tasks by provider ID: subscriptions normally use openai, the manual APIPool setup uses apipool, and CC Switch imports often use custom. Different IDs can produce different default task lists.

Using the same openai ID and the same local history for both modes can avoid this provider filter. No client modification or rebuild is required. This optional configuration has the limitations described below.

Find existing tasks first

  1. Switch back to the provider and authentication used to create the task, then fully quit and reopen Codex.
  2. Check the device, OS user, and CODEX_HOME. Defaults are ~/.codex on macOS/Linux and %USERPROFILE%\.codex on Windows. WSL has a separate home. The same provider ID does not synchronize history across devices.
  3. Check archived tasks and the project directory. codex resume --all removes the working-directory filter; it does not mean all providers.

Do not delete sessions, auth.json, or the state database to refresh history, or bulk-edit history files. The setup below does not migrate existing apipool or custom tasks to openai. Switch back to their original provider to view them.

Keep openai as the ID and switch the endpoint and authentication

Use this option to retain access to subscription tasks while keeping subsequent tasks under one provider. API mode shows API Key authentication; it does not simultaneously preserve subscription identity. Client interfaces vary by version. Recheck configuration and request routing after client or switcher updates.

1. Back up and quit clients

Quit Codex CLI, the IDE extension, and the desktop app. Back up user-level config.toml and any existing auth.json to a protected local location. If login is stored in an OS credential store, switching back may require signing in again. Use the configured CODEX_HOME directory if it differs from the default.

Exit CC Switch proxy takeover and pause its management of this configuration. CC Switch 3.20.4 imports generate custom; saving may also rewrite openai_base_url into a separate provider. A normal import does not replace the manual setup below. Recheck the actual file after a switcher saves it.

2. Edit user-level configuration

Merge these keys into ~/.codex/config.toml (usually $env:USERPROFILE\.codex\config.toml on Windows), at the top level before any [table]. Replace existing values rather than adding duplicate keys:

model_provider = "openai"
openai_base_url = "https://app.apipool.dev/v1"
model = "gpt-5.6-sol"
review_model = "gpt-5.6-sol"
disable_response_storage = true

Choose an available model from the model list supported by your key’s group. Preserve unrelated settings. Do not add [model_providers.openai]: openai is a reserved built-in ID. Changing only a custom provider’s display name to OpenAI does not change its ID. Resolve conflicting profile settings, launch arguments, or OPENAI_BASE_URL environment overrides first.

3. Switch authentication to your APIPool API key

Switch the endpoint and authentication together. Changing only openai_base_url while retaining ChatGPT authentication can send subscription credentials to the third-party endpoint. Setting OPENAI_API_KEY or CODEX_API_KEY alone does not guarantee replacement of an existing desktop login.

Set a nonempty APIPOOL_API_KEY as described in the integration guide, then use the CLI to sign in with it. Do not place a real key directly in command arguments.

macOS and Linux (run inside WSL for Codex installed there):

printenv APIPOOL_API_KEY | codex login --with-api-key
codex login status

Windows PowerShell:

$env:APIPOOL_API_KEY | codex login --with-api-key
codex login status

Confirm API Key authentication before restarting clients that share this user directory. CLI users should check that startup reports openai. Send a short request without sensitive content and check the APIPool request logs to confirm routing. The displayed account alone does not prove which endpoint receives requests.

4. Switch back to your subscription

  1. Quit Codex. Remove top-level openai_base_url and any third-party endpoint overrides in profiles, launch arguments, or environment variables. Restore your original official model settings and keep model_provider = "openai".
  2. Run codex login to sign in with ChatGPT, then check codex login status. Restore backed-up official configuration if needed, without replacing history.
  3. Restart before sending requests. Do not keep a third-party endpoint while switching only the login back to your subscription.

Why can a visible task still fail to continue?

A consistent ID only changes task-list filtering. After switching services, encrypted reasoning or compacted state in a long conversation may be incompatible. For encrypted_content, reasoning, or compaction errors, return to the original channel, or summarize the work there and start a new task on the target channel with that summary and necessary files.

Do not bulk-delete history fields or rewrite the database to force continuation. This is not a guarantee of lossless switching for arbitrarily long tasks and does not automatically merge existing tasks with other provider IDs.