This commit is contained in:
Martin Aeschlimann
2026-04-01 16:43:31 +02:00
parent cae137b38b
commit 7fa6deee69
3 changed files with 8 additions and 8 deletions

View File

@@ -43,9 +43,9 @@ export class PromptsDebugContribution extends Disposable implements IWorkbenchCo
const cts = new CancellationTokenSource();
try {
for (const promptType of [PromptsType.agent, PromptsType.instructions, PromptsType.prompt, PromptsType.skill, PromptsType.hook]) {
const discoveryInfo = await this.promptsService.getDiscoveryInfo(promptType, cts.token);
const { name, details } = this.getDiscoveryLogEntry(promptType, discoveryInfo);
const discoveryInfos = await Promise.all([PromptsType.agent, PromptsType.instructions, PromptsType.prompt, PromptsType.skill, PromptsType.hook].map(type => this.promptsService.getDiscoveryInfo(type, cts.token)));
for (const discoveryInfo of discoveryInfos) {
const { name, details } = this.getDiscoveryLogEntry(discoveryInfo);
const eventId = generateUuid();
this._discoveryEventDetails.set(eventId, discoveryInfo);
@@ -108,13 +108,13 @@ export class PromptsDebugContribution extends Disposable implements IWorkbenchCo
}));
}
private getDiscoveryLogEntry(promptType: PromptsType, discoveryInfo: IPromptDiscoveryInfo): { readonly name: string; readonly details?: string } {
private getDiscoveryLogEntry(discoveryInfo: IPromptDiscoveryInfo): { readonly name: string; readonly details?: string } {
const durationInMillis = discoveryInfo.durationInMillis;
const loadedCount = discoveryInfo.files.filter(file => file.status === 'loaded').length;
const skippedCount = discoveryInfo.files.length - loadedCount;
switch (promptType) {
switch (discoveryInfo.type) {
case PromptsType.prompt:
return {
name: localize('promptsService.loadSlashCommands', 'Load Slash Commands'),

View File

@@ -1407,7 +1407,7 @@ export interface IChatService {
_serviceBrand: undefined;
transferredSessionResource: URI | undefined;
readonly onDidSubmitRequest: Event<{ readonly chatSessionResource: URI; readonly message?: IParsedChatRequest; readonly options?: Readonly<IChatSendRequestOptions> }>;
readonly onDidSubmitRequest: Event<{ readonly chatSessionResource: URI; readonly message?: IParsedChatRequest }>;
readonly onDidCreateModel: Event<IChatModel>;

View File

@@ -114,7 +114,7 @@ export class ChatService extends Disposable implements IChatService {
return this._transferredSessionResource;
}
private readonly _onDidSubmitRequest = this._register(new Emitter<{ readonly chatSessionResource: URI; readonly message?: IParsedChatRequest; readonly options?: Readonly<IChatSendRequestOptions> }>());
private readonly _onDidSubmitRequest = this._register(new Emitter<{ readonly chatSessionResource: URI; readonly message?: IParsedChatRequest }>());
public readonly onDidSubmitRequest = this._onDidSubmitRequest.event;
public get onDidCreateModel() { return this._sessionModels.onDidCreateModel; }
@@ -1427,7 +1427,7 @@ export class ChatService extends Disposable implements IChatService {
if (options?.userSelectedModelId) {
this.languageModelsService.addToRecentlyUsedList(options.userSelectedModelId);
}
this._onDidSubmitRequest.fire({ chatSessionResource: model.sessionResource, message: parsedRequest, options: options });
this._onDidSubmitRequest.fire({ chatSessionResource: model.sessionResource, message: parsedRequest });
return {
responseCreatedPromise: responseCreated.p,
responseCompletePromise: rawResponsePromise,