diff --git a/package.json b/package.json index a05e83fa0..f54124079 100644 --- a/package.json +++ b/package.json @@ -1982,6 +1982,14 @@ "command": "github.copilot.chat.debug.hideTools", "title": "Hide Tools" }, + { + "command": "github.copilot.chat.debug.showNesRequests", + "title": "Show NES Requests" + }, + { + "command": "github.copilot.chat.debug.hideNesRequests", + "title": "Hide NES Requests" + }, { "command": "github.copilot.chat.debug.exportLogItem", "title": "Export as...", @@ -2994,6 +3002,14 @@ "command": "github.copilot.chat.debug.hideTools", "when": "false" }, + { + "command": "github.copilot.chat.debug.showNesRequests", + "when": "false" + }, + { + "command": "github.copilot.chat.debug.hideNesRequests", + "when": "false" + }, { "command": "github.copilot.chat.debug.exportLogItem", "when": "false" @@ -3239,6 +3255,16 @@ "command": "github.copilot.chat.debug.hideTools", "when": "!github.copilot.chat.debug.toolsHidden", "group": "commands@1" + }, + { + "command": "github.copilot.chat.debug.showNesRequests", + "when": "github.copilot.chat.debug.nesRequestsHidden", + "group": "commands@2" + }, + { + "command": "github.copilot.chat.debug.hideNesRequests", + "when": "!github.copilot.chat.debug.nesRequestsHidden", + "group": "commands@2" } ], "notebook/toolbar": [ diff --git a/src/extension/log/vscode-node/requestLogTree.ts b/src/extension/log/vscode-node/requestLogTree.ts index 7f17154ef..e512c19f0 100644 --- a/src/extension/log/vscode-node/requestLogTree.ts +++ b/src/extension/log/vscode-node/requestLogTree.ts @@ -552,6 +552,7 @@ class ChatRequestItem extends vscode.TreeItem { class LogTreeFilters extends Disposable { private _elementsShown = true; private _toolsShown = true; + private _nesRequestsShown = true; private readonly _onDidChangeFilters = new vscode.EventEmitter(); readonly onDidChangeFilters = this._onDidChangeFilters.event; @@ -563,6 +564,7 @@ class LogTreeFilters extends Disposable { this.setElementsShown(!vscodeExtensionContext.workspaceState.get(this.getStorageKey('elements'))); this.setToolsShown(!vscodeExtensionContext.workspaceState.get(this.getStorageKey('tools'))); + this.setNesRequestsShown(!vscodeExtensionContext.workspaceState.get(this.getStorageKey('nesRequests'))); } private getStorageKey(name: string): string { @@ -579,6 +581,11 @@ class LogTreeFilters extends Disposable { this.setShown('tools', this._toolsShown); } + setNesRequestsShown(value: boolean) { + this._nesRequestsShown = value; + this.setShown('nesRequests', this._nesRequestsShown); + } + itemIncluded(item: TreeItem): boolean { if (item instanceof ChatPromptItem) { return true; // Always show chat prompt items @@ -586,11 +593,21 @@ class LogTreeFilters extends Disposable { return this._elementsShown; } else if (item instanceof ToolCallItem) { return this._toolsShown; + } else if (item instanceof ChatRequestItem) { + // Check if this is a NES request + if (this.isNesRequest(item)) { + return this._nesRequestsShown; + } } return true; } + private isNesRequest(item: ChatRequestItem): boolean { + const debugName = item.info.entry.debugName.toLowerCase(); + return debugName.startsWith('nes |') || debugName === 'xtabprovider'; + } + private setShown(name: string, value: boolean): void { vscode.commands.executeCommand('setContext', `github.copilot.chat.debug.${name}Hidden`, !value); this.vscodeExtensionContext.workspaceState.update(this.getStorageKey(name), !value); @@ -606,5 +623,7 @@ class LogTreeFilterCommands extends Disposable { this._register(vscode.commands.registerCommand('github.copilot.chat.debug.hideElements', () => filters.setElementsShown(false))); this._register(vscode.commands.registerCommand('github.copilot.chat.debug.showTools', () => filters.setToolsShown(true))); this._register(vscode.commands.registerCommand('github.copilot.chat.debug.hideTools', () => filters.setToolsShown(false))); + this._register(vscode.commands.registerCommand('github.copilot.chat.debug.showNesRequests', () => filters.setNesRequestsShown(true))); + this._register(vscode.commands.registerCommand('github.copilot.chat.debug.hideNesRequests', () => filters.setNesRequestsShown(false))); } } \ No newline at end of file