Skip to content

fix(codelldb): read raw VSIX version metadata - #1092

Merged
debugmcpdev merged 5 commits into
debugmcp:mainfrom
gezerui888:fix/codelldb-vsix-version
Nov 5, 2026
Merged

debugmcpdev merged 5 commits into
debugmcp:mainfrom
gezerui888:fix/codelldb-vsix-version

Conversation

@gezerui888

Copy link
Copy Markdown
Contributor

📋 Description

doctor rust reports the compiled CodeLLDB version when CODELLDB_PATH points to an extracted VSIX. That layout stores its version in extension/package.json.

I read the selected engine's manifest after its version.json and before metadata from other installations. I added resolver and built-CLI regressions for this order and the existing fallback behavior.

Fixes #1066

🔄 Type of Change

  • 🐛 Bug fix

✅ Checklist

  • My code follows the style guidelines of this project
  • I reviewed my code
  • I commented the test setup where needed
  • I added a changelog fragment
  • My changes generate no new warnings
  • I added tests that reproduce the defect
  • New and existing unit tests pass locally with my changes

🧪 Testing

I ran these checks with Node 22.23.4, Python 3.12 and JDK 21 on macOS arm64.

pnpm run lint
pnpm run typecheck:all
pnpm run clean
pnpm run build
pnpm run test:unit --maxWorkers=4
pnpm run test:integration
pnpm run check:docs
pnpm run check:all-personal-paths
pnpm run changelog:check

The unit suite passed 8,094 tests. The existing DartAdapterFactory default io SDK-discovery test timed out on both this branch and clean main. Both runs skipped the same three tests. Main passed 8,086 tests.

Integration passed 121 tests, compared with 118 on main. Both runs skipped the same nine tests. The raw-VSIX CLI regression failed on main and passed after the fix. Lint, type checks, clean build, documentation, path and changelog checks passed.

cc @debugmcpdev

Signed-off-by: gezerui0124 <gezerui1997@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T02:57:23.965225Z d9e5136 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

cynarlab and others added 4 commits November 5, 2026 09:09
…n root, never another install's (debugmcp#1066)

Builds on d9e5136 (the raw VSIX package.json candidate). getCodeLLDBVersion
still walked every install's metadata — the four vendor candidates (cwd
fallback included) and the platform package — before the compiled default, so
a CODELLDB_PATH binary with no metadata of its own was reported with some other
copy's version, and the new package.json candidate accepted any manifest two
levels above the binary (a project's own under a hand-placed or symlinked
binary) and let a version.json without a `version` short-circuit to the
constant.

Now: realpath the resolved binary, read <root>/version.json, then
<root>/package.json only when its name is vscode-lldb (the upstream manifest),
and stop. A vendored copy with no readable metadata keeps the pin the vendor
script fetched; any other source reports no version (null) instead of a guess.
`codelldbVersion` is only rendered by the three doctor rows, so null drops the
cell. Unit cases cover the vendored, CODELLDB_PATH (symlink included) and
platform-package sources, each asserting no read outside the resolved root.

docs/diagnostics.md says where the version is read from; the fragment credits
the contributor.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… proves the bare-binary case (debugmcp#1066)

doctor is invoked with --timeout 60000, the CLI kill is 90 s and each case has
120 s: the rust probe runs `cargo -vV`, which the canary has seen take over
30 s on a cold Windows runner, and the doctor's default 10 s probe budget would
have timed the row out and lost the backend cell. The bundle is copied once per
file (each case gets its own extraction dir), the empty-stderr assertion goes
(a Node warning from the bundle is not a resolver fault), and a fourth case
proves a binary whose only neighbour is someone else's package.json reports no
version key at all.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…leases after 0.26.0 (debugmcp#1066)

The omit-optional leg provisions the VSIX at the checkout's pin and doctor now
reads that extraction's package.json, so backend.version must equal the pin —
the assertion debugmcp#1066 asked for. Releases up to 0.26.0 reported the CLI's
compiled default, so the check is gated on the published CLI's version being
greater than 0.26.0 (dotted core compared numerically, prerelease suffix
ignored) and skipped with a notice otherwise. Dry-run locally against 0.26.0,
0.26.1 and 0.27.0-beta.1 with matching and mismatching engine versions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@debugmcpdev debugmcpdev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed line by line and hardened on the branch (the attribution rule, the manifest guard, CI-sized doctor budgets, the canary assertion); the pre-push hook and all fifteen CI checks are green on the final head.

@debugmcpdev
debugmcpdev merged commit c6663ba into debugmcp:main Nov 5, 2026
15 checks passed
@debugmcpdev

Copy link
Copy Markdown
Collaborator

Thank you, @gezerui888 — a correct fix with real regression tests on both layers, and the first PR here from you. Merged.

Rather than a review round-trip I took the branch over and built on your commit (it stays yours in the squash). What I added, and why:

  • The version is now read only from the resolved binary's own root. Your candidate was the right one, but the walk still went on to the other installs' version.json (the four vendor candidates, the platform package) and then the compiled default when neither sibling file existed, so a CODELLDB_PATH binary without metadata was still reported with some other copy's number — the same misattribution doctor: getCodeLLDBVersion under CODELLDB_PATH reports the CLI's compiled default — a raw VSIX extraction has no version.json #1066 describes, one step narrower. A vendored copy with no readable metadata keeps the pin; any other source now reports no version at all rather than a guess.
  • The manifest is accepted only when its name is vscode-lldb (the upstream extension's), so a project's own package.json two levels above a hand-placed binary (<myapp>/bin/codelldb) is never reported as the engine version; the path is realpath'd first so a symlinked CODELLDB_PATH reads where it points.
  • A version.json that parses but has no version now falls through to the manifest instead of short-circuiting to the constant (your table pinned the old behaviour honestly; it was the one asymmetry left).
  • CI-sized budgets in the integration test: the rust probe runs cargo -vV, which the canary has seen take over 30 s on a cold Windows runner, and the doctor's default 10 s probe budget would have timed the row out — so doctor runs with --timeout 60000, the kill at 90 s, each case at 120 s; the empty-stderr assertion went (a Node warning from the bundle is not a resolver fault); the bundle is copied once per file; and a fourth case proves the bare-binary answer.
  • The canary's CODELLDB_PATH leg asserts the engine version for releases after 0.26.0 — the check the issue was filed to make possible.

Thanks again — the next release carries it, with the changelog line crediting you.

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.

doctor: getCodeLLDBVersion under CODELLDB_PATH reports the CLI's compiled default — a raw VSIX extraction has no version.json

3 participants