Skip to content

[app-server] Add client-only web search result metadata#31515

Open
alexi-openai wants to merge 1 commit into
mainfrom
codex/web-search-results-client
Open

[app-server] Add client-only web search result metadata#31515
alexi-openai wants to merge 1 commit into
mainfrom
codex/web-search-results-client

Conversation

@alexi-openai

@alexi-openai alexi-openai commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add bounded URL, title, and snippet metadata to client-facing web search items
  • persist the metadata in rollout events and restore it in app-server thread history
  • expose it through app-server v2 and exec JSONL output for rendering
  • leave all web search producers empty in this foundation change

Provider follow-ups are split into #31379 for hosted Responses and #31516 for standalone /alpha/search.

Model-context boundary

This PR does not change ResponseItem, WebSearchAction, or Responses request construction. The metadata exists only on client-facing WebSearchItem/WebSearchEndEvent values, so it is not added to what the model sees.

Validation

  • just test -p codex-protocol -p codex-app-server-protocol -p codex-exec web_search
  • just test -p codex-app-server-protocol
  • just test -p codex-app-server standalone_web_search_round_trips_output
  • just test -p codex-web-search-extension
  • just test -p codex-core parses_web_search
  • just fix (scoped to affected packages)
  • just fmt

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c6ad5ea3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

id: String,
query: String,
action: Option<WebSearchAction>,
results: Option<Vec<WebSearchResult>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3 Badge Document the new webSearch results field

This adds results to the app-server v2 webSearch ThreadItem that is returned by thread/read and item/* notifications, but the README's Items section still documents webSearch as {id, query, action?} (I checked codex-rs/app-server/README.md). Clients relying on the documented app-server API will miss the new metadata unless the README/example is updated with the schema change.

AGENTS.md reference: AGENTS.md:L298-L300

Useful? React with 👍 / 👎.

skip_serializing_if = "Option::is_none"
)]
#[ts(optional)]
pub results: Option<Vec<WebSearchResult>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Clamp web search results before emitting them

When an extension emits a WebSearchItem with non-empty results, these public fields are persisted and sent to clients as-is; the new bounding function only runs during deserialization of already-serialized events. That means an extension can still emit a huge URL/title/snippet payload and bypass the intended caps for live notifications and rollout writes, so the results should be normalized at the emission/construction boundary before serialization.

Useful? React with 👍 / 👎.

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.

1 participant