Skip to content

fix: guard WorkingDirectory.resolve(String) against absolute paths#3180

Merged
pedro18x merged 1 commit intomainfrom
MA-4005-fix-working-directory-absolute-path
Apr 15, 2026
Merged

fix: guard WorkingDirectory.resolve(String) against absolute paths#3180
pedro18x merged 1 commit intomainfrom
MA-4005-fix-working-directory-absolute-path

Conversation

@pedro18x
Copy link
Copy Markdown
Contributor

@pedro18x pedro18x commented Apr 15, 2026

Summary

  • WorkingDirectory.resolve(path: String) did not check isAbsolute, so File(baseDir, absolutePath) stripped the leading separator and concatenated, producing duplicated paths like /Users/foo/mcp-sandbox/Users/foo/mcp-sandbox/flow.yaml.
  • The sibling resolve(file: File) overload already guards correctly; the String overload now delegates to it so the absolute-path rule lives in one place.
  • Fixes MA-4005 — "MCP: Error on first auto-run due to doubled file path". The only MCP caller is RunFlowFilesTool.kt:70, and its tool description explicitly encourages absolute paths, so this path is well-exercised in practice.

🤖 Generated with Claude Code

The resolve(String) overload did not check whether the input was already
absolute, so File(baseDir, absolutePath) stripped the leading separator
and concatenated, producing duplicated paths like
/Users/foo/mcp-sandbox/Users/foo/mcp-sandbox/flow.yaml when the MCP
run_flow_files tool was called with an absolute path on first run.

Delegate to the resolve(File) overload so the absolute-path guard lives
in exactly one place.

Fixes MA-4005

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Apr 15, 2026

@pedro18x pedro18x merged commit f3fad23 into main Apr 15, 2026
5 checks passed
@pedro18x pedro18x deleted the MA-4005-fix-working-directory-absolute-path branch April 15, 2026 19:52
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