Skip to content

Commit c410d33

Browse files
committed
Fix participant publisher showing "undefined" after reload
1 parent a3a5038 commit c410d33

File tree

3 files changed

+5
-31
lines changed

3 files changed

+5
-31
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ export class CancelAction extends Action2 {
157157
id: MenuId.ChatExecute,
158158
when: CONTEXT_CHAT_REQUEST_IN_PROGRESS,
159159
group: 'navigation',
160+
},
161+
keybinding: {
162+
weight: KeybindingWeight.WorkbenchContrib,
163+
primary: KeyMod.CtrlCmd | KeyCode.Escape,
160164
}
161165
});
162166
}

src/vs/workbench/contrib/chat/common/chatModel.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -821,20 +821,7 @@ export class ChatModel extends Disposable implements IChatModel {
821821
followups: r.response?.followups,
822822
isCanceled: r.response?.isCanceled,
823823
vote: r.response?.vote,
824-
agent: r.response?.agent ?
825-
// May actually be the full IChatAgent instance, just take the data props. slashCommands don't matter here.
826-
{
827-
id: r.response.agent.id,
828-
name: r.response.agent.name,
829-
description: r.response.agent.description,
830-
extensionId: r.response.agent.extensionId,
831-
metadata: r.response.agent.metadata,
832-
slashCommands: [],
833-
locations: r.response.agent.locations,
834-
isDefault: r.response.agent.isDefault,
835-
extensionPublisher: r.response.agent.extensionPublisher
836-
}
837-
: undefined,
824+
agent: r.response?.agent,
838825
slashCommand: r.response?.slashCommand,
839826
usedContext: r.response?.usedContext,
840827
contentReferences: r.response?.contentReferences

src/vs/workbench/contrib/chat/common/chatParserTypes.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,6 @@ export class ChatRequestAgentPart implements IParsedChatRequestPart {
8181
get promptText(): string {
8282
return '';
8383
}
84-
85-
/**
86-
* Don't stringify all the agent methods, just data.
87-
*/
88-
toJSON(): any {
89-
return {
90-
kind: this.kind,
91-
range: this.range,
92-
editorRange: this.editorRange,
93-
agent: {
94-
id: this.agent.id,
95-
name: this.agent.name,
96-
description: this.agent.description,
97-
metadata: this.agent.metadata
98-
}
99-
};
100-
}
10184
}
10285

10386
/**

0 commit comments

Comments
 (0)