Repository navigation
Conversation
…875) The search_memory handler had a deadline but no concurrency limit, so a burst of calls ran every search in parallel. The handler moves to memorySearch.ts with at most two searches at once; an over-limit call gets an immediate busy tool error instead of waiting. A slot is returned on success, failure and deadline alike.
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.
무엇
search_memory처리 로직을src/mcp/memorySearch.ts의createMemorySearchHandler로 분리 (memoryServer.ts 는 import 시 바로 stdio 서버를 띄워 테스트할 수 없었다).MAX_CONCURRENT_SEARCHES = 2.search_memory busy: 2/2 searches already running — retry shortly). 대기열을 두면 그 대기열에도 상한·타임아웃이 또 필요하고, 기억 검색은 힌트라 CLI 에이전트가 재시도하거나 넘어가는 편이 싸다. 정책은 파일 docstring 에 적었다.finally로 반납한다. deadline 뒤에도 실제 검색 promise 는 취소할 수 없어 뒤에서 끝날 수 있지만, 멈춘 embedding 이 서버를 영원히 busy 로 묶지 않도록 슬롯은 돌려준다 (AGT-3495 와 같은 규칙).왜
deadline 은 있었지만 동시 실행 수 제한이 없어 요청이 몰리면 검색이 무제한 병렬로 돌았다 (AGT-4875).
검증
npx vitest run src/mcp/ src/adapters/memoryMcp.test.ts— 5 files / 61 tests 통과 (신규 3: 상한+3 동시 호출에서 실제 실행 peak=2·초과분 busy, deadline 뒤 슬롯 회수(fake timer), 예외·잘못된 인자).npm run typecheck,npm run build,oxlint src/mcp0 errors.