Repository: openai/codex
File: codex-rs/core/src/tools/spec.rs (Rust)

Code before:
            properties,
            required: Some(vec!["message".to_string()]),
            additional_properties: Some(false.into()),
        },
    })
}

fn create_send_input_tool() -> ToolSpec {
    let mut properties = BTreeMap::new();
    properties.insert(
        "id".to_string(),
        JsonSchema::String {
            description: Some("Identifier of the agent to message.".to_string()),
        },
    );
    properties.insert(
        "message".to_string(),
        JsonSchema::String {
            description: Some("Message to send to the agent.".to_string()),
        },
    );
    properties.insert(
        "interrupt".to_string(),
        JsonSchema::Boolean {
            description: Some(
                "When true, interrupt the agent's current task before sending the message. Defaults to false."
                    .to_string(),
            ),
        },
    );

    ToolSpec::Function(ResponsesApiTool {
        name: "send_input".to_string(),
        description: "Send a message to an existing agent.".to_string(),
        strict: false,
        parameters: JsonSchema::Object {
            properties,
            required: Some(vec!["id".to_string(), "message".to_string()]),
            additional_properties: Some(false.into()),
        },
    })
}

fn create_wait_tool() -> ToolSpec {
    let mut properties = BTreeMap::new();
    properties.insert(
        "id".to_string(),
        JsonSchema::String {
            description: Some("Identifier of the agent to wait on.".to_string()),
        },
    );

Review comment (suggestion):
Would be good to clarify the false behaviour. If the agent is already doing something, is the message sent after the current task? 

Also if people are likely to use this arg directly from Rust it would be nice to replicate the doc directly as a comment on `SendInputArgs`.

Code after:
            properties,
            required: Some(vec!["message".to_string()]),
            additional_properties: Some(false.into()),
        },
    })
}

fn create_send_input_tool() -> ToolSpec {
    let mut properties = BTreeMap::new();
    properties.insert(
        "id".to_string(),
        JsonSchema::String {
            description: Some("Identifier of the agent to message.".to_string()),
        },
    );
    properties.insert(
        "message".to_string(),
        JsonSchema::String {
            description: Some("Message to send to the agent.".to_string()),
        },
    );
    properties.insert(
        "interrupt".to_string(),
        JsonSchema::Boolean {
            description: Some(
                "When true, interrupt the agent's current task before sending the message. When false (default), the message will be processed when the agent is done on its current task."
                    .to_string(),
            ),
        },
    );

    ToolSpec::Function(ResponsesApiTool {
        name: "send_input".to_string(),
        description: "Send a message to an existing agent.".to_string(),
        strict: false,
        parameters: JsonSchema::Object {
            properties,
            required: Some(vec!["id".to_string(), "message".to_string()]),
            additional_properties: Some(false.into()),
        },
    })
}

fn create_wait_tool() -> ToolSpec {
    let mut properties = BTreeMap::new();
    properties.insert(
        "id".to_string(),
        JsonSchema::String {
            description: Some("Identifier of the agent to wait on.".to_string()),
        },
    );