Expose host vMCP session TTL with 12h default - #164
Merged
Conversation
toolhive's vmcpserver.Config.SessionTTL defaults to 30 minutes of idle time, which is short for interactive coding-agent sessions where the user steps away for lunch or meetings. bbox previously passed an empty Config, so this default was silently in effect. Add an MCP.SessionTTL field (string, parsed via time.ParseDuration) to the global config and a corresponding --mcp-session-ttl flag, plumbed through VMCPProvider into vmcpserver.Config. Validation rejects malformed or negative values at load time and at the CLI boundary. Default is 12h. Workspace-local .broodbox.yaml cannot override it (operational, not policy — same handling as review.enabled). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
vmcpserver.Config.SessionTTLdefaults to 30 min of idle time. bbox previously passed an emptyConfig{}, so that default silently applied — short enough that stepping away from an interactive bbox session over lunch / a meeting could cause an MCP session eviction and force re-initialize.MCP.SessionTTLto the global config (mcp.session_ttlin YAML, parsed viatime.ParseDuration) and a matching--mcp-session-ttlflag. Threaded throughNewVMCPProviderintovmcpserver.Config.SessionTTL..broodbox.yamlcannot override the TTL (operational, not policy — same handling asreview.enabled).Resolution precedence
--mcp-session-ttl(non-zero) >mcp.session_ttlin global config > 12 h default.What this depends on / doesn't depend on
aaf3d4db3/8d237da74(SSE keep-alive TTL refresh, streamable HTTP memory leak, sessionless routing UUIDs) — those live in the per-workload transport proxies and are inherited transparently.Test plan
task fmt && task lint && task test(already green locally)bbox claude-codehonors the 12h default — start a session, leave idle past 30 min, run an MCP tool, confirm no re-init stallbbox claude-code --mcp-session-ttl 1mevicts the session as expected--mcp-session-ttl -5srejected with a clear errormcp.session_ttl: not-a-durationin~/.config/broodbox/config.yamlrejected at load time.broodbox.yaml: mcp.session_ttl: 1mis ignored (global value wins)🤖 Generated with Claude Code