Repository navigation
fix(python): stop memory event reconnects during shutdown - #1142
remote-controlled-man wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
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.
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
Performance
✓ No regressions detected |
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
Summary
MemoryEventClient.close()could trigger a reconnect when the listener received the socket's close notification, and in-flight or queued connections could become active after shutdown. Track and stop the client's background connection/listener/retry tasks and discard connections that finish after a close. Explicitly connecting the same client again remains supported.Prepared with AI assistance, independently reviewed and tested.
Type of change
Test plan
close()on the original implementation../scripts/test-all.sh(control plane, Go SDK, Python SDK with coverage, TypeScript SDK, and web UI). Go tests use an isolated Linux Go 1.25.14 runtime with controlled public/invalid DNS responses; Python and JavaScript tests run natively on macOS.ruff checkandmypy --config-file mypy.ini agentfield/.Test coverage
Checklist
docs/CONTRIBUTING.mdanddocs/DEVELOPMENT.md.Related issues / PRs
No existing Python shutdown issue found. This is separate from the earlier TypeScript memory client cleanup in #157.