Fix: Explicit adapterConfig attach allow-lists and did-you-mean suggestions - #475
Closed
abhijeetnardele24-hash wants to merge 3 commits into
Closed
Conversation
debugmcpdev
requested changes
Aug 24, 2026
debugmcpdev
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for taking on #466 — the direction is right (per-adapter declared key sets instead of a deny-list, plus did-you-mean; that's what the issue asked for), and the Levenshtein helper with the short-string threshold adjustment is a nice touch. It needs a round of changes before it can merge:
Must fix
- Un-stack the branch. This PR currently contains your #473 and #474 commits plus the regenerated
pnpm-lock.yaml(which removes the securityoverridesblock and downgrades esbuild) and a placeholder edit topnpm-workspace.yaml. Rebase onto upstreammainwith only the #466 changes; the lockfile and workspace files must not appear in the diff. (#471 is now fixed on main via #476, and #474 has its own review.) - Truthful warning semantics. For python,
transformAttachConfigspreads unknown keys through to debugpy — so a key outsidesupportedAttachKeysis forwarded unrecognised, not "ignored". The issue was explicit about this refinement ("keep pass-through, just say so"): silence must never mean "understood", but the warning also must not claim we dropped something we actually sent. Suggest either (a) wording per adapter based on whether its transform passes unknowns through, or (b) actually stripping unknown keys when asupportedAttachKeyslist exists, so "ignored" becomes true — (b) is cleaner but is a behavior change worth a sentence in the PR body. - Keep stored state clean.
session.attachDroppedConfigKeysnow stores decorated strings likepathMapping (did you mean pathMappings?). That field is state, read later to build the user-facing warning — store bare key names and add the did-you-mean decoration only where the warning string is composed (session-manager-operations.ts~line 2832). Otherwise any future consumer comparing those entries against real config keys breaks. - Don't delete the #450 rationale. The doc comment on
transformAttachConfiginpackages/shared/src/interfaces/debug-adapter.tsexplains why the deny-list+pass-through contract existed. Amend it to describe the newsupportedAttachKeyslayer on top; the history of why is what stops the next person from re-simplifying it. - Tests. At minimum: unit tests for
didYouMean(exact match, 1-edit typo, below/above threshold, short-string behavior), and an attach-warning test asserting thepathMapping→pathMappingssuggestion end-to-end —tests/core/unit/server/server-redefine-and-attach.test.ts(the assertion at line ~441) shows the existing pattern for the #450 warning and must keep passing.
Should fix
- Cite the source for each
supportedAttachKeyslist in a comment (debugpy's attach schema; js-debug's pwa-node attach options). These lists are now load-bearing for warnings — a reviewer needs to know they weren't guessed. If a key's status is unclear, leaving it off is fine since this is warn-only, but say so.
Adapters beyond python/javascript falling back to the old behavior is fine for this PR. This one isn't gating the 0.25.0 release, so there's no rush — but it's a wanted change and I'd like to land it with your name on it.
This was referenced Aug 24, 2026
Collaborator
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.
Closes #466. Adds \supportedAttachKeys\ to debug adapters to strictly warn on unknown adapterConfig keys during attach, replacing the previous deny-list behavior. Also includes a did-you-mean helper to provide typo suggestions (e.g. pathMapping -> pathMappings).