Skip to content

[app-server] Expose web search source URLs#31379

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

[app-server] Expose web search source URLs#31379
alexi-openai wants to merge 1 commit into
mainfrom
codex/web-search-sources

Conversation

@alexi-openai

Copy link
Copy Markdown
Contributor

Summary

  • request web search source URLs from the Responses API for OpenAI requests
  • preserve source metadata through core events, persistence, and the app-server v2 protocol
  • extract bounded source URLs from standalone web search output and regenerate protocol schemas

Validation

  • just test -p codex-web-search-extension
  • just test -p codex-protocol -p codex-app-server-protocol
  • focused core and app-server source round-trip tests
  • just test -p codex-core (source tests passed; four unrelated environment-sensitive tests failed)
  • just test -p codex-app-server (web-search round-trip passed; nested sandbox and helper-binary tests failed in the execution sandbox)
  • scoped just fix
  • just fmt

The remaining environment-sensitive coverage is left to the GitHub CI matrix.

@alexi-openai alexi-openai force-pushed the codex/web-search-sources branch from 71ffd7c to b34d3a6 Compare July 7, 2026 08:00
@alexi-openai alexi-openai force-pushed the codex/web-search-sources branch from b34d3a6 to 99afc38 Compare July 7, 2026 08:09
@alexi-openai alexi-openai marked this pull request as ready for review July 7, 2026 08:29
@alexi-openai alexi-openai requested a review from a team as a code owner July 7, 2026 08:29

@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: 99afc38d5c

ℹ️ 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".

Vec::new()
};
if is_openai {
include.push("web_search_call.action.sources".to_string());

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.

P0 Badge Cap web search sources before putting them in context

When hosted web search is available and the Responses API returns a large action.sources array, this new include asks for the full list and it is then retained as part of the ResponseItem history that is sent on later requests; unlike the standalone web-search extraction, there is no hard cap or truncation on these URLs before they enter model context. A search with many or very long source URLs can therefore add a >1k-token item and cause unbounded context/cache growth, so the sources should be bounded before being persisted or replayed.

AGENTS.md reference: AGENTS.md:L91-L100

Useful? React with 👍 / 👎.

Comment on lines +879 to +880
if is_openai {
include.push("web_search_call.action.sources".to_string());

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 Include sources for Azure Responses providers

When the configured provider is Azure Responses, provider.info().is_openai() is false even though the request later uses the Azure Responses path (store: provider.is_azure_responses_endpoint()), so web-search turns on Azure never send include: ["web_search_call.action.sources"] and the new app-server sources field remains null. Azure's Responses web-search docs also require this include to return action.sources, so Azure users with web search enabled will not get the source URLs this change is meant to expose (Microsoft Learn).

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