-
Notifications
You must be signed in to change notification settings - Fork 36.6k
Description
Tracks migrating our chat implementation to use uris instead of string ids to identify chat sessions internally. Uris are preferred as they can correctly support contributed providers
This is a pretty major change so it will broken up into smaller steps. I've done but lot of work trying to get the basics setup but now need help finishing up in individual areas
-
@mjbvz Lots of plumbing through of session uris: eef25fc 3bb2ff6 a1f7be3 d9d1b03
-
@joshspicer Convert the
clearChatEditorfunction. We definitely should not be using the forChatSessionTypeAndId call I added but I'm not really sure what we should be doing insteadBlocks removing
forChatSessionTypeAndIdandLocalChatSessionUri.parse -
@osortega Convert the hybrid session stuff in
getHybridSessionsForProvider -
@osortega Remove the use of fake
IChatSessionItementries withid: "show-history"andid: "workbench.panel.chat.view.copilot"Blocks removing
IChatSessionItem.id -
@roblourens
IChatAgentRequest.sessionId -
@connor4312 Convert
IChatEditingSession.chatSessionId -
@justschen Convert
IChatChangesSummary.sessionId -
@aeschli Adopt in code mapper. Specifically for
ICodeMapperRequest.chatSessionId -
@Tyriar Adopt for the terminal tool (
IChatTerminalToolInvocationData.sessionIdplusChatTerminalToolProgressPartandRunInTerminalTool) -
@bhavyaus Adopt for
ManageTodoListTool -
@connor4312
ChatResponseResource
Migration
In most cases, the fix is to use the uri associated with the session instead of the id. This is usually pretty straightforward, although it sometimes requires plumbing the sessionResource through a number of functions
A few gotchas/tips:
-
Do not construct or parse the session uris yourself
-
Make sure to use
isEqualto compare the uris. Don't use=== -
If the session id was being used as a key in a map, you'll likely want to switch to use a
ResourceMap -
Use
LocalChatSessionUri.forSessionto create a URI if you only have a string id. Keep in mind this only works properly for local sessions, so we generally want to move away from this and just pass the uris around directly -
Use
chatSessionResourceToIdto go from a uri to an old session id string. This should only be used when you need to preserve the old sessionId for telemetry or persistent storage