pub(crate) async fn run_agent_with_bin(
bin: &str,
agent_ref: AgentRef,
task: AgentTask,
tx: UnboundedSender<AgentEvent>,
) -> Result<AgentRunHandle, AgentError>Expand description
Internal entry point — same as run_agent but takes the claude
binary path explicitly. Lets tests inject a known-nonexistent
path to exercise the spawn-failure path without touching env vars
(Rust 1.81+ flags std::env::set_var as unsound under concurrent
test execution). The public run_agent is a thin shim that
resolves the binary from $AGENTMUX_CLAUDE_BIN or the default.