Skip to content

Smarter assistant python pkg install #8337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 27, 2025

Conversation

nstrayer
Copy link
Contributor

@nstrayer nstrayer commented Jun 27, 2025

Note

This is the same as #8289 just applied to main instead of the release branch.

Addresses #8174.

Adds a new installPythonPackage tool that enables the Assistant to directly install Python packages instead of suggesting !pip commands that don't work in Positron's environment. The Assistant can now handle package installation requests by invoking the appropriate package manager (pip, uv, conda) through the integrated tool.

Note: This may be way too intense of a fix for a simple behavior change. Not at all married to the whole new tool at all.

Release Notes

New Features

  • N/A

Bug Fixes

  • Assistant can now directly install Python packages instead of suggesting non-functional
    !pip commands

QA Notes

Ask the Assistant to install Python packages like palmerpenguins and plotnine. The Assistant should now use the built-in installation tool rather than suggesting !pip commands.

Test in assistant

# Ask: "Install palmerpenguins and plotnine for me"
# Expected: Assistant uses the installPythonPackage tool to install packages directly
# Packages should be installed successfully without user needing to run terminal commands

The Assistant should no longer suggest !pip install commands and instead handle package installation automatically using the new tool.

Copy link

github-actions bot commented Jun 27, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical

readme  valid tags

@nstrayer nstrayer force-pushed the smarter-assistant-python-pkg-install branch from 937652d to 25bc652 Compare June 27, 2025 17:53
nstrayer added 10 commits June 27, 2025 13:54
Creates InstallPackagesCommandHandler with validation, error handling, and support for multiple package managers through the existing installation channel system.
Adds command registration, constants, and service bindings to expose installPackages command through VS Code's command system.
Implements installPythonPackage tool with terminal confirmation dialogs and structured error handling for different failure scenarios.
Adds comprehensive installation workflow guidance and examples to prevent \!pip usage and ensure proper tool usage.
format using prettier.

Reset unneccesary changes to agent prompt

Move _last_ code inside of positron fence

Fix comma splice and improve package install confirmation message

Fix prettier formatting in commands.ts
@nstrayer nstrayer force-pushed the smarter-assistant-python-pkg-install branch from 25bc652 to 0e13717 Compare June 27, 2025 17:54
@nstrayer nstrayer merged commit 5f6eab9 into main Jun 27, 2025
29 checks passed
@nstrayer nstrayer deleted the smarter-assistant-python-pkg-install branch June 27, 2025 17:59
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant