Skip to content

feat(providers): land hosted web search with restart replay - #635

Merged
vastsa merged 5 commits into
mainfrom
merge/pr-624
Sep 19, 2026
Merged

vastsa merged 5 commits into
mainfrom
merge/pr-624

Conversation

@vastsa

@vastsa vastsa commented Sep 19, 2026

Copy link
Copy Markdown
Owner

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 rounds only, so Anthropic encrypted_content and Responses web_search_call items disappeared. Later turns lost grounding.

  • Persist adapter raw blocks on hostedSearch.replay
  • Restore them in historyToEntries (thinking → search → text)
  • Renumber the incoming ADR to 0296 (0294 was already the archive workbench)
  • Gate the settings checkbox through nativeWebSearchSupportedOn
  • Keep nativeWebSearch when importing a PI-Desktop model config

Compaction still drops search blocks. Search still runs on the provider (no local fetch, no ask/allow).

Related: #624

zeroy1024 and others added 3 commits September 19, 2026 10:49
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.
Copilot AI lite review requested due to automatic review settings September 19, 2026 06:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Keep ADR 0296 for the signed DMG two-icon install and number the
hosted-search record 0297 so both decisions stay distinct.
@vastsa
vastsa merged commit 23859ea into main Sep 19, 2026
4 checks passed
@vastsa
vastsa deleted the merge/pr-624 branch September 21, 2026 11:16

This branch was successfully deployed

1 active deployment
Preview — 9ec3d431 Deployed Sep 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants