Skip to content

fix(tools): keep the configured base URL path in web tool requests - #1177

Open
xdAsaah wants to merge 1 commit into
dynamiq-ai:mainfrom
xdAsaah:fix/web-tool-base-url-path
Open

xdAsaah wants to merge 1 commit into
dynamiq-ai:mainfrom
xdAsaah:fix/web-tool-base-url-path

Conversation

@xdAsaah

@xdAsaah xdAsaah commented Nov 28, 2026

Copy link
Copy Markdown

A web tool's connection carries a configurable base URL, and four of them did not keep its path:

  • FirecrawlTool concatenated the endpoint: self.connection.url + "scrape" turned https://gw.example.com/firecrawl/v2 into .../v2scrape.
  • FirecrawlSearchTool and LinkupTool joined a relative search. urljoin treats the base's last segment as a file name, so .../firecrawl/v2 became .../firecrawl/search.
  • TavilyTool and ScaleSerpTool joined "/search", an absolute path that drops the base path entirely.

Only a custom base URL hits this: every default ends with / or has no path at all, and the existing tests assert exactly those defaults.

join_base_url() in dynamiq/nodes/tools/utils.py keeps the base as a directory before joining, the same shape as the Whisper and ElevenLabs fix in #1164, so all five call sites resolve the same URL whether or not an operator writes the trailing slash.

Compatibility

No change to saved workflows. The default connections resolve to the same URLs, and a base URL that already ended with / resolves as before. Only a base URL whose last segment belongs to the path and has no trailing slash changes, from a request to an endpoint that does not exist to the intended one.

Verified

  • Added tests/unit/nodes/tools/test_web_tool_base_url.py: five tools × base URL with and without the trailing slash, plus one case asserting the URL FirecrawlTool actually posts to.
  • Without the change: pytest tests/unit/nodes/tools/test_web_tool_base_url.py → 8 failed, 3 passed.
  • With the change: 11 passed.
  • Mutation check: restoring the old join fails 6 of the 11; the trailing-slash variants pass either way, by design.
  • Regression: pytest tests/integration/nodes/tools/test_firecrawl.py tests/integration/nodes/tools/test_firecrawl_search.py tests/integration/nodes/tools/test_linkup.py tests/integration/nodes/tools/test_tavily.py tests/unit/nodes/tools/test_firecrawl_async.py tests/unit/nodes/tools/test_web_tool_base_url.py → 42 passed.
  • flake8 and isort --check-only clean on the changed files.

This change was prepared with AI assistance.

FirecrawlTool appended "scrape" to the connection URL, and the search tools handed a
relative path to urljoin, which treats the base's last segment as a file name and
replaces it. A gateway or a self-hosted deployment configured as
https://gw.example.com/firecrawl/v2 therefore posted to .../v2scrape and
.../firecrawl/search. Tavily and ScaleSerp passed "/search", an absolute path that drops
the base path altogether. The default URLs hid all of this by ending with "/" or having
no path.

join_base_url() keeps the base as a directory before joining, so the endpoint lands
under it whether or not the operator writes the trailing slash.
@xdAsaah
xdAsaah requested a review from a team as a code owner November 28, 2026 03:23

This branch has not been deployed

No deployments
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