Bug
search_web and search_x tools fail with:
Grok API error: 410 "Live search is deprecated. Please switch to the Agent Tools API:
https://docs.x.ai/docs/guides/tools/overview"
Root Cause
When a user runs bun add @ai-sdk/xai@latest (which resolves to 3.0.82), Bun's global cache at ~/.bun/install/cache/ stores the 3.0.82 artifact. This version requires zod/v4 subpath exports, which Bun 1.3.x cannot resolve from the global cache. The module resolution fails silently and falls back to a code path that hits the deprecated Live Search API endpoint (/v1/chat/completions with search_parameters) instead of the Responses API (/v1/responses) with Agent Tools.
Even after reverting package.json back to the pinned @ai-sdk/xai@3.0.67, the stale 3.0.82 cache entry persists in ~/.bun/install/cache/@ai-sdk/xai@3.0.82@@@1 and takes precedence.
Reproduction
bun add @ai-sdk/xai@latest (installs 3.0.82)
- Revert to
@ai-sdk/xai@3.0.67 in package.json
bun install
- Run any search — get 410
Fix (user-side workaround)
rm -rf ~/.bun/install/cache/@ai-sdk/xai@3.0.82@@@1
rm -rf ~/.bun/install/cache/@ai-sdk/xai/3.0.82@@@1
rm -rf node_modules && bun install
Suggested Project Fix
- Add a note to README/CONTRIBUTING about this Bun cache pitfall
- Consider pinning exact versions in
bun.lock with a --frozen-lockfile CI check
- When Bun resolves the
zod/v4 subpath export issue (likely Bun 1.4+), bump to latest SDK
Environment
- OS: macOS arm64
- Bun: 1.3.9 – 1.3.11
- @ai-sdk/xai: 3.0.67 (working) / 3.0.82 (broken via cache)
- zod: 4.3.6
- xAI API: Responses API v1
Verified
The pinned v3.0.67 with provider.responses(model) + provider.tools.webSearch() works correctly — confirmed with live test returning fresh results from the Responses API.
Bug
search_webandsearch_xtools fail with:Root Cause
When a user runs
bun add @ai-sdk/xai@latest(which resolves to 3.0.82), Bun's global cache at~/.bun/install/cache/stores the 3.0.82 artifact. This version requireszod/v4subpath exports, which Bun 1.3.x cannot resolve from the global cache. The module resolution fails silently and falls back to a code path that hits the deprecated Live Search API endpoint (/v1/chat/completionswithsearch_parameters) instead of the Responses API (/v1/responses) with Agent Tools.Even after reverting
package.jsonback to the pinned@ai-sdk/xai@3.0.67, the stale3.0.82cache entry persists in~/.bun/install/cache/@ai-sdk/xai@3.0.82@@@1and takes precedence.Reproduction
bun add @ai-sdk/xai@latest(installs 3.0.82)@ai-sdk/xai@3.0.67in package.jsonbun installFix (user-side workaround)
Suggested Project Fix
bun.lockwith a--frozen-lockfileCI checkzod/v4subpath export issue (likely Bun 1.4+), bump to latest SDKEnvironment
Verified
The pinned v3.0.67 with
provider.responses(model)+provider.tools.webSearch()works correctly — confirmed with live test returning fresh results from the Responses API.