Repository navigation
Fix refresh failure caused by JSON-RPC sending [null] params to pet binary - #1442
Merged
Stella Huang (StellaHuang95) merged 1 commit intoApr 7, 2026
Merged
Conversation
Stella Huang (StellaHuang95)
requested a review
from Eleanor Boyd (eleanorjboyd)
April 6, 2026 23:01
Eduardo Villalpando Mello (edvilme)
approved these changes
Apr 7, 2026
Karthik Nadig (karthiknadig)
approved these changes
Apr 7, 2026
Stella Huang (StellaHuang95)
merged commit Apr 7, 2026
25f8721
into
microsoft:main
43 of 44 checks passed
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.
CI checks are failing
"before all" hook for "All extension commands are registered"getEnvironments finds Python installations when availablerefreshEnvironments completes without errorRoot cause
getRefreshOptions()innativePythonFinder.tsreturnsundefinedwhen no specific search options are needed (the common case for a full refresh). Whenundefinedis passed toconnection.sendRequest('refresh', undefined, token), thevscode-jsonrpclibrary serializes it as positional params:[null].The pet binary's Rust deserializer handles
nulland[](empty array) correctly, but not[null](array containing null). Serde tries to interpret the 1-element array as aRefreshOptionsstruct with 2 fields and fails.Fix
Changed
getRefreshOptions()to return{}instead ofundefinedwhen no options are specified. This sends a proper empty JSON object over the wire, which the pet binary correctly deserializes intoRefreshOptions { search_kind: None, search_paths: None }— a full global search using configured workspace directories.Why
{}is safesearch_kindandsearch_pathsareOption<T>in Rust —Noneis the expected defaultnormalize_refresh_paramsalready convertsnull→{}, so{}is the canonical "no options" formatif let Some(...)guards — no.unwrap()callsRefreshOptions::default(){}with both fields asNonetriggers a full global search — identical behavior to beforeChanges
src/managers/common/nativePythonFinder.ts:getRefreshOptions()now returns{}instead ofundefined, and its return type is simplified fromRefreshOptions | undefinedtoRefreshOptions