You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the first Alibaba Harness-tool slice from #3163: provider-native WebSearch for qwen3.8-max on the Alibaba Token Plan China and international access paths.
keeps capability routing fail-closed and exact-model scoped; Qwen 3.7 remains disabled because Maka still routes it through Chat;
lowers the canonical Maka WebSearch descriptor to the documented Responses tools: [{ type: "web_search" }] request shape;
decodes streamed web_search_call items into provider-executed call/result events, preserving search, open_page, and find_in_page actions, generated queries, source URLs, and usage.x_tools;
reuses the existing Runtime projection for durable events, UI/export, privacy-mode removal, and tool ceilings;
keeps the current replay boundary explicit: the durable search episode and grounded answer survive, while the provider-owned call/result pair is omitted from the next request rather than creating a dangling function output.
This PR intentionally does not close#3163. web_extractor, code interpreter, image-search tools, and broader Qwen 3.7 Responses routing remain follow-up slices.
Upstream dependency and patch retirement
The generic @ai-sdk/open-responses@2.0.34 adapter drops provider-defined tools and does not decode bare web_search_call items. This Draft carries a narrow dependency patch for current verification only.
AI SDK 2.0.35 introduced explicit extension codecs, but they accept only normative namespaced wire types. #19939 adds an explicit fail-closed bare extension codec for documented implementation types such as web_search and web_search_call; its CI is green and it is awaiting upstream review.
Retirement rule: once that API is merged and released, replace this patch with a package-local Experimental_OpenResponsesBareExtension, prove request/stream/replay behavior against the unpatched package, and delete patches/@ai-sdk+open-responses+*.patch plus its LICENSE/patch README entries.
Verification
Exact head 3ae89609a, rebased directly onto main at bd951aa88:
fresh npm ci applies @ai-sdk/open-responses@2.0.34 cleanly and reports 0 vulnerabilities;
full workspace build:test and workspace typecheck passed;
npm run format:check, npm run lint, npm run check:asf-headers, and git diff --check passed;
A protected live smoke on the exact rebased tree used production AiSdkBackend + ModelAdapter + getAIModel, the configured Token Plan China connection, and qwen3.8-max. The credential was read only in process and was never printed, placed in command arguments, persisted, or attached.
request 1: HTTP 200, store:false, exactly one web_search tool descriptor, one provider-executed call/result pair, and a grounded final answer ending in the requested sentinel;
a companion probe on the immediately preceding main base observed two completed search actions carrying 39 source rows;
request 2: HTTP 200, store:false, completed from durable prior context with the requested replay sentinel;
no web_search_call item was replayed in request 2, preserving the explicit fail-closed adapter boundary;
both model turns completed with end_turn; no local Tavily or ToolRuntime WebSearch implementation ran.
The product routing change is limited to both Alibaba Token Plan provider types and exact model ID qwen3.8-max.
Unknown provider tools and item types remain unsupported.
The patch is temporary, version-pinned, source-release-accounted, and bound to upstream #19933/#19939.
Durable reasoning, ordinary function tools, DeepSeek's existing disabled native-search route, and main's durable Tool Result projection remain covered and unchanged.
AI use
No generative tool made a substantive contribution
Generative tooling made a substantive contribution
OpenAI Codex assisted with protocol research, implementation, tests, upstream coordination, live verification, and PR drafting. The human contributor reviewed the scope and remains responsible for the contribution. The commits carry Generated-by: OpenAI Codex trailers.
Checklist
Tests cover the current compatibility behavior
Lint, format, typecheck, build, release, and affected suites pass locally
Exact-tree live WebSearch and next-turn replay evidence is recorded
Replace the dependency patch with the released upstream bare-extension codec before marking ready for review
Live Token Plan WebSearch smoke passed on exact feature head 46e452d32 (2026-08-24).
Execution path: the PR branch production getAIModel + ModelAdapter, configured Alibaba Token Plan China connection, exact model qwen3.8-max, and the canonical provider WebSearch descriptor. The credential was read only in process from the local credential vault and was never printed.
Observed result:
outcome: completed; finish reason: stop;
two WebSearch calls, both marked providerExecuted: true;
provider results included the official Qwen3.8-Max model page and Alibaba Model Studio Web Search documentation;
final grounded answer correctly reported that Qwen3.8-Max supports Web Search and named the official source URLs;
Additional live boundary probe on exact head 46e452d32: the local DEEPSEEK_API_KEY was read in process from /Users/moonold/.env without printing or persisting it, and a forced provider descriptor was sent through the production getAIModel + ModelAdapter path to first-party https://api.deepseek.com/responses with deepseek-v4-flash.
Observed:
outbound tools: [{ "type": "web_search" }];
outcome: completed, finish reason stop;
six provider-executed WebSearch calls;
raw provider action types: search, open_page, and find_in_page;
This proves the dependency patch fixes the common Open Responses request/stream transport for DeepSeek as well, but it does not make DeepSeek production-ready yet:
resolveHostedWebSearchCapability(deepseek, ...) still returns implemented:false, so normal Maka routing never advertises the tool.
The current narrow mapper is correct for Alibaba search + sources, but it rewrites DeepSeek open_page and find_in_page actions as empty search actions, losing their URL/pattern in the normalized tool result.
Therefore DeepSeek should stay disabled until the action union and tests cover all three shapes and a normal routed smoke passes. The temporary probe runner was removed and retained no credential material.
Shared mapper follow-up pushed in 3a74825a9: Open Responses WebSearch now preserves search, open_page → openPage, and find_in_page → findInPage instead of collapsing every provider action to search. A deterministic raw-SSE contract test pins all three shapes.
DeepSeek capability enablement remains out of this Alibaba PR and is isolated in #3694 / #3689.
Route Qwen3.8 Max Token Plan sessions to provider-executed Responses web search, and extend the pinned open-responses adapter with the published web_search request and web_search_call stream shapes.
Generated-by: OpenAI Codex
Map search, open_page, and find_in_page into the canonical provider-executed WebSearch output instead of collapsing every hosted action to search.
Generated-by: OpenAI Codex
Regenerate the temporary WebSearch compatibility patch against 2.0.34 while preserving the upstream reasoning-summary mapping. Retirement is tracked by vercel/ai#19933 and #19939.
Generated-by: OpenAI Codex
regenerated the temporary dependency patch against the currently pinned @ai-sdk/open-responses@2.0.34, preserving the released reasoning-summary mapping;
The Token Plan China live smoke also passed on the rebased tree: qwen3.8-max received exactly one native web_search descriptor, emitted a provider-executed WebSearch pair, completed a grounded answer, and completed a second durable-context turn without replaying a dangling web_search_call item.
This remains Draft while #19939 is awaiting upstream review. Once its bare-extension codec is published, the dependency patch and legal/README entries should be deleted before this PR is marked ready.
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
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
Adds the first Alibaba Harness-tool slice from #3163: provider-native
WebSearchforqwen3.8-maxon the Alibaba Token Plan China and international access paths.WebSearchdescriptor to the documented Responsestools: [{ type: "web_search" }]request shape;web_search_callitems into provider-executed call/result events, preservingsearch,open_page, andfind_in_pageactions, generated queries, source URLs, andusage.x_tools;Refs #3163
This PR intentionally does not close#3163.
web_extractor, code interpreter, image-search tools, and broader Qwen 3.7 Responses routing remain follow-up slices.Upstream dependency and patch retirement
The generic
@ai-sdk/open-responses@2.0.34adapter drops provider-defined tools and does not decode bareweb_search_callitems. This Draft carries a narrow dependency patch for current verification only.The missing public seam is tracked upstream:
AI SDK 2.0.35 introduced explicit extension codecs, but they accept only normative namespaced wire types. #19939 adds an explicit fail-closed bare extension codec for documented implementation types such as
web_searchandweb_search_call; its CI is green and it is awaiting upstream review.Retirement rule: once that API is merged and released, replace this patch with a package-local
Experimental_OpenResponsesBareExtension, prove request/stream/replay behavior against the unpatched package, and deletepatches/@ai-sdk+open-responses+*.patchplus itsLICENSE/patch README entries.Verification
Exact head
3ae89609a, rebased directly ontomainatbd951aa88:npm ciapplies@ai-sdk/open-responses@2.0.34cleanly and reports 0 vulnerabilities;build:testand workspace typecheck passed;npm run format:check,npm run lint,npm run check:asf-headers, andgit diff --checkpassed;Live Token Plan evidence
A protected live smoke on the exact rebased tree used production
AiSdkBackend + ModelAdapter + getAIModel, the configured Token Plan China connection, andqwen3.8-max. The credential was read only in process and was never printed, placed in command arguments, persisted, or attached.store:false, exactly oneweb_searchtool descriptor, one provider-executed call/result pair, and a grounded final answer ending in the requested sentinel;store:false, completed from durable prior context with the requested replay sentinel;web_search_callitem was replayed in request 2, preserving the explicit fail-closed adapter boundary;end_turn; no local Tavily or ToolRuntime WebSearch implementation ran.Provider documentation:
Review focus
qwen3.8-max.AI use
OpenAI Codex assisted with protocol research, implementation, tests, upstream coordination, live verification, and PR drafting. The human contributor reviewed the scope and remains responsible for the contribution. The commits carry
Generated-by: OpenAI Codextrailers.Checklist
Does this PR entail a change in behavior?