Skip to content

feat: add pinned overrides that win inside managed subtrees - #9

Merged
StarsailsClover merged 2 commits into
mainfrom
v26.0-Alpha.8
Oct 9, 2026
Merged

StarsailsClover merged 2 commits into
mainfrom
v26.0-Alpha.8

Conversation

@StarsailsClover

Copy link
Copy Markdown
Owner

Problem

Codex 0.160 selects remote compaction v2 whenever the provider name is "OpenAI". CC Switch's local-proxy route uses that name for a third-party provider, so the gateway receives a compaction_trigger request it cannot answer. collect_compaction_output then fails fatally with remote compaction v2 expected exactly one compaction output item, got 0 from N output items, and the session cannot continue.

Reproduced deterministically in a temporary CODEX_HOME with model_auto_compact_token_limit=2000: the second turn fails with exactly that error; resuming after changing [model_providers.SailsAPI].name to "SailsAPI" compacted locally and completed successfully.

Change

  • New pinned policy list: exact paths that stay protected even inside a managed subtree.
  • Traversal descends into managed tables only where a pinned descendant exists; a pinned leaf never resurrects a missing parent table.
  • Removing a pinned path forces a clobber classification, so watch repairs it.

Verified

  • 41 tests passing; clippy -D warnings and fmt --check clean.
  • Regression tests: projection of a pinned leaf under model_providers, merge restores it over name = "OpenAI", missing parents are not recreated, and pinned removal classifies as a clobber.
  • Real-machine end-to-end: with the updated config, the same two-turn compaction scenario prints context compacted and exits 0; the previously failed session resumes.

Codex 0.160 selects remote compaction v2 whenever the provider name is "OpenAI"; CC Switch local-proxy route uses that name for a third-party provider, so the gateway receives a compaction trigger it cannot answer and the session dies with a fatal error. Pinning model_providers.SailsAPI.name keeps the provider outside that gate and routes compaction through the local summarization path again.

- policy.pinned paths stay protected inside managed subtrees
- traversal descends into managed tables only for pinned descendants; pinned leaves never resurrect a missing parent
- removing a pinned path forces a clobber classification
- regression tests for projection, merge, non-resurrection, and classification
The pinned policy guarded removals but not rewrites, so a provider field changed in place (for example name = "OpenAI" re-added by CC Switch) stayed below the threshold. Rewrites of a pinned path now score as clobbers and are journalled with their own evidence line.
@StarsailsClover
StarsailsClover merged commit 844035e into main Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant