Merge pull request #2656 from QwenLM/fix-issue-qwen-code

fix: resolve /clear command and ESC key lag caused by hooks system
This commit is contained in:
顾盼 2026-03-30 15:32:42 +08:00 committed by GitHub
commit cd935a5896
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 297 additions and 25 deletions

View file

@ -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.
*/