Skip to content

Commit 38622d7

Browse files
authored
fix(delegate): adds envs to delegate task subcommand (#3094)
1 parent 5f9107d commit 38622d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/chat-cli/src/cli/chat/tools/delegate.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,17 @@ pub async fn spawn_agent_process(os: &Os, agent: &str, task: &str) -> Result<Age
326326

327327
// Run Q chat with specific agent in background, non-interactive
328328
let mut cmd = tokio::process::Command::new("q");
329-
cmd.args(["chat", "--agent", agent, task]);
329+
cmd.args(["chat", "--non-interactive"]);
330+
if agent == DEFAULT_AGENT_NAME {
331+
cmd.arg("--trust-all-tools");
332+
}
333+
cmd.args(["--agent", agent, task]);
330334

331335
// Redirect to capture output (runs silently)
332336
cmd.stdout(std::process::Stdio::piped());
333337
cmd.stderr(std::process::Stdio::piped());
334338
cmd.stdin(std::process::Stdio::null()); // No user input
339+
cmd.envs(std::env::vars());
335340

336341
#[cfg(not(windows))]
337342
cmd.process_group(0);

0 commit comments

Comments
 (0)