mirror of
https://github.com/openai/codex.git
synced 2026-11-08 20:40:33 +00:00
Preserve code mode dispatch errors in rollout traces (#60122)
## Why Code mode requests can fail before a `CodeCellStarted` event. Suppressing their dispatch traces loses the caller-facing error in that case. ## What changed Record dispatch lifecycles for code mode custom payloads, preserving their results independently of code cell events. ## Testing Update the incompatible-payload regression test to use the code mode tool name and verify that replay retains the failed tool call and result payload even when no code cells were recorded. GitOrigin-RevId: 687a36cd7ba55665ed7abc88c36732597e7fb025
This commit is contained in:
@@ -249,7 +249,7 @@ async fn dispatch_lifecycle_trace_records_incompatible_payload_failures() -> any
|
||||
attach_test_trace(&mut session, &turn, temp.path())?;
|
||||
|
||||
let registry = ToolRegistry::with_handler_for_test(Arc::new(TestHandler {
|
||||
tool_name: codex_tools::ToolName::plain("test_tool"),
|
||||
tool_name: codex_tools::ToolName::plain(codex_code_mode::PUBLIC_TOOL_NAME),
|
||||
}));
|
||||
let session = Arc::new(session);
|
||||
let turn = Arc::new(turn);
|
||||
@@ -260,7 +260,7 @@ async fn dispatch_lifecycle_trace_records_incompatible_payload_failures() -> any
|
||||
session,
|
||||
turn,
|
||||
"incompatible-call",
|
||||
codex_tools::ToolName::plain("test_tool"),
|
||||
codex_tools::ToolName::plain(codex_code_mode::PUBLIC_TOOL_NAME),
|
||||
ToolCallSource::Direct,
|
||||
ToolPayload::Custom {
|
||||
input: "{}".to_string(),
|
||||
@@ -275,6 +275,7 @@ async fn dispatch_lifecycle_trace_records_incompatible_payload_failures() -> any
|
||||
let tool_call = &replayed.tool_calls["incompatible-call"];
|
||||
assert_eq!(tool_call.execution.status, ExecutionStatus::Failed);
|
||||
assert!(tool_call.raw_result_payload_id.is_some());
|
||||
assert!(replayed.code_cells.is_empty());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user