mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-26 18:30:57 +08:00
In the merged (stack) catalog every third-party row shared one comp_hash, "cc-switch", so Codex never compacted when switching between them (#8485). Third-party GPT rows mirror the official entry and carry `tool_mode: "code_mode_only"`, where shell calls are recorded as the custom tool `exec`; DeepSeek, Kimi and other rows are direct and only have `exec_command`. After switching from a GPT row to a direct row without compaction, the direct model copied the `exec` calls from history and every turn failed with `unsupported call: exec`. Group rows by tool protocol instead: a row with a tool_mode gets "cc-switch-<tool_mode>", direct rows keep "cc-switch" so existing sessions see no change. Switching within a group still skips compaction; switching across groups compacts with the previous model first, which folds the other protocol's calls into the summary. tool_mode and supports_search_tool keep the template values, so third-party GPT rows keep code mode. The cost is that a cross-group switch away from a provider that is no longer usable fails to compact, as before #8485; switching within the group or starting a new session avoids it. Fixes #8676