[AP-2925] Enable server-side caching by default in v4

Merged
SA
2mo ago
+69-22

v4 shipped with server-side caching opt-in, where v3 had it on by default. Anyone who upgraded without passing cache lost caching without an error.

Change

Both defaults flip to true, so v4 matches v3: caching runs unless the instance or the call opts out.

Docs

v4/best-practices/caching.mdx described opt-in, which this makes wrong.

The v3 migration guide also mapped enableCaching → cache. enableCaching was a v2-era local option that v3 had already replaced with cacheDir; the server-side option v3 users actually had was serverCache, which appeared nowhere in the v4 docs. Corrected the mapping and the diff example.

🤖 Generated with Claude Code


Summary by cubic

Fixes AP-2925 by restoring v3's caching default in v4: caching was opt-in and is now enabled unless the instance or call opts out. This prevents upgrades from silently losing caching; the server's project feature flag still controls availability.

  • Adds tests for the omitted default, explicit opt-out, and default cache lookup, and regenerates the embedded Go extension archive to match the merged extension source after resolving a conflict with main.
  • Corrects the migration guide to map serverCache to cache and remove outdated enableCaching/cacheDir mappings; updates caching docs for locator-scoped bypasses, DISABLED status, the stagehand.act opt-out example, and create() examples that show the default doing the work.
  • Updates credential-safety guidance in act, prompting, and the Browser Use migration to warn that variable values reach the cache service by default, recommending cache: false on calls carrying credentials.