mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Add bounded tool-result metadata support to executed tool calls (#44336)
## What changed - Add host-recorded `tool_result_metadata` snapshots with size limits, redacted debug output, and protection against deserialization from untrusted input. MCP capture remains disabled. - Preserve accepted metadata across retries and delayed Code Mode results. Shed raw metadata before source evidence, calls, or completion markers when the request budget is exceeded. - Send raw metadata only to allowed OpenAI and ChatGPT HTTPS endpoints, filtering by the resolved destination for HTTP and WebSocket requests. - Encode source parse failures as an array entry with type `parse_failed` and an empty ID. ## Testing Add coverage for metadata bounds and redaction, retained-call updates, budget shedding, disabled MCP capture, and HTTP/WebSocket destination filtering. GitOrigin-RevId: b1a396323ad0623167cdd9e20ff9453f0d01bbf7
This commit is contained in:
1 parent
b5544d5732
commit
0df6366a87
18 files changed
+1198
-120
No files matched your search
@@ -96,6 +96,7 @@ fn mcp_tool_output_response_item_includes_wall_time() {
|
||||
meta: None,
|
||||
},
|
||||
tool_input: json!({}),
|
||||
result_metadata_capture_allowed: false,
|
||||
wall_time: std::time::Duration::from_millis(1250),
|
||||
original_image_detail_supported: false,
|
||||
truncation_policy: TruncationPolicy::Bytes(1024),
|
||||
@@ -142,6 +143,7 @@ fn mcp_tool_output_response_item_truncates_large_structured_content() {
|
||||
meta: None,
|
||||
},
|
||||
tool_input: json!({}),
|
||||
result_metadata_capture_allowed: false,
|
||||
wall_time: std::time::Duration::from_millis(1250),
|
||||
original_image_detail_supported: false,
|
||||
truncation_policy: TruncationPolicy::Bytes(128),
|
||||
@@ -192,6 +194,7 @@ fn mcp_tool_output_response_item_preserves_content_items() {
|
||||
meta: None,
|
||||
},
|
||||
tool_input: json!({}),
|
||||
result_metadata_capture_allowed: false,
|
||||
wall_time: std::time::Duration::from_millis(500),
|
||||
original_image_detail_supported: false,
|
||||
truncation_policy: TruncationPolicy::Bytes(1024),
|
||||
@@ -251,6 +254,7 @@ fn mcp_tool_output_code_mode_result_preserves_content_without_private_metadata(
|
||||
})),
|
||||
},
|
||||
tool_input: json!({}),
|
||||
result_metadata_capture_allowed: false,
|
||||
wall_time: std::time::Duration::from_millis(1250),
|
||||
original_image_detail_supported: false,
|
||||
truncation_policy,
|
||||
|
||||
Reference in new issue
Block a user