[app-server] Expose web search source URLs#31379
Conversation
71ffd7c to
b34d3a6
Compare
b34d3a6 to
99afc38
Compare
There was a problem hiding this comment.
💡 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()); |
There was a problem hiding this comment.
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 👍 / 👎.
| if is_openai { | ||
| include.push("web_search_call.action.sources".to_string()); |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Validation
just test -p codex-web-search-extensionjust test -p codex-protocol -p codex-app-server-protocoljust 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)just fixjust fmtThe remaining environment-sensitive coverage is left to the GitHub CI matrix.