Skip to content

Conversation

@monadoid
Copy link

@monadoid monadoid commented Jan 10, 2026

why

Better DX if frameId doesn't need to be passed in.

what changed

  • Made frameId optional - passes empty string to server internally, and server just uses the default frameId instead of an empty string.
  • Also updated readme + examples to reflect this + added in link to local_example.py in readme as well while I was at it.

test plan


Summary by cubic

Make frameId optional on session actions. If not provided, the client sends an empty string and the server uses the default main frame.

  • New Features
    • frame_id is now optional for navigate, act, observe, extract, and execute (sync and async).
    • Added a helper to inject frame_id="" when missing; server behavior remains the same.
    • Updated README and examples to omit frame_id; tests assert frameId "" is sent when omitted.
    • Added a Playwright bring-your-own-browser example and README guidance for local mode.

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

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="examples/byob_example.py">

<violation number="1" location="examples/byob_example.py:37">
P1: This example doesn't achieve the stated BYOB (Bring Your Own Browser) goal. The `AsyncStagehand` client uses the default `server="remote"` mode, creating a browser session on Browserbase that is completely independent from the local Playwright browser. These two browsers never share the same page - they're just navigating to the same URLs independently.

To actually demonstrate BYOB, consider using `server="local"` mode, or clarify the example's purpose to show how to coordinate between two separate browser sessions.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

browserbase_project_id=os.environ.get("BROWSERBASE_PROJECT_ID"),
model_api_key=os.environ.get("MODEL_API_KEY"),
) as client, async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True)
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 11, 2026

Choose a reason for hiding this comment

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

P1: This example doesn't achieve the stated BYOB (Bring Your Own Browser) goal. The AsyncStagehand client uses the default server="remote" mode, creating a browser session on Browserbase that is completely independent from the local Playwright browser. These two browsers never share the same page - they're just navigating to the same URLs independently.

To actually demonstrate BYOB, consider using server="local" mode, or clarify the example's purpose to show how to coordinate between two separate browser sessions.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/byob_example.py, line 37:

<comment>This example doesn't achieve the stated BYOB (Bring Your Own Browser) goal. The `AsyncStagehand` client uses the default `server="remote"` mode, creating a browser session on Browserbase that is completely independent from the local Playwright browser. These two browsers never share the same page - they're just navigating to the same URLs independently.

To actually demonstrate BYOB, consider using `server="local"` mode, or clarify the example's purpose to show how to coordinate between two separate browser sessions.</comment>

<file context>
@@ -0,0 +1,74 @@
+        browserbase_project_id=os.environ.get("BROWSERBASE_PROJECT_ID"),
+        model_api_key=os.environ.get("MODEL_API_KEY"),
+    ) as client, async_playwright() as playwright:
+        browser = await playwright.chromium.launch(headless=True)
+        page = await browser.new_page()
+        session = await client.sessions.create(model_name="openai/gpt-5-nano")
</file context>
Fix with Cubic

@monadoid monadoid merged commit c9fefcc into stainless Jan 11, 2026
7 of 8 checks passed
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.

3 participants