--- Environment Information
Stagehand:
- Language/SDK: TypeScript
- Stagehand version: 3.1.0
AI Provider:
- Provider: OpenAI
- Model: gpt-4.1-mini
Browser:
- Browser Environment: Browserbase
- serverCache: true
Issue Description
Server-side caching does not work for extract(), act(), and
observe() methods despite documentation stating it should
work automatically when running on Browserbase.
Steps to Reproduce
- Create new project with npx create-browser-app
- Run with default config (env: "BROWSERBASE",
serverCache: true)
- Execute extract(), act(), or observe() call
- Check cacheStatus - always returns "MISS"
- Run same operation again - still "MISS"
Minimal Reproduction Code
import "dotenv/config";
import { Stagehand } from "@browserbasehq/stagehand";
const stagehand = new Stagehand({
env: "BROWSERBASE",
serverCache: true,
});
await stagehand.init();
const page = stagehand.context.pages()[0];
await page.goto("https://stagehand.dev");
// First call - always MISS
const extractResult = await stagehand.extract(
"Extract the value proposition from the page."
);
console.log(extractResult.cacheStatus); // "MISS"
// Second call with same URL and instruction - still MISS
const extractResult2 = await stagehand.extract(
"Extract the value proposition from the page."
);
console.log(extractResult2.cacheStatus); // "MISS"
Error Messages / Log trace
extract server cache miss
act server cache miss
observe server cache miss
All show cachedInputTokens: 0 and cacheStatus: "MISS" even
on repeated identical calls.
Additional Notes
--- Environment Information
Stagehand:
AI Provider:
Browser:
Issue Description
Server-side caching does not work for extract(), act(), and
observe() methods despite documentation stating it should
work automatically when running on Browserbase.
Steps to Reproduce
serverCache: true)
Minimal Reproduction Code
import "dotenv/config";
import { Stagehand } from "@browserbasehq/stagehand";
const stagehand = new Stagehand({
env: "BROWSERBASE",
serverCache: true,
});
await stagehand.init();
const page = stagehand.context.pages()[0];
await page.goto("https://stagehand.dev");
// First call - always MISS
const extractResult = await stagehand.extract(
"Extract the value proposition from the page."
);
console.log(extractResult.cacheStatus); // "MISS"
// Second call with same URL and instruction - still MISS
const extractResult2 = await stagehand.extract(
"Extract the value proposition from the page."
);
console.log(extractResult2.cacheStatus); // "MISS"
Error Messages / Log trace
extract server cache miss
act server cache miss
observe server cache miss
All show cachedInputTokens: 0 and cacheStatus: "MISS" even
on repeated identical calls.
Additional Notes
https://docs.stagehand.dev/v3/best-practices/caching says
server caching works for extract/act/observe but it doesn't