microsoft / vscode-pull-request-github

GitHub Pull Requests for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
MIT License
2.31k stars 576 forks source link

Suggested fix not rendered #6354

Open chrmarti opened 3 hours ago

chrmarti commented 3 hours ago

Testing #6321

It looks like there was a response, but that was not rendered: Image

copilotLanguageModelWrapper - b3b1f9c0 Metadata url : https://api.enterprise.githubcopilot.com/chat/completions model : gpt-4o maxPromptTokens : 64000 maxResponseTokens: 4096 location : 4 postOptions : {"temperature":0.1,"top_p":1,"max_tokens":4096,"tools":[{"type":"function","function":{"name":"copilot_codebase","description":"Search for relevant file chunks, symbols, and other info about the current workspace or codebase","parameters":{"type":"object","properties":{"query":{"type":"string","description":"The query to search the codebase for. Should contain all relevant context. Can be a full natural language sentence, or keywords."}},"required":["query"]}}},{"type":"function","function":{"name":"copilot_vscodeAPI","description":"Use VS Code API references to answer questions about VS Code extension development.","parameters":{"type":"object","properties":{"query":{"type":"string","description":"The query to search vscode documentation for. Should contain all relevant context."}},"required":["query"]}}},{"type":"function","function":{"name":"github-pull-request_issue_fetch","description":"Get a GitHub issue/PR's details as a JSON object.","parameters":{"type":"object","properties":{"repo":{"type":"object","description":"The repository to get the issue/PR from.","properties":{"owner":{"type":"string","description":"The owner of the repository to get the issue/PR from."},"name":{"type":"string","description":"The name of the repository to get the issue/PR from."}},"required":["owner","name"]},"issueNumber":{"type":"number","description":"The number of the issue/PR to get."}},"required":["issueNumber"]}}},{"type":"function","function":{"name":"github-pull-request_notification_fetch","description":"Get a GitHub notification's details as a JSON object.","parameters":{"type":"object","properties":{"thread_id":{"type":"string","description":"The notification thread id."}},"required":["thread_id"]}}},{"type":"function","function":{"name":"github-pull-request_issue_summarize","description":"Summarizes a GitHub issue or pull request. A summary is a great way to describe an issue or pull request.","parameters":{"type":"object","properties":{"title":{"type":"string","description":"The title of the issue/PR"},"body":{"type":"string","description":"The body of the issue/PR"},"comments":{"type":"array","items":{"type":"string"},"description":"The array of associated string comments"},"fileChanges":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","description":"The name of the file of the change"},"patch":{"type":"string","description":"The patch of the change"}}},"description":"For a PR, the array of associated file changes"}},"required":["title","body","comments"]}}},{"type":"function","function":{"name":"github-pull-request_notification_summarize","description":"Summarizes a GitHub notification. A summary is a great way to describe a notification.","parameters":{"type":"object","properties":{"lastReadAt":{"type":"string","description":"The last read time of the notification."},"lastUpdatedAt":{"type":"string","description":"The last updated time of the notification."},"unread":{"type":"boolean","description":"Whether the notification is unread."},"title":{"type":"string","description":"The title of the notification issue/PR"},"body":{"type":"string","description":"The body of the notification issue/PR"},"unreadComments":{"type":"array","items":{"type":"string"},"description":"The array of unread comments under the issue/PR of the notification"},"threadId":{"type":"number","description":"The thread id of the notification"},"notificationKey":{"type":"string","description":"The key of the notification"},"fileChanges":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","description":"The name of the file of the change"},"patch":{"type":"string","description":"The patch of the change"}},"required":["fileName","patch"]},"description":"For a notification about a PR, the array of associated file changes"}},"required":["title","unreadComments","lastUpdatedAt","unread","threadId","notificationKey"]}}},{"type":"function","function":{"name":"github-pull-request_suggest-fix","description":"Summarize and suggest a fix for a GitHub issue.","parameters":{"type":"object","properties":{"repo":{"type":"object","description":"The repository to get the issue from.","properties":{"owner":{"type":"string","description":"The owner of the repository to get the issue from."},"name":{"type":"string","description":"The name of the repository to get the issue from."}},"required":["owner","name"]},"issueNumber":{"type":"number","description":"The number of the issue to get."}},"required":["issueNumber","repo"]}}},{"type":"function","function":{"name":"github-pull-request_formSearchQuery","description":"Converts natural language to a GitHub search query. Should ALWAYS be called before doing a search.","parameters":{"type":"object","properties":{"repo":{"type":"object","description":"The repository to get the issue from.","properties":{"owner":{"type":"string","description":"The owner of the repository to get the issue from."},"name":{"type":"string","description":"The name of the repository to get the issue from."}},"required":["owner","name"]},"naturalLanguageString":{"type":"string","description":"A plain text description of what the search should be."}},"required":["naturalLanguageString"]}}},{"type":"function","function":{"name":"github-pull-request_doSearch","description":"Execute a GitHub search given a well formed GitHub search query. Call github-pull-request_formSearchQuery first to get good search syntax and pass the exact result in as the 'query'.","parameters":{"type":"object","properties":{"repo":{"type":"object","description":"The repository to get the issue from.","properties":{"owner":{"type":"string","description":"The owner of the repository to get the issue from."},"name":{"type":"string","description":"The name of the repository to get the issue from."}},"required":["owner","name"]},"query":{"type":"string","description":"A well formed GitHub search query using proper GitHub search syntax."}},"required":["query","repo"]}}},{"type":"function","function":{"name":"github-pull-request_renderIssues","description":"Render issue items from an issue search in a markdown table. The markdown table will be displayed directly to the user by the tool. No further display should be done after this!","parameters":{"type":"object","properties":{"arrayOfIssues":{"type":"array","description":"An array of GitHub Issues.","items":{"type":"object","properties":{"title":{"type":"string","description":"The title of the issue."},"number":{"type":"number","description":"The number of the issue."},"url":{"type":"string","description":"The URL of the issue."},"state":{"type":"string","description":"The state of the issue (open/closed)."},"createdAt":{"type":"string","description":"The creation date of the issue."},"updatedAt":{"type":"string","description":"The last update date of the issue."},"closedAt":{"type":"string","description":"The closing date of the issue."},"author":{"type":"object","description":"The author of the issue.","properties":{"login":{"type":"string","description":"The login of the author."},"url":{"type":"string","description":"The URL of the author's profile."}}},"labels":{"type":"array","description":"The labels associated with the issue.","items":{"type":"object","properties":{"name":{"type":"string","description":"The name of the label."},"color":{"type":"string","description":"The color of the label."}}}},"assignees":{"type":"array","description":"The assignees of the issue.","items":{"type":"object","properties":{"login":{"type":"string","description":"The login of the assignee."},"url":{"type":"string","description":"The URL of the assignee's profile."}}}},"commentsCount":{"type":"number","description":"The number of comments on the issue."}}},"required":["title","number","url","state","createdAt","author","commentCount","reactionCount"]},"totalIssues":{"type":"number","description":"The total number of issues in the search."}},"required":["arrayOfIssues","totalIssues"]}}},{"type":"function","function":{"name":"searchConfigurations","description":"Use this tool to search for settings and commands. This will return all those settings and commands that contain the provided keywords. Each result will have a type to know if it is a setting or a command. A setting includes the description, default value, current value and other possible values and a command includes the description and possible arguments to be used to invoke the command.","parameters":{"type":"object","properties":{"keywords":{"type":"string","description":"List of keywords to search for the settings and commands"}}}}},{"type":"function","function":{"name":"updateSettings","description":"Use this tool to update settings. This tool support bulk updates, so you can update multiple settings at once. Provide the settings to update as a key value pair of setting id and new value. The value of the setting must follow the setting schema.","parameters":{"type":"object","description":"Dictionary of settings to update. The key is the setting id and the value is the new value of the setting.","properties":{},"additionalProperties":true}}},{"type":"function","function":{"name":"runCommand","description":"Use this tool to run a command. This tool will run the command with the provided arguments if the command supports them. The arguments must follow the command arguments schema provided by the searchConfigurations.","parameters":{"type":"object","properties":{"key":{"type":"string","description":"Id of the command"},"argumentsArray":{"type":"string","description":"Arguments to pass to the command as JSON stringified array"}}}}}],"stream":true} intent : undefined startTime : 2024-10-22T13:54:36.538Z endTime : 2024-10-22T13:54:43.462Z duration : 6924ms ourRequestId : a9de83d0-8c13-45c2-9294-b7f155381662 requestId : a9de83d0-8c13-45c2-9294-b7f155381662 serverRequestId : a9de83d0-8c13-45c2-9294-b7f155381662 timeToFirstToken : 899ms Request Messages System Follow Microsoft content policies. Avoid content that violates copyrights. If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that." Keep your answers short and impersonal. Use Markdown formatting in your answers. Make sure to include the programming language name at the start of the Markdown code blocks. Avoid wrapping the whole response in triple backticks. The user works in an IDE called Visual Studio Code which has a concept for editors with open files, integrated unit test support, an output pane that shows the output of running the code as well as an integrated terminal. The active document is the source code the user is looking at right now. You can only give one reply for each conversation turn. Assistant Instructions:

  1. Locate the FollowupsPrompt component in src/extension/prompts/node/panel/followups.tsx.

  2. Update the render method to conditionally render the button based on the number of comments.

Here's an example of how you might implement this:

[...skipping...]

In this example, the & Next button is only rendered if there is more than one comment left. Adjust the logic as needed based on your actual data structure and props. User Above is the result of calling the functions github-pull-request_suggest-fix. Response Assistant To address the issue where the "& Next" button should not appear if there's only one comment left, you can modify the rendering logic in the FollowupsPrompt component. Here's a potential fix:

  1. Locate the FollowupsPrompt component in src/extension/prompts/node/panel/followups.tsx.

  2. Update the render method to conditionally render the button based on the number of comments.

Here's an example of how you might implement this:

[...skipping...]

In this example, the & Next button is only rendered if there is more than one comment left. Adjust the logic as needed based on your actual data structure and props.

chrmarti commented 3 hours ago

Seen again, I think the UI started streaming in the response, but then removed it: Image