Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 4, 2025

The findVirtualEnvironments function in src/managers/builtin/venvUtils.ts was incorrectly logging "Invalid conda environment" when encountering invalid venv environments.

Issue

When the function processes venv environments and encounters one with missing required properties (prefix, executable, or version), it logs an error message that incorrectly references "conda environment" instead of "venv environment".

Root Cause

The function specifically filters for venv environments using:

.filter((e) => e.kind === NativePythonEnvironmentKind.venv)

But the error logging was copy-pasted from conda-related code and never updated:

log.warn(`Invalid conda environment: ${JSON.stringify(e)}`);  // ❌ Wrong!

Fix

Updated the log message to correctly reference the environment type being processed:

log.warn(`Invalid venv environment: ${JSON.stringify(e)}`);   // ✅ Correct!

This change ensures consistency with the function's purpose and with the success log message which already correctly states "Found venv environment".

Verification

  • ✅ Only affects the error log message text
  • ✅ No functional behavior changes
  • ✅ Consistent with existing success log message
  • ✅ No other instances of this issue found in codebase
  • ✅ Passes all linting checks

Created from VS Code via the GitHub Pull Request extension.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] update to correctly reference invalid venv environment not conda Fix incorrect log message referring to conda environment in venv validation Sep 4, 2025
Copilot AI requested a review from eleanorjboyd September 4, 2025 20:22
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.

2 participants