You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found a performance regression in src/mcp/server.ts around lines 531-574: the new enumeration loops synchronously read and retain every history file before applying channel/date filters and limit (which only happens around lines 591-605).
For example, read-message-history with a specific channel and limit: 1, without a search, now reads all legacy and v2 channel history into memory. Previously it selected the candidate filenames first and read only the requested files. On a long-running server this makes even a one-file request block the bot event loop and allocate memory proportional to the complete archive. readStoredHistoryFile also omits the verified reader's optional byte limit, so the response character budget does not bound this work.
Please preserve the verified-descriptor protection but filter filename metadata and select candidates before reading file bodies. Handle pending-file metadata and content searches with bounded reads as needed, and add a regression test that a channel-specific limit: 1 history request does not read unrelated file bodies. Leaving this PR open for that change.
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
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
Verification
npm test— passed: 195 testsgit diff --check— passedRisk
This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.