Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 10, 2025

The "Edit with Copilot" feature in the query editor was inconvenient because it only opened chat with a pre-populated message but provided no automatic way to apply suggested changes back to the query settings. Users had to manually copy/paste between chat and the query editor, breaking the workflow.

This PR introduces an UpdateQueryTool that allows Copilot to automatically update GitHub search queries in VS Code settings during chat sessions.

Key Changes

UpdateQueryTool (src/lm/tools/updateQueryTool.ts):

  • New language model tool that accepts namespace, queryName, and newQuery parameters
  • Validates inputs and updates VS Code configuration settings directly
  • Handles different configuration targets (global, workspace, workspace folder)
  • Provides clear success/error messages

Enhanced Chat Context (src/common/settingsUtils.ts):

  • Modified openCopilotForQuery() to provide specific context about which query is being edited
  • Chat prompt now includes instructions for using the update tool
  • Passes namespace and query name to enable targeted updates

Tool Registration (src/lm/tools/tools.ts):

  • Registered the new tool with the language model system

User Experience Improvement

Before: User clicks "Edit with Copilot" → Chat opens → User describes changes → Copilot suggests new query → User must manually copy/paste back to editor

After: User clicks "Edit with Copilot" → Chat opens with context → User describes changes → Copilot automatically updates the query using the tool → Query is instantly applied

Example Interaction

User: "Add assignee:@me to this query"

Copilot calls the update_query tool with the enhanced query, and the user immediately sees:
"✅ Successfully updated query 'My Pull Requests' from 'is:pr state:open' to 'is:pr state:open assignee:@me'"

This eliminates the manual copy/paste step and keeps users in the natural chat flow while making real changes to their configuration.

Fixes #7749.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Edit Query flow is inconvenient Improve Edit Query flow with automatic query updates via UpdateQueryTool Sep 10, 2025
@Copilot Copilot AI requested a review from alexr00 September 10, 2025 14:11
Copilot finished work on behalf of alexr00 September 10, 2025 14:11
@alexr00 alexr00 closed this Oct 7, 2025
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.

Edit Query flow is inconvenient
2 participants