豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit cc92109

Browse files
committed
Fix 'Hide Ghost Requests' not filtering ghost prompt groups
The ghost request filter in the Chat Debug Log only checked ChatRequestItem instances but not ChatPromptItem (parent grouping nodes). This meant ghost prompt groups labeled 'Ghost' or 'Ghost | ...' remained visible even with the filter active. Extend isGhostRequest to also handle ChatPromptItem, matching the pattern already used for NES request filtering. Fixes microsoft/vscode#297566
1 parent f42041d commit cc92109

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/extension/log/vscode-node/requestLogTree.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,9 @@ class LogTreeFilters extends Disposable {
862862
if (this.isNesRequest(item)) {
863863
return this._nesRequestsShown;
864864
}
865+
if (this.isGhostRequest(item)) {
866+
return this._ghostRequestsShown;
867+
}
865868
return true; // Always show chat prompt items
866869
} else if (item instanceof ChatElementItem) {
867870
return this._elementsShown;
@@ -881,8 +884,14 @@ class LogTreeFilters extends Disposable {
881884
return true;
882885
}
883886

884-
private isGhostRequest(item: ChatRequestItem): boolean {
885-
const debugName = item.info.entry.debugName.toLowerCase();
887+
private isGhostRequest(item: ChatPromptItem | ChatRequestItem): boolean {
888+
let debugName: string;
889+
if (item instanceof ChatPromptItem) {
890+
assert(typeof item.label === 'string', 'ChatPromptItem label must be a string');
891+
debugName = item.label.toLowerCase();
892+
} else {
893+
debugName = item.info.entry.debugName.toLowerCase();
894+
}
886895
return debugName === 'ghost' || debugName.startsWith('ghost |');
887896
}
888897

0 commit comments

Comments
 (0)