Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions codex-rs/core/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2937,6 +2937,12 @@
"MultiAgentV2ConfigToml": {
"additionalProperties": false,
"properties": {
"completed_agent_unload_delay_secs": {
"description": "Unload idle terminal children after this delay. Omit to disable automatic unload.",
"format": "uint64",
"minimum": 0.0,
"type": "integer"
},
"default_wait_timeout_ms": {
"format": "int64",
"maximum": 3600000.0,
Expand Down
46 changes: 38 additions & 8 deletions codex-rs/core/src/agent/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,44 @@ impl LocalAgentControl {
context: AgentCommunicationContext,
start_options: TurnStartOptions,
) -> CodexResult<String> {
self.submit_inter_agent_communication(
agent_id,
state,
communication,
context,
start_options,
)
.await
if communication.trigger_turn {
return self
.submit_inter_agent_communication(
agent_id,
state,
communication,
context,
start_options,
)
.await;
}
let result = self
.submit_inter_agent_communication(
agent_id,
state,
communication.clone(),
context.clone(),
start_options.clone(),
)
.await;
// Eviction can remove a loaded recipient before its residency pin succeeds.
// Retry queue-only delivery once through the mailbox path, including results.
// ThreadNotFound precedes submission; accepted requests are never replayed.
if result
.as_ref()
.is_err_and(|err| matches!(err.details(), CodexErrorDetails::ThreadNotFound(_)))
{
self.submit_inter_agent_communication(
agent_id,
state,
communication,
context,
start_options,
)
.await
} else {
result
}
}

async fn submit_inter_agent_communication(
Expand Down
Loading
Loading