From 8155aae96baa1ab88e01de57e1180911bcf3c0df Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Fri, 13 Feb 2026 08:18:58 -0800 Subject: [PATCH] bug: fix path resolution to use resolved environment directly from setting --- src/features/interpreterSelection.ts | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/features/interpreterSelection.ts b/src/features/interpreterSelection.ts index e2aee39e..58f976d4 100644 --- a/src/features/interpreterSelection.ts +++ b/src/features/interpreterSelection.ts @@ -391,28 +391,12 @@ async function tryResolveInterpreterPath( } if (manager && resolvedEnv) { - // Create a wrapper environment that uses the user's specified path - const newEnv: PythonEnvironment = { - envId: { - id: `defaultInterpreterPath:${interpreterPath}`, - managerId: manager.id, - }, - name: 'defaultInterpreterPath: ' + (resolved.version ?? ''), - displayName: 'defaultInterpreterPath: ' + (resolved.version ?? ''), - version: resolved.version ?? '', - displayPath: interpreterPath, - environmentPath: Uri.file(interpreterPath), - sysPrefix: resolved.prefix ?? '', - execInfo: { - run: { - executable: interpreterPath, - }, - }, - }; + // Use the resolved environment directly - it has the canonical ID format + // The 'source' field tracks that this came from defaultInterpreterPath setting traceVerbose( - `[tryResolveInterpreterPath] Resolved '${interpreterPath}' to ${resolved.executable} (${resolved.version})`, + `[tryResolveInterpreterPath] Resolved '${interpreterPath}' to ${resolved.executable} (${resolved.version}) with ID ${resolvedEnv.envId.id}`, ); - return { manager, environment: newEnv, source: 'defaultInterpreterPath' }; + return { manager, environment: resolvedEnv, source: 'defaultInterpreterPath' }; } } traceVerbose(