Skip to content

feat(typescript): add server-side memory event filters - #838

Open
Jonesxq wants to merge 1 commit into
Agent-Field:mainfrom
Jonesxq:fix/typescript-memory-event-filters
Open

feat(typescript): add server-side memory event filters#838
Jonesxq wants to merge 1 commit into
Agent-Field:mainfrom
Jonesxq:fix/typescript-memory-event-filters

Conversation

@Jonesxq

@Jonesxq Jonesxq commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Add optional server-side filters to TypeScript MemoryEventClient WebSocket subscriptions. patterns, scope, and scopeId are encoded as the server's patterns, scope, and scope_id query 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

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Docs only
  • Tests only
  • CI / tooling
  • Breaking change

Test plan

  • cd sdk/typescript && npm test -- tests/memory_event_client.test.ts (5 tests passed)
  • cd sdk/typescript && npm run lint
  • cd sdk/typescript && npm run build
  • cd 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.yml and
docs/COVERAGE.md).

  • I ran tests for the surface(s) I changed locally.
  • New code paths are covered by tests in this PR (no bare additions).
  • If I removed code, I updated coverage-baseline.json in this PR only if the removal caused a legitimate regression and I called it out in the summary above. (No code was removed.)
  • The coverage gate check is green in CI before requesting review.

Checklist

  • I have read CONTRIBUTING.md and docs/DEVELOPMENT.md.
  • Commits are signed and follow conventional-commits style. (The commit follows conventional-commits style; no GitHub signing key is configured for this account.)
  • I have linked the related issue.

Related issues / PRs

Closes #90

@CLAassistant

CLAassistant commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Jonesxq
Jonesxq marked this pull request as ready for review July 30, 2026 11:21
@Jonesxq
Jonesxq requested review from a team and AbirAbbas as code owners July 30, 2026 11:21
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TypeScript SDK] Pass filter params to server for memory event subscriptions

2 participants