Skip to content

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Jan 9, 2026

Part of #274403

@meganrogge any test cases in particular I should do to make sure this all works that come to mind?

@Tyriar Tyriar added this to the January 2026 milestone Jan 9, 2026
@Tyriar Tyriar self-assigned this Jan 9, 2026
Copilot AI review requested due to automatic review settings January 9, 2026 20:43
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

This PR migrates the terminal chat tool integration from using string-based session IDs to URI-based session resources. This change provides a more consistent and type-safe way to reference chat sessions across the codebase, aligning with the broader architecture for handling chat session references.

Key Changes

  • Replaced Map<string, IToolTerminal> with ResourceMap<IToolTerminal> for session-terminal associations
  • Updated all chat session ID parameters to use URI (chatSessionResource) instead of string (chatSessionId)
  • Maintained backward compatibility in storage layer by converting URIs to string IDs when persisting

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runInTerminalTool.ts Core implementation migrated to use ResourceMap and URI-based session resources; backward compatibility maintained in storage
terminalChatService.ts Service layer updated to use ResourceMap for session tracking; added new getChatSessionResourceForInstance method
terminal.ts Interface definitions updated; deprecated getChatSessionIdForInstance in favor of getChatSessionResourceForInstance
terminalChatActions.ts Command handler updated to accept URI or string and convert appropriately
commandLineAnalyzer.ts Interface updated to use chatSessionResource instead of chatSessionId
commandLineAutoApproveAnalyzer.ts Updated to pass URI instead of string to approval methods
commandLineAutoApprover.ts Parameters updated to accept URI instead of string
chatTerminalToolConfirmationSubPart.ts Updated to use element.sessionResource instead of element.sessionId
languageModelToolsService.ts Added chatSessionResource to IToolInvocationPreparationContext; marked chatSessionId as deprecated; passed through in tool service
runInTerminalTool.test.ts Tests updated to use LocalChatSessionUri.forSession for creating session resources
commandLineFileWriteAnalyzer.test.ts Tests updated to use chatSessionResource: undefined

@Tyriar Tyriar requested a review from meganrogge January 9, 2026 21:35
meganrogge
meganrogge previously approved these changes Jan 9, 2026
@Tyriar Tyriar marked this pull request as ready for review January 10, 2026 11:56
@Tyriar Tyriar enabled auto-merge January 10, 2026 11:56
@Tyriar Tyriar merged commit 7eb5eb5 into main Jan 10, 2026
22 checks passed
@Tyriar Tyriar deleted the tyriar/274403 branch January 10, 2026 12:14
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.

4 participants