Repository navigation
[CB-0] [sdk-superfan] Fix README quickstart fence and timeout snippet import - #219
Draft
spicysouvlaki wants to merge 1 commit into
Draft
spicysouvlaki wants to merge 1 commit into
spicysouvlaki wants to merge 1 commit into
Conversation
The quickstart closed its ```python fence right after `sessions.create` (README.md:43), so `def run(...)` and the `__main__` guard rendered as Markdown, and the stray ``` before "## Examples" (README.md:67) opened a new fence that swallowed the Examples section up to the ```bash block. Removing the early closer makes the whole quickstart one block and turns the later ``` back into its closer. The timeout snippet calls `httpx.Timeout(...)` without importing httpx. A ruff F821 pass over every README python block showed that as the only undefined name in a standalone snippet. The rest (`client`, `response`, `DefaultHttpxClient` in a `with_options` one-liner) are continuation snippets by design, which is why the new test checks fence structure only and doesn't lint names. tests/test_readme.py asserts fences pair up as labelled-opener/bare-closer. It fails on origin/main and passes after. Verified live: extracted the fixed quickstart block and ran it as-is (screenshot path redirected) against api.dev.browserbase.com with Playwright; it printed "Done!" and the session was released. Not fixed here (separate): the install line `pip install '--pre browserbase'` quotes both tokens as one argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happened
#176: the quickstart's Python fence closes after
sessions.create, sorun()renders as prose and## Exampleslands inside a code block. The timeout snippet raisesNameError: name 'httpx' is not defined.Why
There's an early closing fence at
README.md:43, so the bare fence at:67opens a new block. The timeout block (:302-320) useshttpx.Timeoutbut never importshttpx.Fix
Drop the early closing fence and add
import httpxto the timeout snippet.Tests
tests/test_readme.py, which checks that every fence pairs as a labelled opener and a bare closer. Before: fails. After: passes../scripts/lintand./scripts/test(steady mock, 3.9 + 3.14, pydantic v1/v2) pass.Done!and the session was released.client. I checked by hand with ruff F821.Risk and rollout
README.mdis generated by Stainless and this edit is sealed. The quickstart text likely comes from the Stainless config's readme example, so fix it there too or a regen may conflict.tests/test_readme.pyis a new custom file. Docs only, no runtime change.Fixes #176
🤖 Generated with Claude Code