mirror of
https://github.com/openai/codex.git
synced 2026-05-03 19:06:58 +00:00
feat: make interrupt state not final for multi-agents (#13850)
Make `interrupted` an agent state and make it not final. As a result, a `wait` won't return on an interrupted agent and no notification will be send to the parent agent. The rationals are: * If a user interrupt a sub-agent for any reason, you don't want the parent agent to instantaneously ask the sub-agent to restart * If a parent agent interrupt a sub-agent, no need to add a noisy notification in the parent agen
This commit is contained in:
@@ -1260,6 +1260,7 @@ fn format_collab_status(status: &AgentStatus) -> String {
|
||||
match status {
|
||||
AgentStatus::PendingInit => "pending init".to_string(),
|
||||
AgentStatus::Running => "running".to_string(),
|
||||
AgentStatus::Interrupted => "interrupted".to_string(),
|
||||
AgentStatus::Completed(Some(message)) => {
|
||||
let preview = truncate_preview(message.trim(), 120);
|
||||
if preview.is_empty() {
|
||||
@@ -1289,6 +1290,7 @@ fn style_for_agent_status(
|
||||
match status {
|
||||
AgentStatus::PendingInit | AgentStatus::Shutdown => processor.dimmed,
|
||||
AgentStatus::Running => processor.cyan,
|
||||
AgentStatus::Interrupted => processor.yellow,
|
||||
AgentStatus::Completed(_) => processor.green,
|
||||
AgentStatus::Errored(_) | AgentStatus::NotFound => processor.red,
|
||||
}
|
||||
|
||||
@@ -815,6 +815,10 @@ impl From<CoreAgentStatus> for CollabAgentState {
|
||||
status: CollabAgentStatus::Running,
|
||||
message: None,
|
||||
},
|
||||
CoreAgentStatus::Interrupted => Self {
|
||||
status: CollabAgentStatus::Interrupted,
|
||||
message: None,
|
||||
},
|
||||
CoreAgentStatus::Completed(message) => Self {
|
||||
status: CollabAgentStatus::Completed,
|
||||
message,
|
||||
|
||||
@@ -228,6 +228,7 @@ pub enum CollabTool {
|
||||
pub enum CollabAgentStatus {
|
||||
PendingInit,
|
||||
Running,
|
||||
Interrupted,
|
||||
Completed,
|
||||
Errored,
|
||||
Shutdown,
|
||||
|
||||
Reference in New Issue
Block a user