astrid-runtime/astrid · error
headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE
Error message
headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE
What it means
`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.
Source
Thrown at crates/astrid-cli/src/commands/run.rs:46
#[arg(long = "print-session")]
pub print_session: bool,
/// Output format: `pretty` (default), `json`, or `stream-json`.
#[arg(long, default_value = "pretty")]
pub format: String,
/// Seconds to wait for the next active-run message. Overrides the
/// client configuration; it is not a whole-request deadline.
#[arg(
long = "idle-timeout-secs",
value_name = "SECONDS",
value_parser = clap::value_parser!(u64).range(1..=astrid_config::MAX_RUN_IDLE_TIMEOUT_SECS)
)]
pub idle_timeout_secs: Option<u64>,
}
/// Top-level entry point for `astrid run`.
pub(crate) async fn run(args: RunArgs) -> Result<ExitCode> {
if args.auto_approve {
anyhow::bail!(headless::AUTO_APPROVE_UNSUPPORTED_MESSAGE);
}
let format = match args.format.as_str() {
"json" | "stream-json" => OutputFormat::Json,
_ => OutputFormat::Pretty,
};
let client_path = if args.idle_timeout_secs.is_none() {
astrid_config::client::production_client_config_path()
.context("failed to resolve client configuration")?
} else {
None
};
let idle_timeout_secs =
resolve_idle_timeout_secs(args.idle_timeout_secs, client_path.as_deref())
.context("failed to resolve client idle timeout")?;
let idle_timeout = headless::idle_timeout(idle_timeout_secs)?;
let code = headless::run_headless_with_timeout(View on GitHub (pinned to affd8760f4)
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
Example fix
// before astrid run --auto-approve --format json // after astrid run --format json
Defensive patterns
Strategy: validation
Validate before calling
if args.contains("--auto-approve") {
return Err("--auto-approve is unsupported in headless mode; use --format json instead".into());
} Prevention
- 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
When it happens
Trigger: Invoking `astrid run --auto-approve` (any headless run attempt with automatic approval requested).
Common situations: CI pipelines copied from interactive workflows, scripts written before the flag was disabled, users expecting a yolo-mode like other agent CLIs.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- --grant-capsules is not supported for .shuttle installs yet
- headless approval automation is unsupported: approvals canno
- required value is missing for {capsule_id}.{key} (use --var
- required value is missing for {capsule_id}.{key} (use --var
- group '{group_name}' has no capsules
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/a1e72c493f73f6bf.
Report an issue: GitHub.