Add tests for menu sorting and rebuilding logic in tray manager#9
Merged
Conversation
Dumbris
commented
Jul 7, 2025
Member
- Introduced unit tests for sorting server names and quarantine server names to ensure correct alphanumeric order.
- Added tests for menu rebuild logic to verify detection of new servers and proper sorting during updates.
- Enhanced existing menu management functions to support sorting and rebuilding based on new server data.
- Introduced unit tests for sorting server names and quarantine server names to ensure correct alphanumeric order. - Added tests for menu rebuild logic to verify detection of new servers and proper sorting during updates. - Enhanced existing menu management functions to support sorting and rebuilding based on new server data.
rannow
pushed a commit
to rannow/mcpproxy-go
that referenced
this pull request
Sep 23, 2025
…t-mcp-proxy#9) - Introduced unit tests for sorting server names and quarantine server names to ensure correct alphanumeric order. - Added tests for menu rebuild logic to verify detection of new servers and proper sorting during updates. - Enhanced existing menu management functions to support sorting and rebuilding based on new server data.
Dumbris
added a commit
that referenced
this pull request
Nov 2, 2025
Implements Issues #3, #9, and #11 (Layers 2, 5) from docker-recovery-improvements.md **Issue #11 Layer 2: Container Labels for Ownership Tracking** - Add Docker labels to all containers (instance ID, server name, PID) - formatContainerLabels() generates ownership labels automatically - Labels: com.mcpproxy.managed, com.mcpproxy.instance, com.mcpproxy.server - Enables accurate cleanup of orphaned containers from crashed instances - New file: internal/upstream/core/instance.go for instance ID management **Issue #11 Layer 5: cidfile Timeout Fallback** - When cidfile read times out (slow image pull), fall back to name lookup - Use 'docker ps --filter name=...' to recover container ID - Prevents orphaned containers when cidfile fails - Graceful degradation maintains container cleanup capability **Issue #3: Exponential Backoff Polling** - Replace fixed 5s Docker polling with exponential backoff - Intervals: 2s → 5s → 10s → 30s → 60s (max) - Fast recovery when Docker quickly resumes (2s vs 5s) - Lower CPU/battery usage when Docker off for extended periods - Logs total wait time and attempt count for observability **Issue #9: Partial Failure Handling** - ForceReconnectAll() now returns detailed ReconnectResult struct - Tracks: total servers, attempted, successful, failed, skipped - Per-server skip reasons ("container healthy", "not Docker", "disabled") - Per-server failure errors for debugging - Runtime logs comprehensive summary of reconnection results **Files Modified:** - internal/upstream/core/instance.go: NEW - instance ID persistence - internal/upstream/core/isolation.go: add container labels - internal/upstream/core/docker.go: cidfile timeout fallback - internal/upstream/manager.go: ReconnectResult struct, detailed tracking - internal/runtime/lifecycle.go: log reconnection results - cmd/mcpproxy-tray/main.go: exponential backoff polling, min() helper **Testing:** - All upstream tests passing - Code compiles cleanly - Exponential backoff logic validated **Impact:** - Container labels enable cleanup of orphaned containers across restarts - cidfile fallback prevents container orphaning on slow pulls - Exponential backoff saves resources while maintaining fast recovery - Partial failure tracking improves debugging and observability
This was referenced May 31, 2026
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.