feat(plugin): add adaptive performance mode for hooks (#1002)#1027
Merged
Conversation
When hook execution time exceeds threshold, auto-switch to lightweight mode that skips heavy analysis (conflict prediction, full project scan) while keeping core functions (mode detection, basic validation). - Add adaptive_perf.py with sliding-window performance monitor - Integrate into session-start.py (skip project scan in lightweight mode) - Integrate into pre-tool-use.py (skip file watcher in lightweight mode) - Configurable threshold via codingbuddy.config.json (hooks.timeoutMs) - User notification on mode switch (i18n: en/ko/ja/zh/es) - 27 tests passing
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codingbuddy.config.json의hooks.timeoutMs로 임계값 설정 가능 (기본값: 10000ms)Changes
packages/claude-code-plugin/hooks/lib/adaptive_perf.py— 핵심 모니터 모듈 (singleton, sliding window, mode switching)packages/claude-code-plugin/hooks/session-start.py— project scan/agent recommendations를 경량 모드에서 스킵packages/claude-code-plugin/hooks/pre-tool-use.py— file watcher를 경량 모드에서 스킵packages/claude-code-plugin/hooks/tests/test_adaptive_perf.py— 27개 테스트Test plan
python3 -m pytest packages/claude-code-plugin/hooks/tests/test_adaptive_perf.py -v)Closes #1002