Skip to content

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

Merged
AbirAbbas merged 1 commit into
Agent-Field:mainfrom
Jonesxq:fix/typescript-memory-event-filters
Aug 5, 2026
Merged

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

Conversation

@Jonesxq

@Jonesxq Jonesxq commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
TS 500 B +43% 1.51 µs -25%

Regression detected:

  • TypeScript memory: 350 B → 500 B (+43%)

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage gate

Thresholds from .coverage-gate.toml: per-surface ≥ 84%, aggregate ≥ 85%, max per-surface regression ≤ 1.0 pp, max aggregate regression ≤ 0.50 pp.

Surface Current Baseline Δ
control-plane 86.80% 87.40% ↓ -0.60 pp 🟡
sdk-go 92.50% 92.00% ↑ +0.50 pp 🟢
sdk-python 93.82% 93.73% ↑ +0.09 pp 🟢
sdk-typescript 91.08% 90.42% ↑ +0.66 pp 🟢
web-ui 84.76% 84.79% ↓ -0.03 pp 🟡
aggregate 85.51% 85.75% ↓ -0.24 pp 🟡

✅ Gate passed

No surface regressed past the allowed threshold and the aggregate stayed above the floor.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📐 Patch coverage gate

Threshold: 80% on lines this PR touches vs origin/main (from .coverage-gate.toml:thresholds.min_patch).

Surface Touched lines Patch coverage Status
control-plane 0 ➖ no changes
sdk-go 0 ➖ no changes
sdk-python 0 ➖ no changes
sdk-typescript 13 100.00%
web-ui 0 ➖ no changes

✅ Patch gate passed

Every surface whose lines were touched by this PR has patch coverage at or above the threshold.

@AbirAbbas
AbirAbbas merged commit d77f1c2 into Agent-Field:main Aug 5, 2026
23 checks passed
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

3 participants