Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Trailing whitespace in githubIssues.queries configuration causes GitHub's search API to return different results, as shown in the screenshots where the same query with/without a trailing space displays different issues.

Changes

  • src/issues/stateManager.ts: Added .trim() to query string after variable substitution before passing to GitHub API
  • src/test/issues/stateManager.test.ts: Added test verifying queries with trailing whitespace are properly trimmed

The fix handles the case where users accidentally include whitespace when editing their query configuration:

// Before: whitespace passed directly to API
variableSubstitution(query.query, undefined, undefined, user)

// After: whitespace trimmed
variableSubstitution(query.query, undefined, undefined, user).trim()

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /opt/hostedtoolcache/node/20.19.6/x64/bin/node /opt/hostedtoolcache/node/20.19.6/x64/bin/node ./out/src/test/runTests.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Blank space at end of query string produces different results</issue_title>
<issue_description>

Version: 1.100.0-insider (user setup)
Commit: ecbbe26188235072fbde7b6f4fd2a0bd6a7c9909
Date: 2025-04-29T05:04:19.843Z
Electron: 34.5.1
ElectronBuildId: 11369351
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.22635
  • Extension version: 0.109.2025042904 (pre-release)

  • Repository Clone Configuration (single repository/fork of an upstream repository): https://github.com/chrisdias/todo-app

  • Github Product (Github.com/Github Enterprise version x.x.x): Enterprise (not sure what... Microsoft)

A blank space at the end of a query string returns different results.

Blank space at end

Image

Remove the blank space, now I get an issue from another repository (the "Product Feedbac...") issue.

Image</issue_description>

<agent_instructions>Trim the query string before running it</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 10, 2025 16:47
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix blank space issue at end of query string Trim whitespace from issue query strings Dec 10, 2025
Copilot AI requested a review from alexr00 December 10, 2025 16:54
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.

Blank space at end of query string produces different results

2 participants