fix(#638): codex plugin install self-heals malformed blocks instead of short-circuiting on the origin line - #685
Merged
Conversation
…f short-circuiting on the origin line The 'already installed' check compared only the BILI_MCP_PROXY line, so a malformed [mcp_servers.bili] block (args as a quoted string — legal TOML, invalid codex schema) survived reinstall untouched and codex kept failing with 'expected a sequence'. Now the whole block is compared against the canonical codexBlock(): byte-equal -> already installed; anything else -> rewritten in place, with an explicit hint when args was not an array. Fixes #638
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-685Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr685.tgz
npm install -g packageThis comment is automatically updated on each push. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #638
问题
codexInstall()(v0.1.95)在[mcp_servers.bili]块已存在时,只比对BILI_MCP_PROXY那一行判断「已安装」。当块畸形(典型:args被写成字符串 — 合法 TOML 但 codex schema 要求数组)且 origin 行恰好匹配时,重装直接返回already installed,畸形args原样保留 → codex 持续报expected a sequence,升级/重装这条最自然的自愈路径失效。修复
codexBlock()规范块比对(两侧trimEnd()归一,容忍尾部换行差异)args/command/ 路径 / 格式)args为字符串的畸形块额外提示:codex: refreshed [mcp_servers.bili] -> … (repaired args: was not an array),不再让用户去啃 codex 的 serde 报错already installed文案(幂等,重跑不重写文件)测试
tests/plugin-agent.test.ts 新增 #638 回归:
pluginInstall("codex")→ 输出含repaired args: was not an array,args = [数组形态,相邻[mcp_servers.other]表不受影响already installed(不再反复重写)refreshed、追加表后already installed、header-only 边缘删除)全部保持全套 1298/1298 通过,typecheck / build ✓。