mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
feat: drop agent ID from v2 (#17005)
This commit is contained in:
committed by
GitHub
Unverified
parent
e2bb45bb24
commit
2a8c3a2a52
@@ -1554,7 +1554,7 @@ async fn multi_agent_v2_interrupted_turn_does_not_notify_parent() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn multi_agent_v2_spawn_includes_agent_id_key_when_named() {
|
||||
async fn multi_agent_v2_spawn_omits_agent_id_when_named() {
|
||||
let (mut session, mut turn) = make_session_and_context().await;
|
||||
let manager = thread_manager();
|
||||
let root = manager
|
||||
@@ -1586,7 +1586,7 @@ async fn multi_agent_v2_spawn_includes_agent_id_key_when_named() {
|
||||
let result: serde_json::Value =
|
||||
serde_json::from_str(&content).expect("spawn_agent result should be json");
|
||||
|
||||
assert_eq!(result["agent_id"], serde_json::Value::Null);
|
||||
assert!(result.get("agent_id").is_none());
|
||||
assert_eq!(result["task_name"], "/root/test_process");
|
||||
assert!(result.get("nickname").is_some());
|
||||
assert_eq!(success, Some(true));
|
||||
|
||||
@@ -209,7 +209,6 @@ impl ToolHandler for Handler {
|
||||
})?;
|
||||
|
||||
Ok(SpawnAgentResult {
|
||||
agent_id: None,
|
||||
task_name,
|
||||
nickname,
|
||||
})
|
||||
@@ -269,7 +268,6 @@ impl SpawnAgentArgs {
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct SpawnAgentResult {
|
||||
agent_id: Option<String>,
|
||||
task_name: String,
|
||||
nickname: Option<String>,
|
||||
}
|
||||
|
||||
@@ -375,10 +375,6 @@ fn spawn_agent_output_schema_v2() -> Value {
|
||||
json!({
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"agent_id": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Legacy thread identifier for the spawned agent."
|
||||
},
|
||||
"task_name": {
|
||||
"type": "string",
|
||||
"description": "Canonical task name for the spawned agent."
|
||||
@@ -388,7 +384,7 @@ fn spawn_agent_output_schema_v2() -> Value {
|
||||
"description": "User-facing nickname for the spawned agent when available."
|
||||
}
|
||||
},
|
||||
"required": ["agent_id", "task_name", "nickname"],
|
||||
"required": ["task_name", "nickname"],
|
||||
"additionalProperties": false
|
||||
})
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ fn spawn_agent_tool_v2_requires_task_name_and_lists_visible_models() {
|
||||
);
|
||||
assert_eq!(
|
||||
output_schema.expect("spawn_agent output schema")["required"],
|
||||
json!(["agent_id", "task_name", "nickname"])
|
||||
json!(["task_name", "nickname"])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -243,10 +243,7 @@ fn test_build_specs_multi_agent_v2_uses_task_names_and_hides_resume() {
|
||||
let output_schema = output_schema
|
||||
.as_ref()
|
||||
.expect("spawn_agent should define output schema");
|
||||
assert_eq!(
|
||||
output_schema["required"],
|
||||
json!(["agent_id", "task_name", "nickname"])
|
||||
);
|
||||
assert_eq!(output_schema["required"], json!(["task_name", "nickname"]));
|
||||
|
||||
let send_message = find_tool(&tools, "send_message");
|
||||
let ToolSpec::Function(ResponsesApiTool { parameters, .. }) = &send_message.spec else {
|
||||
|
||||
Reference in New Issue
Block a user