Skip to content

truncation_policy.limit hardcoded to 10000 limits Codex context - CC Switch

Quick fix

In cc-switch, manually set truncation_policy.limit in cc-switch-model-catalog.json to the model's actual context length as a temporary fix.

Error output
truncation_policy.limit 仍是 10000
English translation

truncation_policy.limit is still 10000

The root cause is that cc-switch's internal template file src-tauri/src/resources/codex_native_responses_template.json lines 24-27 hardcode truncation_policy.limit to 10000. No matter what context length the user configures in the UI role settings, the generated cc-switch-model-catalog.json always resets this value to 10000. Codex uses this file to decide how many tokens to send to the model per request; 10000 tokens is extremely insufficient for modern LLM use, so conversations are truncated after a few rounds. PR #5534 changed truncation_policy.limit to be generated dynamically from context_window, but as of v3.16.5 the fix has not been merged and the issue still exists.

  1. After changing any setting in CC Switch, manually edit cc-switch-model-catalog.json and change truncation_policy.limit from 10000 to the context length actually supported by the model, for example 1000000 for a 1M context.

    cc-switch-model-catalog.json
    "truncation_policy": {
    "mode": "bytes",
    "limit": 10000
    "limit": 1000000
    }
ToolCodex
Version3.16.4 - 3.16.5(受影响版本,尚未修复)
PlatformsWindows
Why is limit still 10000 in the generated config file after I set a 1M context in the CC Switch UI?
Because truncation_policy.limit in codex_native_responses_template.json is hardcoded to 10000 and currently does not dynamically follow the context_window set in the UI. PR #5534 provides a fix and is waiting to be merged.
Does v3.16.5 fix this issue?
No. Users tested on v3.16.5 and confirmed the issue still exists. cc-switch-model-catalog.json correctly contains max_context_window: 1000000, but truncation_policy.limit is still hardcoded to 10000.
Do I have to manually change it again every time CC Switch overwrites the settings?
Yes. That is the current workaround. Whenever any setting is changed in CC Switch, cc-switch-model-catalog.json is overwritten back to limit: 10000 and must be manually edited again.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.