feat(providers): land hosted web search with restart replay - #635
Merged
Merged
Conversation
Add a two-state per-model binding that attaches the vendor's hosted web search tool on the anthropic-messages and openai-responses wires. The pi-ai patch attaches the tool, extracts search blocks and citations from the stream, and replays them verbatim on later turns; a pi-agent-core patch forwards the new progress event so each search round renders live as its own transcript activity row. Search state normalizes to UiMessage.hostedSearch (one round per provider call), persists as an additive transcript block without a SQL migration, and degrades honestly on endpoints that accept but never execute the tool. Recorded in ADR 0291.
Bring native web search onto current main. The incoming ADR 0294 collided with the archive workbench, so the search record is 0296.
Live turns already kept the adapter's raw search parts in memory. Restart rebuilt history from display rounds only, so Anthropic encrypted_content and Responses web_search_call items vanished and later turns lost grounding. Store those parts on hostedSearch.replay and restore them in historyToEntries.
Keep ADR 0296 for the signed DMG two-icon install and number the hosted-search record 0297 so both decisions stay distinct.
This branch was successfully deployed
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.
Lands #624 onto current main, then fixes the cross-session replay hole.
What #624 added
Per-model opt-in for provider-hosted web search on
anthropic-messages/openai-responses/azure-openai-responses. Default off. Transcript activity rows, no composer globe.What this follow-up fixes
Restart rebuilt model context from display
roundsonly, so Anthropicencrypted_contentand Responsesweb_search_callitems disappeared. Later turns lost grounding.hostedSearch.replayhistoryToEntries(thinking → search → text)nativeWebSearchSupportedOnnativeWebSearchwhen importing a PI-Desktop model configCompaction still drops search blocks. Search still runs on the provider (no local fetch, no ask/allow).
Related: #624