Update @github/copilot to version 0.0.420, enhance attachment handling#4108
Merged
DonJayamanne merged 1 commit intomainfrom Mar 2, 2026
Merged
Update @github/copilot to version 0.0.420, enhance attachment handling#4108DonJayamanne merged 1 commit intomainfrom
DonJayamanne merged 1 commit intomainfrom
Conversation
…ling in Copilot CLI
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Copilot CLI integration to the new @github/copilot package version and adjusts Copilot CLI session plumbing to tolerate new attachment/model metadata shapes.
Changes:
- Bump
@github/copilotfrom0.0.415to0.0.420. - Add special-case rendering for
github_referenceattachments in Copilot CLI session markdown logs. - Make
supportsVisionoptional inCopilotCLIModelInfoand adjust attachment filtering inbuildChatHistoryFromEventsto avoid instruction-path filtering forgithub_reference.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/extension/chatSessions/copilotcli/node/copilotcliSession.ts | Logs github_reference attachments differently in request/conversation markdown rendering. |
| src/extension/chatSessions/copilotcli/node/copilotCli.ts | Makes supportsVision optional to match potential SDK capability omissions. |
| src/extension/chatSessions/copilotcli/common/copilotCLITools.ts | Prevents instruction-path filtering from touching github_reference attachments; currently skips them when building prompt references. |
| package.json | Bumps @github/copilot dependency version. |
| package-lock.json | Updates lockfile entries for @github/copilot and platform-specific optional deps. |
Comments suppressed due to low confidence (3)
src/extension/chatSessions/copilotcli/common/copilotCLITools.ts:387
- This filter condition relies on
||+ ternary precedence (attachment.type === 'selection' || attachment.type === 'github_reference' ? ...) which is hard to read and easy to misinterpret during future edits. Consider rewriting it without the ternary (pure||chain) or adding parentheses so the intent is unambiguous, while still avoidingisInstructionAttachmentPathfor attachment types that don’t have apath.
.filter(attachment => attachment.type === 'selection' || attachment.type === 'github_reference' ? true : !isInstructionAttachmentPath(attachment.path))
.forEach(attachment => {
src/extension/chatSessions/copilotcli/common/copilotCLITools.ts:390
- New behavior for
github_referenceattachments isn’t covered by the existing unit tests forbuildChatHistoryFromEvents(seecommon/test/copilotCLITools.spec.ts). Please add a test case that includes agithub_referenceattachment and asserts the intended outcome (e.g. it becomes aChatPromptReference, or it’s intentionally ignored but does not throw).
.filter(attachment => attachment.type === 'selection' || attachment.type === 'github_reference' ? true : !isInstructionAttachmentPath(attachment.path))
.forEach(attachment => {
if (attachment.type === 'github_reference') {
return;
}
src/extension/chatSessions/copilotcli/node/copilotcliSession.ts:629
- The attachment formatting logic is duplicated in both
_renderRequestToMarkdownand_renderConversationToMarkdown. With the newgithub_referencebranch added in two places, it’s easy for the formats to drift over time; consider extracting a small helper (e.g.formatAttachmentForLog) to keep the behavior consistent.
attachments.forEach(attachment => {
if (attachment.type === 'github_reference') {
result.push(`- ${attachment.title}: (${attachment.number}, ${attachment.type}, ${attachment.referenceType})`);
} else {
result.push(`- ${attachment.displayName} (${attachment.type}, ${attachment.type === 'selection' ? attachment.filePath : attachment.path})`);
}
dmitrivMS
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.