core: migrate standalone web search to extension-owned turn items (#31525)

## Description

This PR migrates standalone web search onto the extension-owned
turn-item path introduced in #31283.

Standalone web search now emits `ExtensionItem::WebSearch` through
generic `TurnItem::Extension`, while app-server still exposes the
existing typed `ThreadItem::WebSearch` JSON shape. Hosted Responses API
web search stays on core-owned `TurnItem::WebSearch`.

## What changed

- Added `web_search::WebSearchItem` and `WebSearchAction` to
`codex-extension-items` under the stable `web.search` kind.
- Collapsed `ExtensionTurnItem` to generic `{ item, legacy_events }` now
that no typed extension special cases remain.
- Kept the existing `WebSearchBegin` / `WebSearchEnd` compatibility
events and canonical-first ordering.
- Updated app-server projection/history and generated TypeScript; the
app-server JSON schema is unchanged.
This commit is contained in:
Owen Lin authored and GitHub committed 2026-07-08 09:40:00 -07:00
1 parent e212cc95b0
commit a219b6fdb4
26 files changed
+279 -209

No files matched your search

+3 -7
View File
@@ -4,7 +4,6 @@ use crate::ToolPayload;
use codex_extension_items::ExtensionItem;
use codex_file_system::ExecutorFileSystem;
use codex_file_system::FileSystemSandboxContext;
use codex_protocol::items::WebSearchItem;
use codex_protocol::models::ResponseItem;
use codex_protocol::protocol::EventMsg;
use codex_utils_absolute_path::AbsolutePathBuf;
@@ -36,8 +35,7 @@ pub type TurnItemEmissionFuture<'a> = Pin<Box<dyn Future<Output = ()> + Send + '
/// Visible turn items that an extension may publish into the host lifecycle.
#[derive(Clone, Debug)]
pub enum ExtensionTurnItem {
WebSearch(WebSearchItem),
pub struct ExtensionTurnItem {
/// Canonical extension item plus compatibility events derived by its owner.
///
/// Core intentionally does not inspect extension-owned payloads, so it
@@ -45,10 +43,8 @@ pub enum ExtensionTurnItem {
/// event first, then these extension-provided events. Core also skips
/// global turn-item contributors here so extensions cannot mutate items
/// owned by other extensions.
Extension {
item: ExtensionItem,
legacy_events: Vec<EventMsg>,
},
pub item: ExtensionItem,
pub legacy_events: Vec<EventMsg>,
}
/// Host-provided capability for extension tools to emit visible turn items.