Skip to content

fix(sdks): forward recordSession in browser-create (JS + Python) - #4590

Open
soroush5 wants to merge 1 commit into
firecrawl:mainfrom
soroush5:fix/sdk-browser-record-session
Open

fix(sdks): forward recordSession in browser-create (JS + Python)#4590
soroush5 wants to merge 1 commit into
firecrawl:mainfrom
soroush5:fix/sdk-browser-record-session

Conversation

@soroush5

@soroush5 soroush5 commented Sep 10, 2026

Copy link
Copy Markdown

I noticed the API supports recordSession on POST /v2/browser (wired through to the browser service as record), but the JS and Python SDKs had no way to send it — sessions created from either SDK are always recorded.

What I changed:

  • JS: added recordSession to browser() args and the request payload in src/v2/methods/browser.ts (left unset by default so the server default still applies).
  • Python: added record_session to browser() in the sync + async method modules and both client wrappers, sent as recordSession.

Tests I ran:

  • New unit tests on both sides asserting recordSession: false is forwarded and that the key is omitted when unset: src/__tests__/unit/v2/browser-record-session.unit.test.ts (jest, 2 passed) and apps/python-sdk/tests/test_browser_record_session.py (pytest, 3 passed).
  • Proved they fail without the fix by stashing the source changes and re-running (both suites go red, then green again after popping).
  • Neighboring suites: JS unit dir is 161 passed with 2 pre-existing failures (threat-protection, scrape — both fail identically on the clean tree); Python tests/ shows the same 13 pre-existing failures before and after my change, with my 3 new tests passing. tsc --noEmit reports only pre-existing errors in files I didn't touch.

No config, migration, or deployment impact — purely additive optional params.

Fixes #4589


Summary by cubic

Fixes #4589 — adds recordSession to browser-create in the JS and Python SDKs. Sessions created from either SDK were always recorded because the API's recordSession option was never sent; now the SDKs pass it through, and callers who omit it still get the server's default.

  • JS: optional recordSession arg on browser() is forwarded to the request body.
  • Python: optional record_session arg added to sync and async browser() methods, sent as recordSession.
  • New unit tests on both sides verify recordSession: false is forwarded and the key is omitted when unset.
  • Purely additive — no config, migration, or deployment impact.

Written for commit 54e1af3. Summary will update on new commits.

Review in cubic

@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.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger 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.

JS + Python SDKs cannot disable browser session recording (recordSession missing from browser-create)

1 participant