Skip to content

Conversation

shift
Copy link
Owner

@shift shift commented Aug 23, 2025

When adding a new agent using the config tool, it currently shows a version update toast instead of an agent addition confirmation. This PR updates the notification to show the correct message.

  • Added a new Agent Added event in ConfigWatcher
  • Updated config tool to emit the event when adding an agent

shift added 7 commits August 22, 2025 20:18
Phase 0 Critical Stability Fixes:

CRASH PREVENTION:
✅ Safe clipboard operations with panic recovery and timeouts
✅ Async API calls to prevent UI blocking
✅ Input buffering during long operations
✅ Comprehensive panic recovery wrappers
✅ Context management with proper timeouts

RESPONSIVENESS:
✅ Non-blocking API calls with background goroutines
✅ Input keystroke buffering during AI responses
✅ Async operation tracking and cancellation
✅ Safe memory and pointer operations

RESOURCE MANAGEMENT:
✅ Proper context timeouts (30s prompts, 15s shell, 5s files)
✅ Background operation cleanup
✅ Memory leak prevention
✅ Goroutine safety improvements

TESTING:
✅ Comprehensive test suite for crash scenarios
✅ Stress tests for concurrent operations
✅ Clipboard failure simulation
✅ Memory operation safety verification

NEXT: Fix LSP process spawning (hundreds of rust-analyzer instances)
NEXT: Fix MCP server startup/shutdown issues

All tests pass. Ready for LSP and MCP process management fixes.
🚨 CRITICAL RESOURCE MANAGEMENT FIXES:

LSP PROCESS SPAWNING FIXES:
✅ Fix hundreds of rust-analyzer instances eating RAM
✅ Process pool with max 2 processes per server type
✅ Process reuse and reference counting
✅ LRU eviction when hitting process limits
✅ Automatic cleanup of idle processes after 5 minutes
✅ Proper process lifecycle management on shutdown

MCP SERVER IMPROVEMENTS:
✅ Health monitoring with 30-second checks
✅ Automatic restart on failure (max 3 attempts)
✅ Graceful shutdown and resource cleanup
✅ Better error handling and logging
✅ Client lifecycle management

PROCESS MONITORING TOOLS:
✅ Real-time process statistics
✅ Health check and alerting system
✅ CLI tools for monitoring and debugging
✅ Automatic detection of resource leaks

BEFORE: Hundreds of rust-analyzer processes spawned per session
AFTER: Maximum 2 processes per LSP server type, automatic cleanup

IMPACT:
- Prevents RAM exhaustion from excessive LSP processes
- Eliminates MCP server startup/shutdown issues
- Provides monitoring tools for process health
- Ensures proper resource cleanup on exit

Ready for testing and validation.
- Add file watcher for config changes with debouncing
- Validate config on reload with proper error handling
- Gracefully restart LSP, MCP, and formatter services
- Support for all config file types (json, jsonc, global, custom)
- Automatic detection of changed sections to minimize impact
Copy link

socket-security bot commented Aug 23, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

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.

1 participant