Skip to content

feat(python-sdk): configurable origin attribution for Arcade and other integrators - #4440

Open
erikengervall wants to merge 1 commit into
mainfrom
erik/python-sdk-configurable-origin
Open

feat(python-sdk): configurable origin attribution for Arcade and other integrators#4440
erikengervall wants to merge 1 commit into
mainfrom
erik/python-sdk-configurable-origin

Conversation

@erikengervall

@erikengervall erikengervall commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional origin= on Firecrawl / AsyncFirecrawl and v2 HTTP clients so integrators can stamp attribution (e.g. arcade-mcp) instead of the hardcoded python-sdk@version
  • Thread origin through research GET helpers via client.origin
  • Expose wait_crawl on the top-level async client (parity with sync)
  • Fix async agent methods to use status_code >= 400 instead of resp.ok (httpx has no .ok)

Test plan

  • pytest apps/python-sdk/firecrawl/__tests__/unit/v2/utils/test_origin.py
  • Confirm scrape/search payloads include custom origin when constructed with origin="arcade-mcp"
  • Confirm research GETs include origin query param from the client

Made with Cursor


Summary by cubic

Adds configurable request origin attribution to the Python SDK so integrators like Arcade can stamp their own identifier (e.g. arcade-mcp) instead of the hardcoded python-sdk@<version>. Defaults to python-sdk@<version> when no origin= is provided, so existing callers are unaffected.

New Features

  • Adds an optional origin= argument to Firecrawl, AsyncFirecrawl, and the v2 HTTP clients.
  • Threads the configured origin through research GET helpers so all request types carry it.
  • Exposes wait_crawl on AsyncFirecrawl, matching the sync client.

Bug Fixes

  • Fixes async agent methods to use status_code >= 400 since httpx responses have no .ok attribute.

Written for commit e570554. Summary will update on new commits.

Review in cubic

Integrators like Arcade can stamp origin=arcade-mcp instead of the
hardcoded python-sdk@version. Also expose wait_crawl on AsyncFirecrawl
and fix async agent status checks for httpx (status_code vs resp.ok).

Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-ai cubic-dev-ai Bot 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.

2 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/python-sdk/firecrawl/client.py">

<violation number="1" location="apps/python-sdk/firecrawl/client.py:296">
P1: The sync `Firecrawl` client references `self._v2_client.wait_crawl`, but `FirecrawlClient` (v2/client.py) defines no `wait_crawl` method. Because this assignment runs in `__init__` and evaluates the attribute immediately, constructing the sync client raises `AttributeError`. The async v2 client has a `wait_crawl` method, so the async addition is fine; the sync side needs either a `wait_crawl` method added to `FirecrawlClient` or to keep using the existing `crawl`/`start_crawl` waiter.</violation>

<violation number="2" location="apps/python-sdk/firecrawl/client.py:296">
P0: Constructing the sync `Firecrawl` client now raises `AttributeError`: `self.wait_crawl = self._v2_client.wait_crawl` reads an attribute that the sync v2 `FirecrawlClient` (v2/client.py) does not define. `wait_crawl` exists only on the async v2 client (v2/client_async.py). Either add a `wait_crawl` method to the sync v2 client, or gate this assignment so sync construction does not crash.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic


self.crawl = self._v2_client.crawl
self.start_crawl = self._v2_client.start_crawl
self.wait_crawl = self._v2_client.wait_crawl

@cubic-dev-ai cubic-dev-ai Bot Aug 28, 2026

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.

P0: Constructing the sync Firecrawl client now raises AttributeError: self.wait_crawl = self._v2_client.wait_crawl reads an attribute that the sync v2 FirecrawlClient (v2/client.py) does not define. wait_crawl exists only on the async v2 client (v2/client_async.py). Either add a wait_crawl method to the sync v2 client, or gate this assignment so sync construction does not crash.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/python-sdk/firecrawl/client.py, line 296:

<comment>Constructing the sync `Firecrawl` client now raises `AttributeError`: `self.wait_crawl = self._v2_client.wait_crawl` reads an attribute that the sync v2 `FirecrawlClient` (v2/client.py) does not define. `wait_crawl` exists only on the async v2 client (v2/client_async.py). Either add a `wait_crawl` method to the sync v2 client, or gate this assignment so sync construction does not crash.</comment>

<file context>
@@ -289,6 +293,7 @@ def __init__(
 
         self.crawl = self._v2_client.crawl
         self.start_crawl = self._v2_client.start_crawl
+        self.wait_crawl = self._v2_client.wait_crawl
         self.crawl_params_preview = self._v2_client.crawl_params_preview
         self.get_crawl_status = self._v2_client.get_crawl_status
</file context>
Fix with cubic


self.crawl = self._v2_client.crawl
self.start_crawl = self._v2_client.start_crawl
self.wait_crawl = self._v2_client.wait_crawl

@cubic-dev-ai cubic-dev-ai Bot Aug 28, 2026

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.

P1: The sync Firecrawl client references self._v2_client.wait_crawl, but FirecrawlClient (v2/client.py) defines no wait_crawl method. Because this assignment runs in __init__ and evaluates the attribute immediately, constructing the sync client raises AttributeError. The async v2 client has a wait_crawl method, so the async addition is fine; the sync side needs either a wait_crawl method added to FirecrawlClient or to keep using the existing crawl/start_crawl waiter.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/python-sdk/firecrawl/client.py, line 296:

<comment>The sync `Firecrawl` client references `self._v2_client.wait_crawl`, but `FirecrawlClient` (v2/client.py) defines no `wait_crawl` method. Because this assignment runs in `__init__` and evaluates the attribute immediately, constructing the sync client raises `AttributeError`. The async v2 client has a `wait_crawl` method, so the async addition is fine; the sync side needs either a `wait_crawl` method added to `FirecrawlClient` or to keep using the existing `crawl`/`start_crawl` waiter.</comment>

<file context>
@@ -289,6 +293,7 @@ def __init__(
 
         self.crawl = self._v2_client.crawl
         self.start_crawl = self._v2_client.start_crawl
+        self.wait_crawl = self._v2_client.wait_crawl
         self.crawl_params_preview = self._v2_client.crawl_params_preview
         self.get_crawl_status = self._v2_client.get_crawl_status
</file context>
Fix with cubic

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