Repository navigation
Conversation
Migrates the archived Stagehand + Valkey cookbook (TypeScript + Python tracks, closed PR #32) to the current CONTRIBUTING.md structure: audience lines, correctly-positioned security callouts, pinned Valkey versions, Configuration Reference tables, and required test files that were missing from the original. Both upstream integration PRs (browserbase/stagehand#2264, browserbase/stagehand-python#346) are open and unmerged, so installs are pinned to a maintainer-reviewed fork (edlng/stagehand, edlng/stagehand-python) with disclosure throughout the docs and sample READMEs, per the acceptance criteria's build-from-clean-clone requirement. Verified against the actual fork source rather than the archived docs, which caught several real inaccuracies: a VALKEY_CACHE_TTL vs CACHE_TTL env var mismatch between the two forks, a stale "@valkey/valkey-glide native addon" claim (the real implementation uses iovalkey), an unconditional valkeyTls default that's actually password-dependent, and a TypeScript build command that silently relied on stale generated files instead of running gen-version/build-dom-scripts via turbo. Signed-off-by: Anna Tao <annatao2004@gmail.com>
GitHub Actions sets CI=true, which makes pnpm default to --frozen-lockfile. The fork's own pnpm-lock.yaml at the pinned commit doesn't match its own package.json (an upstream drift, not something introduced here), so pnpm install failed with ERR_PNPM_OUTDATED_LOCKFILE in CI while succeeding locally, where CI isn't set. Reproduced the exact failure locally with CI=true and confirmed --no-frozen-lockfile resolves it, then re-ran the full build/typecheck/test pipeline under CI=true to confirm the fix holds end to end. Fixes #74 (CI failure on node-test / framework-integrations/stagehand) Signed-off-by: Anna Tao <annatao2004@gmail.com>
Collaborator
|
Closing this draft PR as part of a cookbook program cleanup. |
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.
Summary
Migrates the archived Stagehand + Valkey cookbook (TypeScript + Python tracks) from
archive/main-pre-reorg(closed PR #32, closed during the repo reorganization, not for content reasons) to the currentCONTRIBUTING.mdstructure.Stagehand is Browserbase's open-source browser automation framework. Valkey caching support is implemented in two upstream PRs that are open but not yet merged:
Changes from the archived version
**Who is this for:**audience line to all 6 cookbook files (missing from the archive)01files to after the Docker startup command (was before it)valkey/valkey-bundle:latest→8.1.7everywhere (4 locations)03files, with defaults verified directly against the fork source (not just the PR description)sample/test file for each track (the archived PR had none):cache-contract.test.ts(vitest + iovalkey) andtest_valkey_cache_config.py(pytest + valkey), both exercising the documented key scheme/TTL/command contract against a real Valkey container — no paid services needed.github/workflows/cookbook-ts.ymlandcookbook-python.yml(temporary per-cookbook copies, following the pattern used by other in-flight cookbook PRs until the shared workflow lands)meta.json(not part of the current convention)KEYS→SCANin the cache-inspection stepReal inaccuracies caught by verifying against the actual fork source
The archived cookbook's claims were checked against the PR description; this revamp reads the actual diffs/files at the pinned commits instead, which surfaced:
VALKEY_CACHE_TTLvsCACHE_TTL: the core server's env-var fallback readsVALKEY_CACHE_TTL, but the Python SDK's local-mode process-env builder forwardsvalkey_cache_ttlasCACHE_TTL— the two forks disagree on this one name. Documented as a caveat; the request-body/session-dict path (recommended) is unaffected.@valkey/valkey-glidenative addon. The actual TS core implementation (CacheStorage.ts) dynamically importsiovalkey(plain JS, no native addon at all) — verified directly. Corrected to the real mechanism (the SEA binary doesn't bundle the dynamically-imported optional dependency).valkeyTlsdefault: documented as unconditionallyfalse; it's actuallytruewhen a password is set (verified inCacheStorage.tsand the Python SDK's own field docstring).npm installing the fork directly fails (triggers the monorepo's fullpreparescript). The documented recipe clones + buildspackages/corespecifically vianpx turbo run build --filter=@browserbasehq/stagehand(a plainpnpm --filter ... run buildsilently succeeds only if stale generated files already happen to exist on disk — verified this the hard way against a genuinely fresh clone).Validation
markdownlint-cli2(pinned to the exact version this repo's CI action bundles, 0.17.2): 0 errorsnpx turbo run build --filter=@browserbasehq/stagehand→npm ci→npx tsc --noEmit(passes, validatesdemo.ts's API usage against the real built package) →npm test(4/4 vitest tests pass against a live Valkey container)pip install -r requirements.txt(installs cleanly from the fork viagit+https) →pytest test_valkey_cache_config.py -v(5/5 pass against a live Valkey container)pnpm install --ignore-scripts+npx tsx src/server.ts(no build step needed for the Python track's recipe) — real HTTP 200 on/healthzCookbook structure
Relationship to other PRs
Draft — will stay open until
browserbase/stagehand#2264andbrowserbase/stagehand-python#346show real merge progress. Once either merges and releases, the corresponding track's install instructions switch from the fork to the published package (each doc/README already notes exactly what changes).Pre-Submit Checklist
valkey/valkey-bundle:8.1.7, pinned)