Skip to content

Commit 593671d

Browse files
roblourensCopilot
andauthored
Add debug view filters for NES requests (#536)
* Initial plan * Add NES requests filter implementation Co-authored-by: roblourens <[email protected]> * Refine NES request identification logic to avoid false positives Co-authored-by: roblourens <[email protected]> * Simplify --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: roblourens <[email protected]>
1 parent 520fe9f commit 593671d

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,14 @@
19821982
"command": "github.copilot.chat.debug.hideTools",
19831983
"title": "Hide Tools"
19841984
},
1985+
{
1986+
"command": "github.copilot.chat.debug.showNesRequests",
1987+
"title": "Show NES Requests"
1988+
},
1989+
{
1990+
"command": "github.copilot.chat.debug.hideNesRequests",
1991+
"title": "Hide NES Requests"
1992+
},
19851993
{
19861994
"command": "github.copilot.chat.debug.exportLogItem",
19871995
"title": "Export as...",
@@ -2994,6 +3002,14 @@
29943002
"command": "github.copilot.chat.debug.hideTools",
29953003
"when": "false"
29963004
},
3005+
{
3006+
"command": "github.copilot.chat.debug.showNesRequests",
3007+
"when": "false"
3008+
},
3009+
{
3010+
"command": "github.copilot.chat.debug.hideNesRequests",
3011+
"when": "false"
3012+
},
29973013
{
29983014
"command": "github.copilot.chat.debug.exportLogItem",
29993015
"when": "false"
@@ -3239,6 +3255,16 @@
32393255
"command": "github.copilot.chat.debug.hideTools",
32403256
"when": "!github.copilot.chat.debug.toolsHidden",
32413257
"group": "commands@1"
3258+
},
3259+
{
3260+
"command": "github.copilot.chat.debug.showNesRequests",
3261+
"when": "github.copilot.chat.debug.nesRequestsHidden",
3262+
"group": "commands@2"
3263+
},
3264+
{
3265+
"command": "github.copilot.chat.debug.hideNesRequests",
3266+
"when": "!github.copilot.chat.debug.nesRequestsHidden",
3267+
"group": "commands@2"
32423268
}
32433269
],
32443270
"notebook/toolbar": [

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ class ChatRequestItem extends vscode.TreeItem {
552552
class LogTreeFilters extends Disposable {
553553
private _elementsShown = true;
554554
private _toolsShown = true;
555+
private _nesRequestsShown = true;
555556

556557
private readonly _onDidChangeFilters = new vscode.EventEmitter<void>();
557558
readonly onDidChangeFilters = this._onDidChangeFilters.event;
@@ -563,6 +564,7 @@ class LogTreeFilters extends Disposable {
563564

564565
this.setElementsShown(!vscodeExtensionContext.workspaceState.get(this.getStorageKey('elements')));
565566
this.setToolsShown(!vscodeExtensionContext.workspaceState.get(this.getStorageKey('tools')));
567+
this.setNesRequestsShown(!vscodeExtensionContext.workspaceState.get(this.getStorageKey('nesRequests')));
566568
}
567569

568570
private getStorageKey(name: string): string {
@@ -579,18 +581,33 @@ class LogTreeFilters extends Disposable {
579581
this.setShown('tools', this._toolsShown);
580582
}
581583

584+
setNesRequestsShown(value: boolean) {
585+
this._nesRequestsShown = value;
586+
this.setShown('nesRequests', this._nesRequestsShown);
587+
}
588+
582589
itemIncluded(item: TreeItem): boolean {
583590
if (item instanceof ChatPromptItem) {
584591
return true; // Always show chat prompt items
585592
} else if (item instanceof ChatElementItem) {
586593
return this._elementsShown;
587594
} else if (item instanceof ToolCallItem) {
588595
return this._toolsShown;
596+
} else if (item instanceof ChatRequestItem) {
597+
// Check if this is a NES request
598+
if (this.isNesRequest(item)) {
599+
return this._nesRequestsShown;
600+
}
589601
}
590602

591603
return true;
592604
}
593605

606+
private isNesRequest(item: ChatRequestItem): boolean {
607+
const debugName = item.info.entry.debugName.toLowerCase();
608+
return debugName.startsWith('nes |') || debugName === 'xtabprovider';
609+
}
610+
594611
private setShown(name: string, value: boolean): void {
595612
vscode.commands.executeCommand('setContext', `github.copilot.chat.debug.${name}Hidden`, !value);
596613
this.vscodeExtensionContext.workspaceState.update(this.getStorageKey(name), !value);
@@ -606,5 +623,7 @@ class LogTreeFilterCommands extends Disposable {
606623
this._register(vscode.commands.registerCommand('github.copilot.chat.debug.hideElements', () => filters.setElementsShown(false)));
607624
this._register(vscode.commands.registerCommand('github.copilot.chat.debug.showTools', () => filters.setToolsShown(true)));
608625
this._register(vscode.commands.registerCommand('github.copilot.chat.debug.hideTools', () => filters.setToolsShown(false)));
626+
this._register(vscode.commands.registerCommand('github.copilot.chat.debug.showNesRequests', () => filters.setNesRequestsShown(true)));
627+
this._register(vscode.commands.registerCommand('github.copilot.chat.debug.hideNesRequests', () => filters.setNesRequestsShown(false)));
609628
}
610629
}

0 commit comments

Comments
 (0)