agent_profile/launch/unix.rs
1// Copyright (c) 2026 Costas Kirgoussios
2//
3// This software is licensed under the PolyForm Noncommercial License 1.0.0.
4// You may obtain a copy of the License at:
5// https://polyformproject.org/licenses/noncommercial/1.0.0/
6
7//! Unix launcher: process replacement (spec ยง23.1).
8
9use std::os::unix::process::CommandExt;
10
11use super::{LaunchOutcome, LaunchPlan};
12use crate::error::{Error, Result};
13
14/// Replaces this process with the agent. Returns only when `exec` fails.
15pub(super) fn launch(plan: &LaunchPlan) -> Result<LaunchOutcome> {
16 let source = plan.command().exec();
17 Err(Error::Launch { executable: plan.executable.clone(), source })
18}