Rename Realtime V2 tool to background_agent (#17278)

Rename the Realtime V2 delegation tool and parser constant to
background_agent, and update the tool description and fixtures to match.

Validation: just fmt; cargo check -p codex-api; git diff --check

---------

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ahmed Ibrahim
2026-04-09 22:17:55 -07:00
committed by GitHub
parent 9f2a585153
commit 60236e8c92
5 changed files with 34 additions and 32 deletions

View File

@@ -868,7 +868,7 @@ mod tests {
"item": {
"id": "item_123",
"type": "function_call",
"name": "codex",
"name": "background_agent",
"call_id": "call_123",
"arguments": "{\"prompt\":\"delegate this\"}"
}
@@ -989,7 +989,7 @@ mod tests {
"output": [{
"id": "item_123",
"type": "function_call",
"name": "codex",
"name": "background_agent",
"call_id": "call_123",
"arguments": "{\"prompt\":\"delegate from done\"}"
}]
@@ -1283,7 +1283,7 @@ mod tests {
assert_eq!(fourth_json["handoff_id"], "handoff_1");
assert_eq!(
fourth_json["output_text"],
"\"Agent Final Message\":\n\nhello from codex"
"\"Agent Final Message\":\n\nhello from background agent"
);
ws.send(Message::Text(
@@ -1407,7 +1407,7 @@ mod tests {
connection
.send_conversation_handoff_append(
"handoff_1".to_string(),
"hello from codex".to_string(),
"hello from background agent".to_string(),
)
.await
.expect("send handoff");
@@ -1493,7 +1493,7 @@ mod tests {
}
#[tokio::test]
async fn realtime_v2_session_update_includes_codex_tool_and_handoff_output_item() {
async fn realtime_v2_session_update_includes_background_agent_tool_and_handoff_output_item() {
let listener = TcpListener::bind("127.0.0.1:0").await.expect("bind");
let addr = listener.local_addr().expect("local addr");
@@ -1553,7 +1553,7 @@ mod tests {
);
assert_eq!(
first_json["session"]["tools"][0]["name"],
Value::String("codex".to_string())
Value::String("background_agent".to_string())
);
assert_eq!(
first_json["session"]["tools"][0]["parameters"]["required"],