Conversation
rdimitrov
previously approved these changes
Feb 24, 2026
lujunsan
previously approved these changes
Feb 24, 2026
ChrisJBurns
previously approved these changes
Feb 24, 2026
9855633
89ca7d4 to
9855633
Compare
rdimitrov
previously approved these changes
Feb 25, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3944 +/- ##
==========================================
- Coverage 68.56% 68.49% -0.07%
==========================================
Files 437 437
Lines 44662 44665 +3
==========================================
- Hits 30621 30593 -28
- Misses 11657 11686 +29
- Partials 2384 2386 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3 tasks
amirejaz
previously approved these changes
Mar 3, 2026
4c0f5ce to
63386a2
Compare
026abcc to
e44fed1
Compare
Guard against typed nil pointers wrapped in non-nil ServerMetadata interfaces across all call sites. Protocol scheme images (npx://, uvx://, go://) returned nil *ImageMetadata from handleProtocolScheme, which when converted to a ServerMetadata interface became non-nil, causing panics on method calls like GetTransport(). Fixes #3940 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e44fed1 to
c9239a9
Compare
amirejaz
approved these changes
Mar 4, 2026
reyortiz3
pushed a commit
that referenced
this pull request
Mar 4, 2026
…ges (#3944) Guard against typed nil pointers wrapped in non-nil ServerMetadata interfaces across all call sites. Protocol scheme images (npx://, uvx://, go://) returned nil *ImageMetadata from handleProtocolScheme, which when converted to a ServerMetadata interface became non-nil, causing panics on method calls like GetTransport(). Fixes #3940 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
npx://,uvx://,go://) without an explicit--transportflag. The panic was caused by a classic Go "typed nil in interface" bug wherehandleProtocolSchemereturned a nil*ImageMetadatathat was wrapped as a non-nilServerMetadatainterface.GetMCPServer) and defensively at all call sites across CLI, API, and MCP server packages.resolveTransportTypeandresolveServerNamecovering nil interface, typed-nil-in-interface, and valid metadata scenarios.Root cause
handleProtocolSchemedeclaredvar imageMetadata *types.ImageMetadata(nil) and returned it without assignment.GetMCPServerreturned this nil*ImageMetadataas atypes.ServerMetadatainterface, creating a non-nil interface wrapping a nil pointer.resolveTransportTypecheckedserverMetadata != nil(true), then calledserverMetadata.GetTransport()which panicked because the promoted method fromBaseServerMetadatarequires dereferencing the nil outer struct.Why e2e tests didn't catch it
Every protocol scheme e2e test passes
--transportexplicitly ("--transport", "stdio"or"--transport", "streamable-http"), causingresolveTransportTypeto return early without ever callingserverMetadata.GetTransport().Changes
pkg/runner/retriever/retriever.goimageMetadataasServerMetadatainterface; cleaned uphandleProtocolSchemeto returnnildirectlycmd/thv/app/run_flags.goresolveTransportType,buildRunConfig, andconfigureRemoteAuthpkg/api/v1/workload_service.goImageMetadataandRemoteServerMetadata; safe transport resolutionpkg/mcp/server/run_server.goImageMetadatacmd/thv/app/run_flags_test.goresolveTransportTypeandresolveServerNamewith typed-nil casesTest plan
go build ./...passestask lintpasses (0 issues)thv run npx://@zereight/mcp-gitlab --name gitlabno longer panics (manual)Fixes #3940
🤖 Generated with Claude Code