mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Convert ChatService to use uris instead of ids in public apis
Moves the chat service public APIs to use uris for identifying sessions instead of ids. These uris are preferred as they work correctly for both contributed and local session This ends up touch a lot of the chat apis. In most cases, the change is simply to pass in the URI instead of the id. In a few cases where the URI hasn't been fully hooked up, I am using `LocalChatSessionUri` to do this conversation For the chat session implementation, I also switched to use resource maps to store session specific information instead of a normal map
This commit is contained in:
@@ -688,7 +688,7 @@ export class InlineChatController1 implements IEditorContribution {
|
||||
let next: State.WAIT_FOR_INPUT | State.SHOW_REQUEST | State.CANCEL | State.PAUSE | State.ACCEPT = State.WAIT_FOR_INPUT;
|
||||
store.add(Event.once(this._messages.event)(message => {
|
||||
this._log('state=_makeRequest) message received', message);
|
||||
this._chatService.cancelCurrentRequestForSession(chatModel.sessionId);
|
||||
this._chatService.cancelCurrentRequestForSession(chatModel.sessionResource);
|
||||
if (message & Message.CANCEL_SESSION) {
|
||||
next = State.CANCEL;
|
||||
} else if (message & Message.PAUSE_SESSION) {
|
||||
@@ -755,7 +755,7 @@ export class InlineChatController1 implements IEditorContribution {
|
||||
|
||||
// cancel the request when the user types
|
||||
store.add(this._ui.value.widget.chatWidget.inputEditor.onDidChangeModelContent(() => {
|
||||
this._chatService.cancelCurrentRequestForSession(chatModel.sessionId);
|
||||
this._chatService.cancelCurrentRequestForSession(chatModel.sessionResource);
|
||||
}));
|
||||
|
||||
let lastLength = 0;
|
||||
@@ -1141,7 +1141,7 @@ export class InlineChatController1 implements IEditorContribution {
|
||||
const response = this._session?.chatModel.getRequests().at(-1)?.response;
|
||||
if (response) {
|
||||
this._chatService.notifyUserAction({
|
||||
sessionId: response.session.sessionId,
|
||||
sessionResource: response.session.sessionResource,
|
||||
requestId: response.requestId,
|
||||
agentId: response.agent?.id,
|
||||
command: response.slashCommand?.name,
|
||||
@@ -1176,7 +1176,7 @@ export class InlineChatController1 implements IEditorContribution {
|
||||
const response = this._session?.chatModel.lastRequest?.response;
|
||||
if (response) {
|
||||
this._chatService.notifyUserAction({
|
||||
sessionId: response.session.sessionId,
|
||||
sessionResource: response.session.sessionResource,
|
||||
requestId: response.requestId,
|
||||
agentId: response.agent?.id,
|
||||
command: response.slashCommand?.name,
|
||||
@@ -1196,7 +1196,7 @@ export class InlineChatController1 implements IEditorContribution {
|
||||
const response = this._session?.chatModel.lastRequest?.response;
|
||||
if (response) {
|
||||
this._chatService.notifyUserAction({
|
||||
sessionId: response.session.sessionId,
|
||||
sessionResource: response.session.sessionResource,
|
||||
requestId: response.requestId,
|
||||
agentId: response.agent?.id,
|
||||
command: response.slashCommand?.name,
|
||||
|
||||
Reference in New Issue
Block a user