Agent Debug Panel: Map hook events to right category#307260
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Agent Debug Logs filtering logic to treat "hook" debug entries as part of the “Chat Customization” (prompt discovery) filter group.
Changes:
- Adds a
kind === 'hook'branch inChatDebugFilterState.isKindVisible(...)that maps hook entries to the prompt discovery visibility toggle.
| return true; | ||
| } | ||
| return this.filterKindPromptDiscovery; | ||
| case 'hook': return this.filterKindPromptDiscovery; | ||
| case 'subagentInvocation': return this.filterKindSubagent; |
There was a problem hiding this comment.
isKindVisible now special-cases kind === 'hook', but the debug event stream consumed by the Logs/Flow views is IChatDebugEvent, whose kind union currently does not include 'hook' (see src/vs/workbench/contrib/chat/common/chatDebugService.ts). I also couldn't find any call sites passing 'hook' into isKindVisible, so this branch looks unreachable and likely won't change filtering behavior.
If hook-related entries are currently emitted as generic events, consider keying off category (similar to the existing category === 'discovery' handling) or adjusting the producer/type model so hook entries actually arrive with kind: 'hook' and are handled consistently across the debug UI.
See below for a potential fix:
// the prompt discovery pipeline (category === 'discovery')
// and hook-related entries (category === 'hook'). Other
// generic events (e.g. from external providers) are always
// visible and are not affected by this toggle.
if (category === 'discovery' || category === 'hook') {
return this.filterKindPromptDiscovery;
}
return true;
Map hook events to right category