Skip to content

[PR] fix(zcode): recognize our legacy bili mcp shim so installs can repair it - #4285

Closed
sorasoras wants to merge 1 commit into
ranxianglei:masterfrom
sorasoras:2026-10-22_zcode-legacy-mcp-face
Closed

sorasoras wants to merge 1 commit into
ranxianglei:masterfrom
sorasoras:2026-10-22_zcode-legacy-mcp-face

Conversation

@sorasoras

@sorasoras sorasoras commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

removed

Pre-ranxianglei#1145 installs managed mcp.servers.bili as a `bili mcp` shim (command
bili/bili.exe, args ["mcp"]) instead of pointing at dist/zcode/mcp-entry.js.
isOursZcodeMcpServer() only matched the current dist path, so the entry this
installer itself wrote was classified as foreign:

- inspectLanePresence() and zcodeStatus() reported "hook present, MCP face
  missing" for a lane that is merely stale;
- applyZcodeManagedConfig() threw "already defines mcp.servers.bili owned by
  something else — refusing to overwrite", so `bili plugin install zcode`
  could never repair its own leftover. The only fix was hand-editing
  ~/.zcode/cli/config.json, which is exactly what an upgrade should avoid.

Recognize the legacy shim as ours for OWNERSHIP (install replaces it in place
with a note, remove strips it) while keeping the HEALTH check on the current
dist face, so status still surfaces the stale shim with an actionable pointer.
A user-authored "bili" server (other command or other args) still throws.

Tests: tests/zcode-legacy-mcp-face.test.ts — upgrade in place, stale-face
status, remove, foreign server refused, lookalike args refused.
@ranxianglei ranxianglei changed the title fix(zcode): recognize our legacy bili mcp shim so installs can repair it [PR] fix(zcode): recognize our legacy bili mcp shim so installs can repair it Oct 22, 2026
@sorasoras

Copy link
Copy Markdown
Contributor Author

Withdrawing this PR: the implementation in question is the reporter's own, so it is being removed to avoid duplicating/claiming it.

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