Repository navigation
Description
Summary
An existing Codex Desktop thread became unusable after switching from a third-party GLM model through CC Switch back to direct OpenAI access with ChatGPT sign-in. Changing the selected model and fully restarting did not recover it.
Two failures appeared sequentially: a stale third-party model error during remote compaction, then a schema error caused by plaintext reasoning items in the persisted history. After backing up and repairing the affected metadata, and removing only the incompatible reasoning records, the same thread resumed successfully. A subsequent successful compaction was recorded.
Environment
- Windows; Codex Desktop using ChatGPT sign-in.
- Runtime reported in a newly created session:
0.163.0-alpha.11.1. - Affected thread was originally created with runtime
0.160.1. - CC Switch installed version at diagnosis:
4.0.18(the version used for every earlier turn was not independently verified). - Third-party model:
ccs-zhipu/glm-5.3. - Official model selected when diagnosing:
gpt-5.6-sol; a separate new official-model thread worked.
Reproduction path observed
- Continue a long existing thread using GLM through CC Switch.
- Switch CC Switch back to direct official access with ChatGPT authentication.
- Select an official model in the affected thread and fully restart Codex.
- Send another message. Remote compaction fails before a normal reply.
- After correcting the stale model metadata, retry: remote compaction now fails on persisted reasoning content.
This is an observed recovery case, not a fresh minimal reproduction against a mock provider.
Errors
First:
Error running remote compact task:
The 'ccs-zhipu/glm-5.3' model is not supported when using Codex with a ChatGPT account.
After the metadata repair:
Invalid 'input[30].content': array too long. Expected an array with maximum length 0, but got an array with length 1 instead.
The second response was HTTP 400, invalid_request_error, code array_above_max_length.
Persisted-history findings
- The thread database already had
model_provider = "openai"andmodel = "gpt-5.6-sol". - Global configuration no longer selected the third-party model or proxy.
- Five historical
turn_contextrecords and oneworld_staterecord still contained GLM model fields (including nested model settings). - After the last pre-failure compaction, 264
response_itemrecords had this structural shape (text and identifiers intentionally omitted):
{
"type": "reasoning",
"summary": [],
"content": [{"type": "reasoning_text", "text": "<omitted>"}],
"encrypted_content": null
}The raw wire request was not captured, so the exact mapping of input[30] to a stored item is not proven. However, removing this class of records was the final change that restored the thread.
Recovery verified locally
With complete backups:
- Changed only stale GLM
modelfields inside those six historical state/context records to the selected official model. This exposed the second error. - Removed the 264 plaintext reasoning response records after the last compaction boundary, leaving all other JSONL records byte-for-byte unchanged.
- Reloaded the thread. The user confirmed recovery, and a new successful compaction was recorded on 2026-10-22.
User messages, assistant messages, tool calls and tool outputs were retained. No database edits were made. This describes a diagnostic workaround, not a recommendation to modify live session files.
Expected behavior / requested investigation
Provider/model changes should not permanently wedge an existing thread. Please consider validating history against the destination provider before remote compaction and providing a supported recovery path for incompatible third-party reasoning items. Ideally, preserve useful conversation/tool history and clearly explain any reasoning data that must be excluded.
The responsible serialization layer has not been established; this may require coordination with the proxy.
Related
- [Bug] Codex 聚合 → 直连官方账号后,旧会话 remote compact 仍使用冻结的 ccs- 模型 ID 并持续 400 farion1231/cc-switch#8655 — similar stale-model failure after returning to direct official access.
- Stale encrypted compaction/reasoning breaks entire thread after key rotation (invalid_encrypted_content + array_above_max_length) #36704 — related schema-error symptom, but a different reported migration/recovery scenario.
No full conversation, local paths, account identifiers, credentials or raw reasoning text are included.
Activity