Skip to content

Expose verso_* tools to Copilot agent mode - #102

Open
4D-Bird wants to merge 1 commit into
DataficationSDK:mainfrom
4D-Bird:fix/agent-mode-tool-visibility
Open

Expose verso_* tools to Copilot agent mode#102
4D-Bird wants to merge 1 commit into
DataficationSDK:mainfrom
4D-Bird:fix/agent-mode-tool-visibility

Conversation

@4D-Bird

@4D-Bird 4D-Bird commented Aug 15, 2026

Copy link
Copy Markdown

Problem

The VS Code extension's README states:

Agent mode: Verso registers twenty language model tools, so Copilot can list, add, edit, move, and run cells … without you typing @verso at all.

On current VS Code this does not work: none of the verso_* tools appear in the agent-mode tool set or the tools picker. They are only reachable through the @verso participant, which runs its own tool-calling loop and doesn't share the main agent's conversation context.

Root cause

All 20 tools in vscode/package.json declare "canBeReferencedInPrompt": false. VS Code uses this flag to decide which extension tools enter agent mode:

  • src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.ts — tools included only if (tool.canBeReferencedInPrompt)
  • src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.ts — same filter in the tools picker
  • Docs: https://code.visualstudio.com/api/extension-guides/ai/tools — "Set to true if the tool can be used with agents or referenced in chat."

The fix (and why toolReferenceName is mandatory)

Setting only canBeReferencedInPrompt: true breaks the extension: VS Code rejects such tools at scan time (languageModelToolsContribution.ts: "CANNOT register tool with 'canBeReferencedInPrompt' set without a 'toolReferenceName'"), and every vscode.lm.registerTool() call then fails with Error: Tool "verso_listCells" was not contributed. — which also breaks @verso itself.

This PR sets, for every tool: "canBeReferencedInPrompt": true + "toolReferenceName": "<tool name>" (pattern ^[\w-]+$ — tool names already qualify).

Verification

Patched a local v1.2.1 install (VS Code 1.133.0): after reload, all 20 tools appear and work: list/add/update/remove/move cells, change type & language (C#→F#), run cell/run-all (stdout + final-expression values), list/inspect variables, add/update/remove parameters, get/update cell properties, list/switch layouts. @verso continues to work unchanged.

All 20 language model tools declared canBeReferencedInPrompt: false,
which excludes them from the agent-mode tool set and the tools picker;
they were only reachable through the @verso participant. Set
canBeReferencedInPrompt: true and add the required toolReferenceName
(the tool's own name) for every tool.

Signed-off-by: 4D-Bird <180421459+4D-Bird@users.noreply.github.com>
@TorreyBetts

Copy link
Copy Markdown
Contributor

Thanks for submitting this PR, it's a great catch. The one thing holding it up is the sign off. Verso takes contributions under the DCO, and for an MIT project the value of that is a clean provenance chain on every commit, so CONTRIBUTING.md asks for a real name and a reachable email rather than a handle and a GitHub noreply address.

If that's not something you want to update your commit with, it's okay. Let me know and I'll recreate your work on my end and make sure you get credited for it.

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