mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Avoid cloning the PostToolUse hook payload (#62532)
Take the payload from the successful tool result and pass it directly to the post-tool-use hooks. GitOrigin-RevId: bb7dbe82bbc7b565257b94a0473476326e60db12
This commit is contained in:
@@ -999,7 +999,7 @@ impl ToolRegistry {
|
||||
|
||||
let log_payload = tool_log_payload(&invocation.payload, &invocation.source);
|
||||
|
||||
let result = otel
|
||||
let mut result = otel
|
||||
.log_tool_result_with_tags(
|
||||
&tool_name,
|
||||
&call_id_owned,
|
||||
@@ -1029,9 +1029,9 @@ impl ToolRegistry {
|
||||
emit_metric_for_tool_read(&invocation, success);
|
||||
let post_tool_use_payload = if success {
|
||||
result
|
||||
.as_ref()
|
||||
.as_mut()
|
||||
.ok()
|
||||
.and_then(|result| result.post_tool_use_payload.clone())
|
||||
.and_then(|result| result.post_tool_use_payload.take())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user