Skip to content

Migrate LLM tools and remove Positron Assistant#14718

Open
timtmok wants to merge 10 commits into
mainfrom
14638-migrate-positron-assistant
Open

Migrate LLM tools and remove Positron Assistant#14718
timtmok wants to merge 10 commits into
mainfrom
14638-migrate-positron-assistant

Conversation

@timtmok

@timtmok timtmok commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #14638

Summary

As part of reverting to Copilot Chat, the Positron Assistant extension is no longer needed. This PR removes the positron-assistant extension and migrates the pieces Copilot Chat still relies on into Positron core, so core can supply Positron-specific context (runtime sessions, variables, code execution) to Copilot Chat through the Positron API.

  • Removes the positron-assistant extension -- participants, tools, prompt rendering, provider configuration/migration, and its tests -- along with its entries in product.json and the build config (gulpfile.extensions.ts, dirs.ts, .vscode-test.js).
  • Migrates to core under src/vs/workbench/contrib/positronAssistant/: the prompt template engine and renderer, the chat prompt templates, the Positron assistant tools, and the execute-code observer.
  • Extends the Positron API with the assistant's LLM tools and a tool filter (positronToolFilter.ts), wired through mainThreadAiFeatures / extHostAiFeatures, so Copilot Chat consumes Positron context via the public API rather than a bundled extension.
  • Updates Copilot Chat (extensions/copilot/) to render the Positron assistant prompt and register the migrated tools through the Positron API.

Release Notes

New Features

Bug Fixes

  • N/A

Validation Steps

@:assistant @:posit-assistant

  1. Open Copilot Chat and start a Python or R session.
  2. Ask a question that requires Positron context (e.g. "what variables are in my session?" or "run this code and explain the output").
  3. Verify the assistant sees the active session, can list variables, and can execute code in the console.
  4. Confirm the positron-assistant extension no longer appears in the Extensions view.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

Warning

Unrecognized tag(s) in the PR description, ignored: @:posit-assistant. Check for a typo, or see the valid tags list.

Warning

This PR touches Positron directories that aren't mapped in test-tag-paths-map.json:

  • extensions/authentication/
  • extensions/copilot/src/extension/prompts/node/base/positronAssistant.tsx/
  • extensions/copilot/

Add an entry for each (an e2e tag or [] for no coverage) so future changes are tagged automatically.

readme  valid tags  why these tags?

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

PETE's assessment 🧪

Verdict: 🟢 Adequate -- every substantive migrated unit (tool filter, session tools, execute-code observer, prompt engine/renderer, session-variable queries) ships with a new behavior-exercising Vitest suite.

What changed

  • Removes the positron-assistant extension entirely (source + its Mocha tests + build/product wiring) and migrates the still-needed pieces into core under src/vs/workbench/contrib/positronAssistant/.
  • Adds a public tool-availability policy (positronToolFilter.ts) and prompt/tool machinery to core, wired through mainThreadAiFeatures/extHostAiFeatures, plus a shared sessionVariableQueries.ts helper.
  • Rewires Copilot Chat (positronAssistant.tsx, toolsService.ts) to consume the migrated logic via require('positron') with a graceful fallback when the host is absent.

Tests in this PR

  • Unit (Vitest/Mocha) ✅ (added positronToolFilter, positronAssistantTools, positronAssistantToolUtils, positronExecuteCodeObserver, promptRenderer, promptSessions, sessionVariableQueries .vitest; updated copilot positronAssistant.spec)
  • Extension host ✅ (deleted with the extension; migrated logic is now unit-tested in core)
  • E2E (Playwright) ✅ (existing @:assistant/@:posit-assistant tests cover the Copilot-context workflow; behavior is preserved, not new)

Existing coverage

The migrated units are now covered by new Vitest suites rather than the deleted extension-host Mocha tests. The removed participants.test.ts, providerMigration.test.ts, fileExclusion.test.ts, etc. tested code that was deleted, not migrated. The thin orchestration in mainThreadAiFeatures.$generateAssistantPrompt (assembling mode prompt + context + session refs) is not directly tested, but all of its building blocks (renderModePrompt, getPositronContextPrompts, getForegroundSessionInfo, xml.node) are individually covered.

Suggested additions

None required. Optional, if you want to tighten the net: a few secondary branches of getEnabledTools are untested (vscode_editFile_internal suppression for Positron participants, Ask-mode Copilot vscode_codesearch pass-through, positron-prefixed tool gating). These are low risk but cheap to add to the existing positronToolFilter.vitest.ts.

Suggested tags (optional)

None -- the PR body already includes @:assistant and @:posit-assistant, which select the relevant existing e2e coverage for the Copilot-context path.


PETE (Positron Extreme Test Experiment) - LLM-based test-coverage advisor, in pilot. Triggers on PR open and on /recheck-tests comments. Wrong verdict? Comment /recheck-tests (or /rePETE) on this PR to re-run. Please share feedback on how PETE performed here.

@timtmok timtmok marked this pull request as ready for review July 8, 2026 14:10
@timtmok timtmok requested a review from melissa-barca July 8, 2026 14:10
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.

Remove Positron Assistant extension

1 participant