Skip to content

fix(python): match memory subscription keys literally - #1136

Merged
santoshkumarradha merged 1 commit into
Agent-Field:mainfrom
remote-controlled-man:codex/prflow-2a277cb4c621
Oct 29, 2026
Merged

santoshkumarradha merged 1 commit into
Agent-Field:mainfrom
remote-controlled-man:codex/prflow-2a277cb4c621

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

Summary

Memory subscription patterns currently interpret regular-expression characters in keys. For example, config.* dispatches events for configXtheme, while queue[0].* misses the literal bracketed key.

Escape literal characters before expanding the supported * wildcard. Add regressions through the public client connection/subscription flow for dots, plus signs and brackets; existing wildcard and scope behavior is preserved.

Type of change

  • Bug fix

Test plan

  • Python SDK: ruff check ., mypy --config-file mypy.ini agentfield/, and ./scripts/run_pytest.sh --cov=agentfield.memory_events — 2919 passed, 4 skipped, 38 deselected by the existing defaults.
  • Final commit: all 14 memory-event tests pass; the three new cases fail against the original matcher.
  • Control plane and Go SDK: go test ./... passed in the existing Go 1.25.14 Linux environment, as a non-root user with Python venv support and normal public/NXDOMAIN DNS resolution.
  • TypeScript SDK npm run test:core — 1380 passed, 1 skipped; web UI npm run test — 837 passed.
  • make fmt tidy passed; unrelated pre-existing formatter changes were excluded.

The native macOS ./scripts/test-all.sh attempt was blocked by the installed SDK/linker combination. Its component checks passed using Linux for Go and the native environments for Python/Node. No upstream assertions were changed.

Test coverage

  • Tests for the changed surface ran locally; memory-events statement coverage is 92%.
  • New behavior is covered by public subscription/dispatch tests.
  • No coverage baseline or threshold changes.
  • Coverage gate green in CI — pending upstream CI.

Checklist

  • Read docs/CONTRIBUTING.md, docs/DEVELOPMENT.md and docs/COVERAGE.md.
  • Commit follows conventional-commits style.
  • Cryptographic commit signature (not configured locally).

Copilot AI balanced review requested due to automatic review settings October 28, 2026 13:30

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

Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
Python 9.1 KB - 0.24 µs -31% ✓ ✓

✓ No regressions detected

@github-actions

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.89% 84.79% ↑ +0.10 pp 🟡
aggregate 86.11% 85.75% ↑ +0.36 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.

Looks good. Escaping the pattern before expanding only * keeps memory keys literal, and the coverage cases exercise the important regex characters.

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