Skip to content

Conversation

@Dumbris
Copy link
Contributor

@Dumbris Dumbris commented Jun 25, 2025

  • Introduced a comprehensive fix for dynamic menu updates in the mcpproxy-go tray system, addressing critical issues such as empty security menus and lack of server management options.
  • Implemented server deletion functionality, including UI updates for delete actions in the tray menu.
  • Enhanced real-time synchronization of menus to reflect server status changes immediately.
  • Added detailed logging for better traceability of server actions and menu updates.
  • Ensured complete test coverage for new features and verified functionality through unit and integration tests.

- Introduced a comprehensive fix for dynamic menu updates in the mcpproxy-go tray system, addressing critical issues such as empty security menus and lack of server management options.
- Implemented server deletion functionality, including UI updates for delete actions in the tray menu.
- Enhanced real-time synchronization of menus to reflect server status changes immediately.
- Added detailed logging for better traceability of server actions and menu updates.
- Ensured complete test coverage for new features and verified functionality through unit and integration tests.
@Dumbris Dumbris closed this Jul 3, 2025
@Dumbris
Copy link
Contributor Author

Dumbris commented Jul 3, 2025

Menu was fixed in PR #8

@Dumbris Dumbris deleted the feature/systray-menu-improvements branch July 3, 2025 16:25
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
technicalpickles added a commit to technicalpickles/mcpproxy-go that referenced this pull request Dec 1, 2025
Enhanced docs/oauth-zero-config.md with detailed documentation for:

1. Server States Section:
   - Connected states: ready (authenticated), connected (no token)
   - Waiting states: pending_auth (normal waiting state, not an error)
   - Transitional states: connecting, authenticating
   - Error states: disconnected, error

2. Checking Authentication Status:
   - How to use `mcpproxy auth status` command
   - Example output with emoji indicators (✅⏳❌)
   - Status meaning explanations

3. Troubleshooting Section with 4 Common Issues:

   Issue smart-mcp-proxy#1: Server Shows "Pending Auth" State
   - Symptoms: ⏳ icon in tray, pending_auth status
   - Cause: OAuth detected but user hasn't authenticated
   - Solution: Use `auth login` or tray "Authenticate" action
   - Clarification: NOT an error, intentional deferral

   Issue smart-mcp-proxy#2: Authentication Token Expired
   - Symptoms: Was working, now shows "Auth Failed"
   - Cause: OAuth token expired (1-24 hour lifetime)
   - Solution: Re-authenticate with `auth login`

   Issue smart-mcp-proxy#3: OAuth Detection Not Working
   - Symptoms: No pending_auth, just connection failures
   - Diagnosis: Check doctor output, logs, manual OAuth test
   - Common causes: Non-standard endpoints, firewall issues
   - Solution: Add explicit OAuth configuration

   Issue smart-mcp-proxy#4: OAuth Login Opens Browser But Fails
   - Symptoms: Browser opens, approval given, but still fails
   - Diagnosis: Check callback logs for authorization code
   - Common causes: Port conflict, timeout, firewall
   - Solution: Retry with debug logging

4. Diagnostic Commands Reference:
   - doctor: Quick OAuth detection check
   - auth status: View token status
   - upstream list: Check connection status
   - upstream logs: View OAuth flow logs
   - auth login --log-level=debug: Test with debug output
   - upstream list --format=json | jq: Verify OAuth config

This addresses user confusion about "Pending Auth" being displayed as an
error state. Documentation now clearly explains it's a normal waiting state
and provides step-by-step troubleshooting for all OAuth-related issues.

Related to PR smart-mcp-proxy#165: Zero-config OAuth with RFC 8707 support
Task: Update documentation for OAuth server states and troubleshooting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants