feat: Add MCP connection keepalive/reload mechanism for CLI-37#562
Open
szmania wants to merge 14 commits into
Open
feat: Add MCP connection keepalive/reload mechanism for CLI-37#562szmania wants to merge 14 commits into
szmania wants to merge 14 commits into
Conversation
added 7 commits
June 6, 2026 09:04
Co-authored-by: cecli (openai/code)
Co-authored-by: cecli (openai/code)
…7-mcp-connection-keepalive # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
…li-37-mcp-connection-keepalive # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
added 3 commits
June 19, 2026 21:44
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Author
|
@dwash96 This one is ready |
added 3 commits
June 20, 2026 11:14
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Author
|
This addresses this error when being on cecli tui for a certain amoutn of time: |
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.
Purpose
Implement a keepalive/reload mechanism for MCP server connections to prevent connection errors during periods of inactivity. Addresses Jira issue CLI-37: MCP connection keepalive/reload mechanism.
Changes
ConnectionStateenum to track connection status (CONNECTED, UNHEALTHY, DISCONNECTED)start_keepalive()and_keepalive_loop()methods to send periodic OPTIONS requestsConfiguration Example
The
keepalive_intervalcan be added to your MCP server configuration. Here is an example of what an MCP object looks like in JSON format:{ "name": "my-mcp-server", "url": "http://localhost:8000", "type": "http", "keepalive_interval": 30, "headers": { "Authorization": "Bearer my-token" }, "enabled": true }Testing
All tests pass:
test_keepalive_config.py- Validates configuration parameterstest_keepalive_concurrency.py- Tests task lifecycle and isolationtest_keepalive_integration.py- Tests with mock servertest_keepalive_logging.py- Verifies proper loggingtest_keepalive_resilience.py- Tests recovery scenariostest_keepalive_unit.py- Tests state transitionsRelated Issues
Fixes CLI-37: MCP connection keepalive/reload mechanism
Notes
keepalive_intervalis configurable in the server config:Checklist