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:
jif-oai
2026-03-16 16:39:40 +00:00
committed by GitHub
parent 18ad67549c
commit 3f266bcd68
29 changed files with 151 additions and 4 deletions

View File

@@ -4542,6 +4542,7 @@ pub enum CollabAgentToolCallStatus {
pub enum CollabAgentStatus {
PendingInit,
Running,
Interrupted,
Completed,
Errored,
Shutdown,
@@ -4567,6 +4568,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,
@@ -5886,6 +5891,17 @@ mod tests {
absolute_path("readable")
}
#[test]
fn collab_agent_state_maps_interrupted_status() {
assert_eq!(
CollabAgentState::from(CoreAgentStatus::Interrupted),
CollabAgentState {
status: CollabAgentStatus::Interrupted,
message: None,
}
);
}
#[test]
fn command_execution_request_approval_rejects_relative_additional_permission_paths() {
let err = serde_json::from_value::<CommandExecutionRequestApprovalParams>(json!({