Skip to content

fix: remove $ prefix from f-strings in BrightDataSearchTool.get_search_url#5273

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1775307258-fix-brightdata-serp-query-url
Open

fix: remove $ prefix from f-strings in BrightDataSearchTool.get_search_url#5273
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1775307258-fix-brightdata-serp-query-url

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Apr 4, 2026

Summary

Fixes #5269

The get_search_url method in BrightDataSearchTool used JavaScript template literal syntax (${query}) instead of Python f-string syntax ({query}) when building search URLs. This caused every search query to be prepended with a literal $ character (e.g. ?q=$AI%20news instead of ?q=AI%20news). All three search engines (Google, Bing, Yandex) were affected.

The fix removes the erroneous $ from all three f-strings.

Added 4 tests to cover the fix:

  • Unit tests for get_search_url on each engine verifying correct URL format
  • Integration test through _run verifying the URL sent to the API has no $ prefix

Review & Testing Checklist for Human

  • Verify the three f-string changes in brightdata_serp.py lines 133-137 look correct (removed $ only, nothing else changed)
  • Optionally run BrightDataSearchTool with a real API key to confirm queries work end-to-end without the $ prefix

Link to Devin session: https://app.devin.ai/sessions/0f820d69f9f74596a25ecab76c3fed67


Note

Low Risk
Low risk: fixes a small URL formatting bug and adds focused tests; behavioral change is limited to removing an unintended $ character in outgoing search queries.

Overview
Fixes BrightDataSearchTool.get_search_url to use proper Python f-string interpolation ({query}) for Google/Bing/Yandex, removing the accidental literal $ prefix that was being sent in search queries.

Adds unit tests for each engine’s URL formatting and an _run flow test to assert the request payload URL is encoded correctly and contains no $ in the query.

Reviewed by Cursor Bugbot for commit 1386a43. Bugbot is set up for automated code reviews on this repo. Configure here.

…h_url

The get_search_url method used JavaScript template literal syntax (${query})
instead of Python f-string syntax ({query}), causing a literal '$' character
to be prepended to all search queries for Google, Bing, and Yandex.

Fixes #5269

Co-Authored-By: João <joao@crewai.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Prompt hidden (unlisted session)

@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

@github-actions github-actions bot added the size/S label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] BrightData SERP tool uses JavaScript template syntax in Python f-strings, breaking all search queries

0 participants