mirror of
https://github.com/openai/codex.git
synced 2026-11-17 14:58:36 +00:00
[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:
1 parent
0526cb56ac
commit
26d9329833
4 files changed
+113
-2
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user