Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR stabilizes OpenSpace MCP daemon lifecycle management and adds regression coverage for the process accumulation issues we saw during repeated Codex/OpenSpace session startup.
Key changes:
last_used_atandactive_requests, add cross-key fleet reaping, and install graceful idle/signal shutdown for both main and evolution daemonsWhy this prevents the old issue from recurring
Previously, daemon reuse was exact-key only and cleanup was mostly per-key/stale-record replacement. Under repeated reconnects or workspace/config churn, that allowed many detached daemons to sit idle until their individual watchdogs expired.
This change adds runtime-side safeguards instead of relying on manual cleanup:
last_used_atandactive_requestsOPENSPACE_MCP_MAX_DAEMONS_PER_KINDVerification
Automated:
python3 -m pytest -q tests/test_shared_mcp_runtime_metadata.py tests/test_mcp_proxy_runtime.py tests/test_mcp_entrypoints.py tests/test_mcp_stdio.py tests/test_logging_stdout_safety.py tests/test_codex_session_scenarios.py26 passedRuntime/manual:
~/.codex/config.tomlreported bothopenspaceandopenspace_evolutionasreadysearch_skillscall succeeded after restart/config wiringlast_used_atandactive_requestsNotes
cleanup_openspace_daemons.pyutility is included as operator tooling, but the main recurrence prevention is in the runtime lifecycle path, not the script.