mirror of
https://github.com/openai/codex.git
synced 2026-11-17 14:58:36 +00:00
Support plaintext collaboration tool messages (#35845)
## What changed - Preserve `encrypted_function_args` on function calls so an empty list can mark plaintext collaboration arguments across request replay. - Deliver `spawn_agent`, `send_message`, and `followup_task` payloads as structured plaintext agent messages when that marker is present; retain encrypted delivery otherwise. - Redact plaintext collaboration arguments from tool and communication logs, and omit the metadata when sending requests to non-OpenAI providers. ## Testing - Cover serialization of empty encrypted-argument metadata and plaintext versus encrypted subagent message delivery. - Verify plaintext tool arguments are redacted and provider-specific metadata is removed from non-OpenAI requests. GitOrigin-RevId: 64db98ff0b61a3af2f04ed609292363f2e2362a8
This commit is contained in:
1 parent
166658a34a
commit
03edf16f0b
36 files changed
+390
-76
No files matched your search
@@ -24,6 +24,7 @@ use crate::tools::handlers::multi_agents_spec::MULTI_AGENT_V1_NAMESPACE;
|
||||
use crate::tools::hook_names::HookToolName;
|
||||
use crate::tools::lifecycle::notify_tool_finish;
|
||||
use crate::tools::lifecycle::notify_tool_start;
|
||||
use crate::tools::router::tool_log_payload;
|
||||
use crate::tools::tool_dispatch_trace::ToolDispatchTrace;
|
||||
use crate::util::error_or_panic;
|
||||
use codex_extension_api::ToolCallOutcome;
|
||||
@@ -465,7 +466,7 @@ impl ToolRegistry {
|
||||
Some(tool) => tool,
|
||||
None => {
|
||||
let message = unsupported_tool_call_message(&invocation.payload, &tool_name);
|
||||
let log_payload = invocation.payload.log_payload();
|
||||
let log_payload = tool_log_payload(&invocation.payload, &invocation.source);
|
||||
otel.tool_result_with_tags(
|
||||
tool_name_flat.as_ref(),
|
||||
&call_id_owned,
|
||||
@@ -496,7 +497,7 @@ impl ToolRegistry {
|
||||
}
|
||||
if !tool.matches_kind(&invocation.payload) {
|
||||
let message = format!("tool {tool_name} invoked with incompatible payload");
|
||||
let log_payload = invocation.payload.log_payload();
|
||||
let log_payload = tool_log_payload(&invocation.payload, &invocation.source);
|
||||
otel.tool_result_with_tags(
|
||||
tool_name_flat.as_ref(),
|
||||
&call_id_owned,
|
||||
@@ -578,7 +579,7 @@ impl ToolRegistry {
|
||||
|
||||
let response_cell = tokio::sync::Mutex::new(None);
|
||||
let invocation_for_tool = invocation.clone();
|
||||
let log_payload = invocation.payload.log_payload();
|
||||
let log_payload = tool_log_payload(&invocation.payload, &invocation.source);
|
||||
|
||||
let result = otel
|
||||
.log_tool_result_with_tags(
|
||||
|
||||
Reference in new issue
Block a user