mirror of
https://github.com/openai/codex.git
synced 2026-10-23 18:08:45 +00:00
Omit unavailable task messages from list_agents
This commit is contained in:
@@ -78,7 +78,6 @@ pub(crate) struct LiveAgent {
|
||||
pub(crate) struct ListedAgent {
|
||||
pub(crate) agent_name: String,
|
||||
pub(crate) agent_status: AgentStatus,
|
||||
pub(crate) last_task_message: Option<String>,
|
||||
}
|
||||
|
||||
/// Control-plane handle for multi-agent operations.
|
||||
@@ -345,7 +344,6 @@ impl AgentControl {
|
||||
agents.push(ListedAgent {
|
||||
agent_name: root_path.to_string(),
|
||||
agent_status: root_thread.agent_status().await,
|
||||
last_task_message: None,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -371,7 +369,6 @@ impl AgentControl {
|
||||
agents.push(ListedAgent {
|
||||
agent_name,
|
||||
agent_status: thread.agent_status().await,
|
||||
last_task_message: None,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -435,13 +435,9 @@ fn list_agents_output_schema() -> Value {
|
||||
"agent_status": {
|
||||
"description": "Last known status of the agent.",
|
||||
"allOf": [agent_status_output_schema()]
|
||||
},
|
||||
"last_task_message": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Most recent user or inter-agent instruction received by the agent, when available."
|
||||
}
|
||||
},
|
||||
"required": ["agent_name", "agent_status", "last_task_message"],
|
||||
"required": ["agent_name", "agent_status"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"description": "Live agents visible in the current root thread tree."
|
||||
|
||||
@@ -393,7 +393,7 @@ fn list_agents_tool_includes_path_prefix_and_agent_fields() {
|
||||
);
|
||||
assert_eq!(
|
||||
output_schema.expect("list_agents output schema")["properties"]["agents"]["items"]["required"],
|
||||
json!(["agent_name", "agent_status", "last_task_message"])
|
||||
json!(["agent_name", "agent_status"])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,6 @@ struct ListAgentsResult {
|
||||
struct ListedAgentResult {
|
||||
agent_name: String,
|
||||
agent_status: serde_json::Value,
|
||||
last_task_message: serde_json::Value,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
@@ -1592,7 +1591,6 @@ async fn multi_agent_v2_list_agents_returns_completed_status() {
|
||||
.find(|agent| agent.agent_name == "/root/worker")
|
||||
.expect("worker agent should be listed");
|
||||
assert_eq!(worker.agent_status, json!({"completed": "done"}));
|
||||
assert_eq!(worker.last_task_message, serde_json::Value::Null);
|
||||
assert_eq!(success, Some(true));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user