{"record":{"id":"a1e72c493f73f6bf","repo":"astrid-runtime/astrid","slug":"headless-auto-approve-unsupported-message","errorCode":null,"errorMessage":"headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE","messagePattern":"headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/run.rs","lineNumber":46,"sourceCode":"    #[arg(long = \"print-session\")]\n    pub print_session: bool,\n    /// Output format: `pretty` (default), `json`, or `stream-json`.\n    #[arg(long, default_value = \"pretty\")]\n    pub format: String,\n    /// Seconds to wait for the next active-run message. Overrides the\n    /// client configuration; it is not a whole-request deadline.\n    #[arg(\n        long = \"idle-timeout-secs\",\n        value_name = \"SECONDS\",\n        value_parser = clap::value_parser!(u64).range(1..=astrid_config::MAX_RUN_IDLE_TIMEOUT_SECS)\n    )]\n    pub idle_timeout_secs: Option<u64>,\n}\n\n/// Top-level entry point for `astrid run`.\npub(crate) async fn run(args: RunArgs) -> Result<ExitCode> {\n    if args.auto_approve {\n        anyhow::bail!(headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE);\n    }\n\n    let format = match args.format.as_str() {\n        \"json\" | \"stream-json\" => OutputFormat::Json,\n        _ => OutputFormat::Pretty,\n    };\n    let client_path = if args.idle_timeout_secs.is_none() {\n        astrid_config::client::production_client_config_path()\n            .context(\"failed to resolve client configuration\")?\n    } else {\n        None\n    };\n    let idle_timeout_secs =\n        resolve_idle_timeout_secs(args.idle_timeout_secs, client_path.as_deref())\n            .context(\"failed to resolve client idle timeout\")?;\n    let idle_timeout = headless::idle_timeout(idle_timeout_secs)?;\n\n    let code = headless::run_headless_with_timeout(","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/run.rs#L28-L64","documentation":"`astrid run` rejects `--auto-approve` because headless (non-interactive) execution does not support automatic tool approval; the reason is carried in `headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE` and surfaced verbatim via anyhow::bail!. The feature is intentionally unavailable, not broken.","triggerScenarios":"Invoking `astrid run --auto-approve` (any headless run attempt with automatic approval requested).","commonSituations":"CI pipelines copied from interactive workflows, scripts written before the flag was disabled, users expecting a yolo-mode like other agent CLIs.","solutions":["Remove the --auto-approve flag and run in interactive mode","Use the supported headless output modes (`--format json` or `stream-json`) and handle approvals externally","Check the message text from headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE for the officially supported alternative"],"exampleFix":"// before\nastrid run --auto-approve --format json\n// after\nastrid run --format json","handlingStrategy":"validation","validationCode":"if args.contains(\"--auto-approve\") {\n    return Err(\"--auto-approve is unsupported in headless mode; use --format json instead\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate flags on execution mode before constructing the CLI invocation","Keep CI wrappers in sync with current flag support","Prefer explicit approval flows for headless agent runs"],"tags":["cli","headless","unsupported-feature"],"backgroundTag":"unsupported-operation","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}