Skip to content

fix: stop the protocol gate leaking a server per run on Windows - #1314

Merged
n24q02m merged 1 commit into
mainfrom
fix/protocol-gate-orphan-server
Oct 11, 2026
Merged

n24q02m merged 1 commit into
mainfrom
fix/protocol-gate-orphan-server

Conversation

@n24q02m

@n24q02m n24q02m commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • tests/test_protocol_gate.py booted the server with uv run mnemo-mcp. On Windows Popen.terminate() kills only uv.exe; the trampoline, venv launcher and real interpreter below it survived, so every gate run left one live server.
  • The orphans lock .venv\Scripts\mnemo-mcp.exe, so the next uv sync (including the one the pre-commit pytest hook triggers) fails with os error 32 and commits cannot be made.
  • Boot with sys.executable -m mnemo, as tests/live_http.py already does. Both entries land in mnemo.server.main.

Test plan

  • Before: gate run left a mnemo-mcp.exe -> python.exe -> python.exe tree each time (reproduced twice).
  • After: uv run pytest tests/test_protocol_gate.py -> 16 passed, 0 leftover processes.
  • ruff check / format clean; pre-commit (incl. full pytest hook) passed.

🤖 Generated with Claude Code

The gate fixture booted the server with `uv run mnemo-mcp`. On Windows
Popen.terminate() kills only the direct child (uv.exe); the trampoline,
the venv launcher and the real interpreter below it kept running, so
every gate run left one live server behind. Those orphans held a lock on
.venv\Scripts\mnemo-mcp.exe and the next `uv sync` (including the one the
pre-commit pytest hook runs) failed with os error 32.

Boot with the test interpreter instead (`sys.executable -m mnemo`), the
same way tests/live_http.py already does. `python -m mnemo` and a bare
`mnemo-mcp` both land in mnemo.server.main, so the gate still exercises
the same entry. Re-ran the gate: 16 passed, zero leftover processes
(before the fix: one three-process tree per run).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@n24q02m
n24q02m merged commit 12d1a8e into main Oct 11, 2026
21 checks passed
@n24q02m
n24q02m deleted the fix/protocol-gate-orphan-server branch October 11, 2026 21:10
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.

1 participant