mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
fix: resolve /clear command and ESC key lag caused by hooks system
- Make hook events fire-and-forget in clearCommand to avoid blocking UI - Move context.ui.clear() before resetChat for immediate responsiveness - Add hasHooksForEvent() fast-path check to HookSystem and Config - Skip MessageBus round-trips in client.ts when no hooks are registered - Add comprehensive unit tests for all changes Fixes #2651
This commit is contained in:
parent
3776825c2d
commit
05062fd689
8 changed files with 297 additions and 25 deletions
|
|
@ -1769,6 +1769,15 @@ export class Config {
|
|||
return this.hookSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fast-path check: returns true only when hooks are enabled AND there are
|
||||
* registered hooks for the given event name. Callers can use this to skip
|
||||
* expensive MessageBus round-trips when no hooks are configured.
|
||||
*/
|
||||
hasHooksForEvent(eventName: string): boolean {
|
||||
return this.hookSystem?.hasHooksForEvent(eventName) ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if hooks are enabled.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue