Skip to content

refactor: Implement simplified path handling system - #3

Merged
debugmcpdev merged 2 commits into
mainfrom
feature/simplified-path-handling
Aug 28, 2025
Merged

debugmcpdev merged 2 commits into
mainfrom
feature/simplified-path-handling

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Major path handling refactor to address cross-platform issues:

Key Changes:

  • Replace complex PathValidator with SimpleFileChecker
  • TRUE HANDS-OFF approach: accept all paths as-is from clients
  • Container mode: simple /workspace/ prefix only
  • Pass original paths to debug adapter unchanged
  • Remove cross-platform path interpretation logic

New Components:

  • src/utils/simple-file-checker.ts - minimal file existence checking
  • Updated server.ts to use SimpleFileChecker for immediate UX feedback
  • Enhanced documentation and architecture guides

Removed Components:

  • src/utils/path-validator.ts - overly complex cross-platform logic
  • Associated documentation for deprecated path resolution

Benefits:

  • Eliminates unsolvable cross-platform edge cases
  • Lets OS and debug adapter handle path resolution natively
  • Cleaner, more maintainable codebase
  • Better separation of concerns

This addresses Linux CI failures while maintaining Windows compatibility. Still investigating container test path resolution for 'host-examples' paths.

🤖 Generated with Claude Code

📋 Description

Please include a summary of the changes and which issue is fixed. Include relevant motivation and context.

Fixes # (issue number)

🔄 Type of Change

Please delete options that are not relevant.

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧹 Code refactoring
  • ⚡ Performance improvement
  • 🧪 Test improvement

✅ Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

🧪 Testing

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

# Example test command
npm test

Test Configuration:

  • OS: [e.g., Ubuntu 22.04]
  • Node version: [e.g., 20.11.0]
  • Python version: [e.g., 3.11.5]

📸 Screenshots (if applicable)

If your changes include UI updates or visual debugging improvements, please add screenshots.

🔗 Related Issues

Link any related issues here:

  • Related to #
  • Depends on #
  • Blocks #

📝 Additional Notes

Any additional information that reviewers should know.


Reviewer: @debugmcp

Ubuntu and others added 2 commits August 25, 2025 21:35
Major path handling refactor to address cross-platform issues:

**Key Changes:**
- Replace complex PathValidator with SimpleFileChecker
- TRUE HANDS-OFF approach: accept all paths as-is from clients
- Container mode: simple /workspace/ prefix only
- Pass original paths to debug adapter unchanged
- Remove cross-platform path interpretation logic

**New Components:**
- src/utils/simple-file-checker.ts - minimal file existence checking
- Updated server.ts to use SimpleFileChecker for immediate UX feedback
- Enhanced documentation and architecture guides

**Removed Components:**
- src/utils/path-validator.ts - overly complex cross-platform logic
- Associated documentation for deprecated path resolution

**Benefits:**
- Eliminates unsolvable cross-platform edge cases
- Lets OS and debug adapter handle path resolution natively
- Cleaner, more maintainable codebase
- Better separation of concerns

This addresses Linux CI failures while maintaining Windows compatibility.
Still investigating container test path resolution for 'host-examples' paths.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ittent failures

- Simplified cross-platform path handling in session manager and file checker
- Added container-path-utils for better path normalization and validation
- Fixed intermittent SSE test failures on Windows caused by port reuse race condition
  - Added 200ms delay after port release in findAvailablePort() to ensure Windows fully releases ports
  - Implemented retry logic (up to 3 attempts) in startSSEServer() when encountering EACCES errors
  - Enhanced cleanup with graceful shutdown (SIGTERM first, then SIGKILL if needed)
- Updated error scenarios tests for improved path handling
- Added comprehensive documentation of the SSE test fix

The SSE test was failing with 'EACCES: permission denied' when running multiple times
in a loop on Windows. This was due to a race condition where the OS hadn't fully
released the port between the availability check and actual server startup.

These changes significantly improve CI/CD pipeline stability, especially on Windows.
@debugmcpdev
debugmcpdev merged commit 909f9de into main Aug 28, 2025
5 checks passed
@debugmcpdev
debugmcpdev deleted the feature/simplified-path-handling branch August 28, 2025 21:15
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