mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Remove task messages from list_agents output (#33030)
## What changed - Return only each live agent's name and status from `list_agents`. - Stop tracking the most recent task message in agent metadata. GitOrigin-RevId: 91836fe8efad7ea6b7305f0b409081ec77419cfd
This commit is contained in:
1 parent
271136e00c
commit
64c0e2fa1b
6 files changed
+9
-157
No files matched your search
@@ -460,13 +460,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."
|
||||
|
||||
@@ -443,7 +443,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"])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -180,7 +180,6 @@ struct ListAgentsResult {
|
||||
struct ListedAgentResult {
|
||||
agent_name: String,
|
||||
agent_status: serde_json::Value,
|
||||
last_task_message: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
@@ -1546,7 +1545,7 @@ async fn multi_agent_v2_followup_task_rejects_root_target_from_child() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn multi_agent_v2_list_agents_returns_completed_status_without_encrypted_spawn_preview() {
|
||||
async fn multi_agent_v2_list_agents_returns_completed_status() {
|
||||
let (mut session, mut turn) = make_session_and_context().await;
|
||||
let manager = thread_manager();
|
||||
let root = manager
|
||||
@@ -1622,19 +1621,12 @@ async fn multi_agent_v2_list_agents_returns_completed_status_without_encrypted_s
|
||||
.map(|agent| agent.agent_name.as_str())
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(agent_names, vec!["/root", "/root/worker"]);
|
||||
let root_agent = result
|
||||
.agents
|
||||
.iter()
|
||||
.find(|agent| agent.agent_name == "/root")
|
||||
.expect("root agent should be listed");
|
||||
assert_eq!(root_agent.last_task_message.as_deref(), Some("Main thread"));
|
||||
let worker = result
|
||||
.agents
|
||||
.iter()
|
||||
.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, None);
|
||||
assert_eq!(success, Some(true));
|
||||
}
|
||||
|
||||
@@ -1720,7 +1712,6 @@ async fn multi_agent_v2_list_agents_filters_by_relative_path_prefix() {
|
||||
|
||||
assert_eq!(result.agents.len(), 1);
|
||||
assert_eq!(result.agents[0].agent_name, worker_path.as_str());
|
||||
assert_eq!(result.agents[0].last_task_message.as_deref(), Some("build"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -1781,10 +1772,6 @@ async fn multi_agent_v2_list_agents_omits_closed_agents() {
|
||||
|
||||
assert_eq!(result.agents.len(), 1);
|
||||
assert_eq!(result.agents[0].agent_name, "/root");
|
||||
assert_eq!(
|
||||
result.agents[0].last_task_message.as_deref(),
|
||||
Some("Main thread")
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -1856,10 +1843,6 @@ async fn multi_agent_v2_list_agents_keeps_interrupted_resident_agents() {
|
||||
|
||||
assert_eq!(result.agents.len(), 2);
|
||||
assert_eq!(result.agents[0].agent_name, "/root");
|
||||
assert_eq!(
|
||||
result.agents[0].last_task_message.as_deref(),
|
||||
Some("Main thread")
|
||||
);
|
||||
assert_eq!(result.agents[1].agent_name, agent_path.as_str());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user