Skip to content

fix(brightdata): drop stray $ in f-string search URLs - #7317

Closed
simpleqt wants to merge 1 commit into
crewAIInc:mainfrom
simpleqt:fix/brightdata-search-url-dollar
Closed

fix(brightdata): drop stray $ in f-string search URLs#7317
simpleqt wants to merge 1 commit into
crewAIInc:mainfrom
simpleqt:fix/brightdata-search-url-dollar

Conversation

@simpleqt

@simpleqt simpleqt commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

BrightDataSERPTool.get_search_url built its URLs with ${query} inside f-strings:

return f"https://www.bing.com/search?q=${query}"

In an f-string, $ is a literal character, so the result is ...?q=$test — a malformed query string. The URL is passed directly to the SERP request (no template substitution happens later), so every search through the tool carried the stray $.

The three URL templates (yandex/bing/google) now interpolate {query} normally.

(Note: this PR was prepared with AI assistance — happy to see it labeled llm-generated per the contributing guidelines.)

get_search_url interpolated ${query} inside an f-string, producing
URLs like https://www.bing.com/search?q=$test — the literal $ is kept
and the query is interpolated as intended. The URL is passed straight
to the SERP request, so every search hit the wrong query string.
Copilot AI lite review requested due to automatic review settings September 7, 2026 16:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for the pull request.

First-time contributors need an associated open issue before we can review a PR.

  1. Open an issue with a template, or pick an existing open one.
  2. Open a new PR (or reopen this one) whose title or body mentions that issue, for example #123.

See the contributing guide.

@github-actions github-actions Bot closed this Sep 7, 2026
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: d87c771f-d00d-464b-943f-2fa2f0511057

📥 Commits

Reviewing files that changed from the base of the PR and between 1b855b4 and cc3cbdc.

📒 Files selected for processing (1)
  • lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_serp.py

📝 Walkthrough

Walkthrough

The Bright Data SERP tool now inserts the query directly into Yandex, Bing, and Google search URLs.

Changes

Search URL interpolation

Layer / File(s) Summary
Search URL construction
lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_serp.py
get_search_url removes the literal $ prefix from query interpolation for Yandex, Bing, and Google URLs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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