Skip to content

Resolve Custom Tool Entrypoint Relative to Working Directory in Runner#5

Merged
initializ-mk merged 2 commits intoinitializ:mainfrom
ratnesh-maurya:main
Feb 23, 2026
Merged

Resolve Custom Tool Entrypoint Relative to Working Directory in Runner#5
initializ-mk merged 2 commits intoinitializ:mainfrom
ratnesh-maurya:main

Conversation

@ratnesh-maurya
Copy link
Member

This pull request introduces a small but important fix to how custom tools are registered in the Runner. The entrypoint for each discovered tool is now made relative to the working directory, ensuring that execution from the agent root finds the correct file.

  • Custom tool registration: Modified the entrypoint for discovered tools to be relative to the working directory by joining "tools" with the tool's entrypoint, preventing path issues when running from the agent root. (forge-cli/runtime/runner.go, forge-cli/runtime/runner.goL133-R136)

Prefix discovered tool Entrypoint with "tools" (via filepath.Join) before creating the custom tool so execution from the agent root can find the file. A copy of the discovered tool is modified to avoid mutating the original, then passed to NewCustomTool.
Copy link
Contributor

@initializ-mk initializ-mk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — clean, minimal fix.

Copying dt before mutating the entrypoint avoids side effects on the original slice, and filepath.Join("tools", dt.Entrypoint) correctly resolves the path relative to WorkDir so the agent root can locate the script.

Verified this applies cleanly against the in-flight core/make-skill-modular branch (PR #6) with no conflicts — the changes are in a completely separate code path.

@initializ-mk initializ-mk merged commit 3224310 into initializ:main Feb 23, 2026
9 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.

2 participants