Skip to content

fix(python): URL-encode memory subscription filters - #1137

Merged
santoshkumarradha merged 5 commits into
Agent-Field:mainfrom
remote-controlled-man:codex/prflow-e7c5ae7322fa
Oct 30, 2026
Merged

santoshkumarradha merged 5 commits into
Agent-Field:mainfrom
remote-controlled-man:codex/prflow-e7c5ae7322fa

Conversation

@remote-controlled-man

@remote-controlled-man remote-controlled-man commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Memory event subscriptions interpolate filters directly into the WebSocket URL. A scope ID such as alice+trial@example.com is decoded by the server as alice trial@example.com; & and # can split or truncate a filter.

Use standard-library urlencode for the existing query parameters. Public MemoryEventClient.connect regressions cover plus signs, ampersands, fragments, spaces, and Unicode, alongside the unfiltered URL and authentication headers. The existing comma-separated pattern contract is preserved.

This PR now changes only the two Python files. At the maintainer's request, the MCP worker cleanup is in #1140 and the Makefile formatting fix is in #1141. Current main was merged, preserving #1136's literal pattern matching fix.

Validation on this revision:

  • Complete current-head Python SDK suite: 2922 passed, 4 existing skips, 38 default deselections; 85% all-package configured coverage.
  • 23 memory-event tests passed with network sockets disabled; memory-events statement coverage is 92%.
  • SDK Ruff passed; Mypy found no issues in 86 source files.
  • Changed-file formatting and git diff --check passed.

The full multi-language root script and root formatting target were not rerun for this Python-only revision. Their independent fixes are in the linked PRs; the earlier combined-head results are not claimed for this revision.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
Python 9.1 KB - 0.26 µs -26% ✓ ✓

✓ No regressions detected

@github-actions

github-actions Bot commented Oct 29, 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 88.20% 87.40% ↑ +0.80 pp 🟡
sdk-go 93.70% 92.00% ↑ +1.70 pp 🟢
sdk-python 94.72% 93.73% ↑ +0.99 pp 🟢
sdk-typescript 92.50% 90.42% ↑ +2.08 pp 🟢
web-ui 84.90% 84.79% ↑ +0.11 pp 🟡
aggregate 86.12% 85.75% ↑ +0.37 pp 🟡

✅ Gate passed

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

@github-actions

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 0 — ➖ no changes
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.

@santoshkumarradha santoshkumarradha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL encoding change and its parameterized coverage look good. Could you move the Makefile formatting change and the MCP worker-pool cleanup into separate PRs? They are unrelated to memory subscription query encoding, so splitting them will keep this fix focused and easier to ship. Once that is done, this should be good to go.

@remote-controlled-man

Copy link
Copy Markdown
Contributor Author

Split as requested: the MCP cleanup is now in #1140 and Go formatting in #1141. This PR now changes only the two Python files for query encoding and its tests. Current main is merged with #1136's literal matching fix preserved. The full current Python SDK suite and the focused memory-event tests pass, as do Ruff and Mypy.

@santoshkumarradha santoshkumarradha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for narrowing this to the URL-encoding fix. The encoded query parameters preserve the filter values, the regression cases cover reserved and Unicode characters, and the focused memory-event suite passes locally.

@santoshkumarradha
santoshkumarradha added this pull request to the merge queue Oct 30, 2026
Merged via the queue into Agent-Field:main with commit fe6f9cb Oct 30, 2026
28 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.

3 participants