diff --git a/hive-ag3nt/src/mcp.rs b/hive-ag3nt/src/mcp.rs index 83bd1c44..4426e0f1 100644 --- a/hive-ag3nt/src/mcp.rs +++ b/hive-ag3nt/src/mcp.rs @@ -503,18 +503,20 @@ pub struct BashRunArgs { /// `timed_out` when the limit is exceeded. #[serde(default)] pub timeout_secs: Option, - /// Optional inline wait: if set, `bash_run` polls for up to - /// `wait_seconds` (capped at 30) before returning. When the task - /// finishes within the window the full status is returned immediately - /// — no separate `bash_status` call needed. When the timeout expires - /// before the command finishes, the task keeps running in the - /// background and the usual `task started: id=` response is - /// returned. Useful for fast commands (< 5 s) that would otherwise - /// force an unnecessary round-trip. - #[serde(default)] + /// Optional inline wait: `bash_run` polls for up to `wait_seconds` + /// (capped at 30) before returning. When the task finishes within the + /// window the full status is returned immediately and no wake is fired; + /// when the timeout expires the task keeps running and the normal + /// `task started: id=` response is returned. Defaults to 3s. Pass + /// `0` to disable and always get the immediate response. + #[serde(default = "default_bash_run_wait")] pub wait_seconds: Option, } +fn default_bash_run_wait() -> Option { + Some(3) +} + /// MCP tool args for `bash_status`. #[derive(Debug, serde::Deserialize, schemars::JsonSchema)] pub struct BashStatusArgs { @@ -961,11 +963,12 @@ impl AgentServer { do NOT wait inline. When the command finishes, the harness fires a wake with \ `from: \"bash-task-\"` and the exit code + last stdout lines in the body; \ handle it on a future turn. Use `bash_status` to poll the task status within \ - the same turn if needed. `timeout_secs` defaults to 180. \ - Pass `wait_seconds` (capped at 30) to wait inline for fast commands: when the \ - task finishes within the window the full status is returned immediately and no \ - wake is fired; when the timeout expires the task keeps running and the normal \ - `task started: id=` response is returned." + the same turn if needed. `timeout_secs` defaults to 180. Pass `wait_seconds` \ + (capped at 30) to wait inline for fast commands: when the task finishes within \ + the window the full status is returned immediately and no wake is fired; when \ + the timeout expires the task keeps running and the normal `task started: id=` \ + response is returned. `wait_seconds` defaults to 3; pass `wait_seconds: 0` to \ + disable inline waiting and always get the immediate response." )] async fn bash_run(&self, Parameters(args): Parameters) -> String { let log = format!("{args:?}");