zeroclaw-labs/zeroclaw · error · anyhow::Error
cli-secret-empty
cli-secret-empty
Error message
Value cannot be empty.
What it means
After collecting the hidden value in secret_prompt, an empty or whitespace-only result is rejected unless the specific call site passed allow_empty (only done where an empty secret is a meaningful choice). This is the last-chance check that a required secret was actually entered (i18n key 'cli-secret-empty').
Source
Thrown at src/main.rs:164
#[cfg(feature = "agent-runtime")]
fn secret_prompt(prompt_text: &str, allow_empty: bool) -> Result<String> {
use std::io::IsTerminal;
if !std::io::stdin().is_terminal() || !std::io::stderr().is_terminal() {
bail!(ta(
"cli-secret-needs-tty",
&[],
"Secret input requires a terminal on stdin and stderr."
));
}
let value = cli_input::SecretInput::new()
.with_prompt(prompt_text)
.interact()?;
if allow_empty || !value.trim().is_empty() {
Ok(value)
} else {
bail!(ta("cli-secret-empty", &[], "Value cannot be empty."))
}
}
#[cfg(feature = "agent-runtime")]
fn qta(key: &str, args: &[(&str, &str)]) -> String {
zeroclaw_runtime::i18n::get_required_cli_string_with_args(key, args)
}
#[cfg(feature = "agent-runtime")]
fn quickstart_row(key: &str, glyph: &str, summary: &str) -> String {
qta(key, &[("glyph", glyph), ("summary", summary)])
}
#[cfg(feature = "agent-runtime")]
fn quickstart_step_label(step: zeroclaw_runtime::quickstart::QuickstartStep) -> String {
t(step.label_key(), step.label())
}
View on GitHub (pinned to 88bb9c8533)
Solutions
- Re-run the command and enter a non-empty value at the prompt (leading/trailing whitespace alone does not count).
- Verify the paste actually landed by checking the prompt's mask/feedback before submitting.
- If you legitimately need no secret for that flow, use the flow's documented skip/unset option instead of submitting empty input.
Defensive patterns
Strategy: validation
Try / catch
match secret_prompt("API key:", false) {
Err(e) if e.to_string().contains("cannot be empty") => {
// re-prompt the user; a required secret was submitted blank
}
other => other,
} Prevention
- Confirm the paste landed (the prompt shows mask feedback once input is non-empty) before pressing Enter.
- Trim-check secrets in onboarding docs so users do not submit whitespace-only values.
- For optional secrets, use the flow's documented skip/unset option rather than empty input.
When it happens
Trigger: Pressing Enter at a secret prompt without typing anything, or a paste that put only whitespace into the buffer, on a prompt created with allow_empty=false.
Common situations: Users skipping a prompt to 'see what happens'; clipboard paste failing silently; terminal input quirks swallowing the pasted value so the user submits empty.
Related errors
- cli-secret-needs-tty
- Invalid skill name: {name}
- webhook-audit: {e}
- unsupported room visibility '{other}': expected private or p
- channel '{}' does not support forge API requests
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/e12c93ef20e43eb4.
Report an issue: GitHub.