Repository navigation
[PR] fix(#5243): honor codex's model_catalog_json when aligning windows - #5305
Conversation
The codex-cli catalog install writes ONLY the file named by config.toml's model_catalog_json — models_cache.json may be absent entirely — so bili clamped the window to the flat 272K unknown-model fallback and nudge bands fired EMERGENCY at ~35% real usage. - client-config: parse model_catalog_json (base/profile TOML, -c overrides, effective-view merge carries the key) - codex-models: candidate order model_catalog.json -> models_cache.json (relative path vs $CODEX_HOME); a readable table is authority even on a lookup miss; no readable table + config.toml model_context_window set -> size from the operator's own number instead of 272K - codexAlignedWindow reports which surface produced the window (additive source field); the [codex] clamp log names that source instead of claiming "current client metadata preferred" when none existed; warn once per model on the config-window fallback
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 检索 open+closed issue/PR,无其它针对「codex 标签: bug / codex / scope/kernel / p2(缺陷;涉及 codex 车道;窗口对齐属压缩预算决策面;过度压缩=体验退化,非数据丢失/完全不可用 → p2)。 方向关(原 issue 是否真问题、层次判断)
回归审查(既有行为清点)diff 触碰 3 个 src(
代码审查(主关)
测试有效性新套件 8 条断言全部有牙( 两点观察(均不拦合,披露如下)
结构化八问
CI23 项 check 当前全部 queued(仓库 run 积压),尚无绿/红判。本地未跑全量(共享资源纪律);新回归套件的断言我已逐条对照源码手工验证。最终绿以 head 收工判定:可合(pending CI 转绿)。分支侧无需我再改 —— 无缺陷需直修、无新 issue 需立;两点观察已在上方披露供 owner 知悉。合并权在人(GitHub PR #5305)。 |
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.7418-pr.5305.b6f64cfThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5305.tgz
npm install -g packageInstall instructions are refreshed on each push. |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.946-master.afdf889 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Fixes #5243
What was wrong
The codex-cli catalog install stores its model table ONLY in the file named by config.toml's
model_catalog_json— there is nomodels_cache.jsonat all. bili only ever readmodels_cache.json, so for those installs every request fell through to the flat 272K unknown-model fallback: windows clamped 1050000 -> 272000, nudge bands sized against 272K, emergency compression firing at ~35% of real usage.What this does
model_catalog_json— parsed from codex config.toml (base file, profile overlay, and -c CLI overrides all carry the key through the effective view). Relative paths resolve against $CODEX_HOME. Candidate order: catalog file first, then models_cache.json; a readable table stays authority even when a lookup misses (no cross-file fall-through).model_context_windowis set, size from the operator's own number and log one warn per model naming what happened.sourcefield on the alignment result, replacing the old static 'current client metadata preferred' text that lied when no client metadata existed.No wire changes, no kernel changes, no config-surface additions (reading a key from CODEx's OWN config.toml is discovery, not bili configuration).
Verification