Skip to content

feat: support per-model auto-compact thresholds - #1943

Open
dongyu23 wants to merge 5 commits into
BigPizzaV3:mainfrom
dongyu23:codex/per-model-auto-compact
Open

feat: support per-model auto-compact thresholds#1943
dongyu23 wants to merge 5 commits into
BigPizzaV3:mainfrom
dongyu23:codex/per-model-auto-compact

Conversation

@dongyu23

@dongyu23 dongyu23 commented Aug 22, 2026

Copy link
Copy Markdown

Summary

This is the clean PR1 follow-up to closed #1837, rebuilt from the latest upstream/main. It keeps the scope limited to per-model context windows and automatic compaction thresholds.

Changes

  • add opt-in modelAutoCompact profile field
  • validate integer and decimal percentages from 0 to 100
  • calculate per-model auto_compact_token_limit from catalog context windows
  • extend the manager model editor with per-model auto-compact values
  • preserve legacy profile behavior when the field is absent or empty
  • remove stale self-generated catalog pointers after all per-model overrides are cleared
  • tolerate malformed historical model maps in the editor

Scope

This PR intentionally does not include model metadata import, protected metadata fields, or external catalog conflict handling. Those belong to the follow-up PR2.

Validation

  • npm test: 71 passed
  • npm run check
  • cargo test -p codex-plus-core: all passed
  • relay_config integration tests: 133 passed
  • npm run vite:build
  • git diff --check

Related: #1837 (closed split request)

@dongyu23

Copy link
Copy Markdown
Author

@BigPizzaV3 Following your request on closed #1837, this work is now split into focused PRs:

Both branches are based on the latest main. Fork CI has passed the frontend tests, TypeScript check, and workspace Rust tests; the cross-platform build is running for the new heads.

@BigPizzaV3

Copy link
Copy Markdown
Owner

按模型自动压缩阈值的方向可以继续,但当前分支没有 GitHub CI,且 relay_config/main 已继续演进。请 rebase 最新 main,明确保持旧的 profile 单值行为为默认、每模型配置为 opt-in,并补 catalog 生成、切换供应商和回退行为测试后再评估。

@dongyu23
dongyu23 force-pushed the codex/per-model-auto-compact branch 2 times, most recently from 41e0a6a to 9031ed5 Compare August 25, 2026 14:08
@BigPizzaV3

Copy link
Copy Markdown
Owner

main 已更新到 7385664。请基于该版本 rebase 并解决 relay_config/Manager 冲突;保持旧 profile 单值配置为默认、每模型阈值为 opt-in,并补 catalog 生成、供应商切换和无配置回退测试。完成并跑通 CI 后再复审。

@dongyu23
dongyu23 force-pushed the codex/per-model-auto-compact branch from 9031ed5 to 8a496ee Compare August 30, 2026 10:44
@dongyu23

Copy link
Copy Markdown
Author

@BigPizzaV3 PR1 已按最新 main(当前基线 716e8d0)同步并推送,远程分支已更新到 8a496ee

本地已验证:

  • cargo test -p codex-plus-core --test relay_config:141 passed
  • npm test -- --runInBand:137 passed
  • Windows NSIS 安装包已重新构建

旧 profile 的单值 context_window / auto_compact_limit 保持默认行为,每模型配置仍为 opt-in。

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.

2 participants