Repository navigation
feat: add reconnect_on_use for on-demand upstream reconnection - #363
Merged
Merged
Conversation
When enabled per-server, tool calls targeting a disconnected upstream will trigger a bounded immediate reconnect attempt (15s timeout) before failing. If reconnection succeeds, the tool call is retried automatically. This improves UX for intermittent servers like remote devtools, SSH tunnels, and OAuth-backed services. Key implementation details: - New `reconnect_on_use` field in ServerConfig (opt-in, default false) - New `TryReconnectSync()` method on managed.Client for synchronous reconnection (vs ForceReconnect which is async) - Manager.CallTool() releases m.mu.RLock during reconnect to avoid blocking other operations - Reconnect is skipped for user-logged-out, quarantined, or already-connecting servers - Uses existing reconnectInProgress flag to prevent storms - Concurrent callers wait for in-progress reconnect via polling Fixes #354 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Deploying mcpproxy-docs with
|
| Latest commit: |
8764c38
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c4edf839.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-354-reconnect-on-use.mcpproxy-docs.pages.dev |
The reconnect_on_use config field was only added to the config struct and manager logic but was missing from the full persistence chain: - REST API AddServerRequest and PatchServer handler - BBolt storage (UpstreamRecord, Save/Get/List) - Runtime server map for StateView - Management service ListServers converter - Contract types for API response - CLI client AddServerRequest - UpdateServer method in server.go Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 23882900028 --repo smart-mcp-proxy/mcpproxy-go
|
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
reconnect_on_useper-server config option that triggers a bounded synchronous reconnect attempt (15s timeout) when a tool call targets a disconnected upstream serverreconnectInProgressmutex flag; concurrent callers wait for in-progress reconnect rather than spawning duplicatesChanged files
internal/config/config.goReconnectOnUsefield onServerConfiginternal/upstream/managed/client.goTryReconnectSync()andwaitForReconnectCompletion()methodsinternal/upstream/manager.goCallTool()with lock release during reconnectdocs/configuration.mdoas/swagger.yaml+oas/docs.goTest plan
false(no behavior change for existing users)reconnect_on_use: falsedoes not trigger reconnect on disconnected serverreconnect_on_use: trueattempts reconnect when server is disconnectedTryReconnectSynccalls don't cause storms (5 goroutines)TryReconnectSyncrespects context cancellation-raceflagFixes #354
🤖 Generated with Claude Code