[codex] Exclude external tool output from memories (#26821)

## Summary

- add contains_external_context() to tool output so other tools can be
opted out of influencing memory when disable_on_external_context=true
- Classify standalone web-search output as external context (to match
behavior as hosted web search)
- Verify with integration test
This commit is contained in:
rka-oai authored and GitHub committed 2026-06-08 16:53:04 +00:00
1 parent 0526cb56ac
commit 26d9329833
4 files changed
+113 -2

No files matched your search

+10
View File
@@ -18,6 +18,12 @@ pub trait ToolOutput: Send {
fn success_for_logging(&self) -> bool;
/// Whether this output contains external context that should disable memory generation when
/// `memories.disable_on_external_context` is enabled.
fn contains_external_context(&self) -> bool {
false
}
fn to_response_item(&self, call_id: &str, payload: &ToolPayload) -> ResponseInputItem;
/// Returns the tool call id exposed to `PostToolUse` hooks for this output.
@@ -58,6 +64,10 @@ where
(**self).success_for_logging()
}
fn contains_external_context(&self) -> bool {
(**self).contains_external_context()
}
fn to_response_item(&self, call_id: &str, payload: &ToolPayload) -> ResponseInputItem {
(**self).to_response_item(call_id, payload)
}