Skip to main content

run_direct_with_session

Function run_direct_with_session 

Source
pub async fn run_direct_with_session(
    agent: &str,
    model: Option<&str>,
    system_prompt: &str,
    message: &str,
    timeout: Duration,
    work_dir: &str,
    session: Option<SessionContinuation<'_>>,
) -> Result<DirectResult>
Expand description

Run an agent one-shot with an optional --session-id or --resume for conversation continuity.

For agents that support sessions (claude, kimi, minimax, grok), appends --session-id <uuid> when starting a new session, or --resume <uuid> when continuing one. Other agents ignore the parameter.