Repository navigation
fix: bili omp launcher disables omp's native auto-compaction (#449) - #454
Conversation
prepareOmpHttpRewrite now always builds the <ompHome>-bili overlay (when the real home exists) and writes a generated config.yml with compaction.enabled=false merged over the real config.yml/config.yaml/settings.json, so omp's native auto-compaction (shouldCompact, gated by compaction.enabled) can no longer fire alongside bili's ACP compression and lossily rewrite the context. config.yml joins the overlay generated-file set (neither symlinked nor merged back into the real home, #410); models.yml is still generated only when present. Real config files are never touched. omp reads config.yml at runtime (settings.json is only a one-time migration source renamed to .bak), so this targets config.yml rather than settings.json as the issue first suggested. Stacked on the #447 pi fix (shared overlay machinery).
[bot] 🏷 On it. Confirmed this is an implementation task — PR #449 doesn't exist yet (404), and the open pi fix is #448 (branch Plan:
Will report back with the diff + verification results. |
Reviewed and verified this PR end-to-end. Status: complete and ready to merge once #448 lands. The fix is on branch I checked out the PR head and ran the full pre-flight locally:
The design matches the stated intent on every point I audited:
As part of review I re-implemented the change from the spec in a scratch branch and diffed it against the PR head — functionally identical (cosmetic differences only: loop structure, One minor, non-blocking note outside the stated scope: the line-based merge assumes block-style YAML. A hand-written flow-style value like I have not merged anything (merge is human-only) and left the PR open for you. Nothing further needed from my side. |
fix: land #454 (omp native compaction disable) on master — it was merged into its already-merged base branch
What
Mirror of the #447 pi fix for the
bili omplauncher.prepareOmpHttpRewritenow always builds the<ompHome>-bilioverlay (when the real home exists) and writes a generatedconfig.ymlwithcompaction.enabled=falsemerged over the realconfig.yml/config.yaml/settings.json. This stops omp's native auto-compaction (shouldCompact, gated bycompaction.enabled, on by default) from firing alongside bili's ACP compression and lossily rewriting the context.Key correction vs. the issue
The issue suggested writing
settings.json. Verified against omp source (@ranxianglei/omp-stable): omp readsconfig.ymlat runtime —MAIN_CONFIG_FILENAMES = ["config.yml", "config.yaml"],#configPath = <agentDir>/config.yml.settings.jsonis only a one-time migration source (renamed to.bakonce migrated). So the fix targetsconfig.yml. There is no env var or CLI flag to disable compaction;omp config set compaction.enabled false(which writes config.yml) is the only mechanism.Details
config.ymljoins the overlay generated-file set → neither symlinked nor merged back into the real home (真实 models.yml 可被塞进死端口代理地址且永不解包:"real file never touched" 前提被嵌套 merge-back 递归与遗留插件写破,裸 omp 永久拨死号 #410 rule).models.ymlis still generated only when present. Real config files are never touched.compaction:block with/withoutenabled:(override/insert), nocompaction:key (append), legacysettings.jsonfallback (written as JSON — a valid YAML subset omp parses fine), and empty home (minimal file).PI_CODING_AGENT_DIRalways points at the overlay and compaction is always disabled.Stacked on #448
Reuses the overlay machinery from the pi fix (
refreshOverlayHome/mergeOverlayEntryaccepting a set of generated files). Base is the pi branch; merge after #448 lands.Verification
npm run typecheck✅npm test✅ (904 pass)npm run build✅Bun.YAML.parse) across 7 scenarios (existing compaction block, no block, only-block, legacy settings.json fallback, empty home, config.yaml base, real-file-untouched): all produce valid YAML withcompaction.enabled === falseand other keys preserved.