[codex] Enable standalone web search in code mode#26719
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e28d2a19b4
ℹ️ 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".
| Ok(Box::new(EncryptedSearchOutput::new( | ||
| response.encrypted_output, | ||
| ))) | ||
| Ok(Box::new(SearchOutput::new(response.output))) |
There was a problem hiding this comment.
Preserve encrypted search output for model-visible replies
When web.run is called as a normal model-visible tool (the app-server test still exercises that path), this line discards the returned encrypted_output and later sends output as input_text in the next Responses request. That injects the full standalone search result into model history instead of the encrypted content, and the root AGENTS.md “Model visible context” rule requires new model-context fragments that can exceed 1k tokens to be highlighted and bounded. Keep the encrypted payload for to_response_item while using plaintext only for code-mode results.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
pseudo related to this, there is some token accounting for tool call output. previously this was encrypted so responses added a max_output_tokens field (because we couldn’t truncate encrypted content in the harness safely), but now that it’s not can/does this output go through the normal tool call accounting that tracks + truncates large results?
EDIT: nvm, we get this for free
|
Fix: add
Fix: consider attaching untrusted/external provenance (and a length cap) to the search output so downstream handling can treat it as data rather than instructions. Reasonable to accept as-is if that matches the intended trust model — flagging so it's a conscious call. |
| output: FunctionCallOutputPayload::from_content_items(vec![ | ||
| FunctionCallOutputContentItem::EncryptedContent { | ||
| encrypted_content: self.encrypted_output.clone(), | ||
| FunctionCallOutputContentItem::InputText { |
There was a problem hiding this comment.
codex:
Should this PR also make standalone search honor memories.disable_on_external_context? This output is recorded as a normal FunctionCallOutput, which the external-context detector does not recognize, so plaintext web results remain eligible for memory generation even when that setting is enabled.
There was a problem hiding this comment.
adding a func on tool output to allow us to do this cleanly. It is bit out of the scope of this PR (since its creating something reusable for future external tool calls), so I've stacked a follow up PR to resolve this issue: #26821
What
outputfrom standalone search while retaining optionalencrypted_outputparsing.web.runto code mode and return search output to nested JavaScript calls.Why
/v1/alpha/searchnow returns plaintext output, which code mode needs to consume standalone search results.Test plan
just test -p codex-apijust test -p codex-web-search-extensionjust test -p codex-core code_mode_can_call_standalone_web_searchjust test -p codex-app-server standalone_web_search_round_trips_output