feat(runtime): restore DeepSeek native WebSearch - #3694
Draft
MoonOld wants to merge 5 commits into
Draft
Conversation
Generated-by: OpenAI Codex
A consumer that stops the adapter mid-stream (the reasoning-mismatch throw, a user stop) leaves the SDK without a finish chunk, so teardown rejects every result promise. usage and finishReason were already consumed, but response was only read on the completed continuation path — its rejection could surface as an unhandled rejection after the turn unwound, scheduler-timing owned (observed post-test on Windows, where Node makes it a crash). Sink it unconditionally in the teardown finally, and pin the property with an unhandledRejection trap in the mismatch test so every event loop proves the path leaves none behind.
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
Enable provider-executed WebSearch for first-party DeepSeek V4 Responses models now that the shared Open Responses adapter preserves all observed search actions. Generated-by: OpenAI Codex
This was referenced Aug 24, 2026
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
Restores first-party DeepSeek V4 model-native WebSearch after #2972 deliberately disabled it on the
@ai-sdk/open-responsesadapter boundary.deepseek-v4-flashanddeepseek-v4-pro) and explicitopenai-chatoverride veto;Fixes #3689
Dependencies
This is a stacked Draft PR on #3685, which adds the common Open Responses request/stream transport and preserves
search,open_page, andfind_in_page. #3685 is itself stacked on the Alibaba Token Plan Responses foundation in #3255.The branch currently includes those preceding commits and should be rebased after #3255 and #3685 merge. The DeepSeek-only commit is
0099fe751.Live verification
A normal routed smoke passed on exact DeepSeek head
0099fe751using the first-partyDEEPSEEK_API_KEYfrom the ignored local/Users/moonold/.envfile. The credential was read only in process and was never printed, placed in command arguments, persisted, or attached.Execution path:
Observed:
providerExecuted: true;search,openPage, andfindInPagewith URL/pattern fields;stop;Verification
npm run format:checknpm run lintnpm run check:asf-headersReplay boundary
@ai-sdk/open-responsesstill cannot safely round-trip a provider-executed call/result pair embedded in assistant history. Maka retains the durable search episode and grounded answer, but omits the provider-owned pair from the next request rather than emitting a dangling function output. This is the same explicit fail-closed boundary established by #2972 and is not widened here.AI use
OpenAI Codex assisted with implementation, protocol analysis, automated tests, live verification, and PR drafting. The human contributor reviewed the scope and remains responsible for the contribution. The commit carries a
Generated-by: OpenAI Codextrailer.Checklist
Does this PR entail a change in behavior?