-
Notifications
You must be signed in to change notification settings - Fork 126
Positron nb assistant actions #10549
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
Conversation
…r handling for AI suggestions. Added conditional context for activation and ensured quick pick items are restored correctly after suggestions generation.
…e user closes the quickpick
…n2 async aware for run action method
…ation are consistent across chat pane, suggestions, and inline chat. Also reduced unneccesary repetition of notebook serialization for each recursive prompt generation call.
|
E2E Tests 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new "Ask Assistant" action to the notebook action bar that provides quick access to context-aware assistant prompts, enabling users to quickly interact with the AI assistant for common notebook tasks or AI-generated suggestions tailored to the current notebook state.
Key Changes
- Introduced
AskAssistantActionwith a quick pick interface for predefined prompts (describe notebook, add comments, suggest next steps) and custom user prompts with a 15,000-character limit - Implemented AI-powered suggestion generation that analyzes notebook execution state, errors, outputs, and cell content to propose contextual actions
- Centralized notebook context serialization logic in
serializeNotebookContextto ensure consistency across chat pane, suggestions, and inline chat features
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/positronNotebook/browser/positronNotebook.contribution.ts | Extracted NotebookAction2 base class and imported AskAssistantAction registration |
| src/vs/workbench/contrib/positronNotebook/browser/NotebookAction2.ts | New base class for notebook-level actions with async support for Promise-based operations |
| src/vs/workbench/contrib/positronNotebook/browser/AskAssistantAction.ts | New action implementing the assistant quick pick UI with predefined prompts, custom prompt validation, and AI suggestion generation |
| src/vs/platform/quickinput/browser/media/quickInput.css | CSS fix to prevent spinner wobbling in quick pick items by setting transform-origin |
| extensions/positron-assistant/src/tools/notebookUtils.ts | Added centralized serializeNotebookContext function with integrated filtering logic and helper functions for notebook context operations |
| extensions/positron-assistant/src/promptRender.ts | Updated to use new SerializedNotebookContext interface instead of raw notebook context |
| extensions/positron-assistant/src/participants.ts | Moved getAttachedNotebookContext to notebookUtils.ts to centralize notebook context handling |
| extensions/positron-assistant/src/notebookSuggestions.ts | New module implementing AI-powered notebook suggestion generation with JSON validation and model selection logic |
| extensions/positron-assistant/src/notebookContextFilter.ts | Added unused getCellsToInclude helper function (logic now in serializeNotebookContext) |
| extensions/positron-assistant/src/md/prompts/notebook/suggestions.md | New system prompt template for AI suggestion generation with guidelines and examples |
| extensions/positron-assistant/src/extension.ts | Registered new generateNotebookSuggestions command for AI-powered suggestion generation |
| extensions/positron-assistant/src/api.ts | Updated to use new hasAttachedNotebookContext helper for tool availability checks |
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/positronNotebook/browser/AskAssistantAction.ts:348
- Extra trailing blank line that should be removed for consistency with coding standards.
src/vs/workbench/contrib/positronNotebook/browser/NotebookAction2.ts:33 - Extra trailing blank line that should be removed for consistency with coding standards.
Summary
Adds a new "Ask Assistant" action to the notebook action bar that provides quick access to context-aware assistant prompts. The feature includes both predefined prompts for common notebook tasks and optional AI-powered suggestions that adapt to the current notebook state.
assistant-notebook-actions.mov
Demo of :
Key capabilities:
Technical improvements:
NotebookAction2to support async action executionRelease Notes
New Features
Bug Fixes
QA Notes
@:notebooks @:assistant
Prerequisites:
Testing steps:
Test predefined prompts:
Test AI suggestions:
Test custom prompts:
Test edge cases:
Test different notebook states: