Skip to content

Provide summary of code to be executed #7748

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 3 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions extensions/positron-assistant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@
"language": {
"type": "string",
"description": "The programming language of the code."
},
"summary": {
"type": "string",
"description": "A very short summary of the task the code is performing, beginning with a verb and not to exceed 7 words. Shown to the user to help them understand what the code will do."
}
}
},
Expand Down
8 changes: 6 additions & 2 deletions extensions/positron-assistant/src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ export function registerAssistantTools(

context.subscriptions.push(selectionEditTool);

const executeCodeTool = vscode.lm.registerTool<{ code: string; language: string }>(PositronAssistantToolName.ExecuteCode, {
const executeCodeTool = vscode.lm.registerTool<{
code: string;
language: string;
summary: string;
}>(PositronAssistantToolName.ExecuteCode, {
/**
* Called by Positron to prepare for tool invocation. We use this hook
* to show the user the code that we are about to run, and ask for
Expand All @@ -145,7 +149,7 @@ export function registerAssistantTools(

/// The message shown to confirm that the user wants to run the code.
confirmationMessages: {
title: vscode.l10n.t('Run in Console'),
title: options.input.summary ?? vscode.l10n.t('Run in Console'),
message: ''
},
};
Expand Down