feat(typescript): add server-side memory event filters - #838
Open
Jonesxq wants to merge 1 commit into
Open
Conversation
Jonesxq
marked this pull request as ready for review
July 30, 2026 11:21
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Add optional server-side filters to TypeScript
MemoryEventClientWebSocket subscriptions.patterns,scope, andscopeIdare encoded as the server'spatterns,scope, andscope_idquery parameters, and the same filters are retained across reconnects.This reduces WebSocket traffic and client-side processing for high-volume event streams while preserving the existing unfiltered behavior for callers that omit options. Existing
Agent.watchMemory()registrations continue to use their current client-side dispatch filtering; automatically aggregating multiple dynamic watchers with different scopes is outside this focused change because one shared WebSocket cannot represent those filters exactly.Type of change
Test plan
cd sdk/typescript && npm test -- tests/memory_event_client.test.ts(5 tests passed)cd sdk/typescript && npm run lintcd sdk/typescript && npm run buildcd sdk/typescript && npm test(807 of 808 tests passed on Node 24.18.0; the existing memory-growth threshold test measured 31.29 MB against a 25 MB limit, while that file passed 6 of 6 when run in isolation with explicit garbage collection)Test coverage
This repo enforces a coverage gate on every PR (see
.github/workflows/coverage.ymlanddocs/COVERAGE.md).coverage-baseline.jsonin this PR only if the removal caused a legitimate regression and I called it out in the summary above. (No code was removed.)Checklist
Related issues / PRs
Closes #90