Skip to content

Update @github/copilot to version 0.0.420, enhance attachment handling#4108

Merged
DonJayamanne merged 1 commit intomainfrom
don/cool-goat
Mar 2, 2026
Merged

Update @github/copilot to version 0.0.420, enhance attachment handling#4108
DonJayamanne merged 1 commit intomainfrom
don/cool-goat

Conversation

@DonJayamanne
Copy link
Collaborator

No description provided.

@DonJayamanne DonJayamanne marked this pull request as ready for review March 2, 2026 10:27
Copilot AI review requested due to automatic review settings March 2, 2026 10:27
@DonJayamanne DonJayamanne enabled auto-merge March 2, 2026 10:27
@vs-code-engineering vs-code-engineering bot added this to the March 2026 milestone Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/copilot from 0.0.415 to 0.0.420.
  • Add special-case rendering for github_reference attachments in Copilot CLI session markdown logs.
  • Make supportsVision optional in CopilotCLIModelInfo and adjust attachment filtering in buildChatHistoryFromEvents to avoid instruction-path filtering for github_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 avoiding isInstructionAttachmentPath for attachment types that don’t have a path.
					.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_reference attachments isn’t covered by the existing unit tests for buildChatHistoryFromEvents (see common/test/copilotCLITools.spec.ts). Please add a test case that includes a github_reference attachment and asserts the intended outcome (e.g. it becomes a ChatPromptReference, 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 _renderRequestToMarkdown and _renderConversationToMarkdown. With the new github_reference branch 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})`);
			}

@DonJayamanne DonJayamanne added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 6871c17 Mar 2, 2026
30 checks passed
@DonJayamanne DonJayamanne deleted the don/cool-goat branch March 2, 2026 11:01
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.

3 participants