Skip to content

Add tool working directory parameter#5

Merged
mkusaka merged 5 commits into
mainfrom
devin/1745129346-add-tool-working-dir
Apr 20, 2025
Merged

Add tool working directory parameter#5
mkusaka merged 5 commits into
mainfrom
devin/1745129346-add-tool-working-dir

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 20, 2025

Add Tool Working Directory Parameter

This PR adds:

  • Support for passing working directory parameter when executing tools via MCP
  • Working directory parameter is required when CLI flag is not passed, optional when flag is passed
  • Updated tests to verify the new functionality
  • Improved path validation using Node.js built-in path.relative() function
  • Resolved merge conflicts with main branch
  • Removed try-catch blocks from CLI argument parsing

Implementation Details

  • Modified the shell_exec tool schema to conditionally require workingDir parameter based on CLI flag
  • Updated tests to include workingDir parameter in test cases
  • Fixed ProcessOutput type mocking in tests
  • Enhanced path validation using path.relative() for more reliable directory validation
  • Adapted to use Command API instead of program for CLI parsing
  • Simplified CLI argument parsing by removing unnecessary error handling

Testing

  • Compiled successfully with pnpm build
  • All tests passing with pnpm test
  • Verified that workingDir parameter works correctly with tool execution

Link to Devin run: https://app.devin.ai/sessions/bd23fbf0492b460f851d2f1f910e60ca
Requested by: hinoshita1992@gmail.com

devin-ai-integration Bot and others added 2 commits April 20, 2025 06:18
Co-Authored-By: hinoshita1992@gmail.com <hinoshita1992@gmail.com>
Co-Authored-By: hinoshita1992@gmail.com <hinoshita1992@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: hinoshita1992@gmail.com <hinoshita1992@gmail.com>
devin-ai-integration Bot and others added 2 commits April 20, 2025 06:32
Co-Authored-By: hinoshita1992@gmail.com <hinoshita1992@gmail.com>
Co-Authored-By: hinoshita1992@gmail.com <hinoshita1992@gmail.com>
@mkusaka mkusaka merged commit 8241836 into main Apr 20, 2025
3 checks passed
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