astrid-runtime/astrid · error

must be 1-64 ASCII characters

Error message

{name} must be 1-64 ASCII characters

What it means

Validation guard in validate_topic_segment, a shared helper guarding hook bus topics: the named segment (host, session, or event) was empty or longer than 64 ASCII characters, which would produce a malformed or oversized topic.

Solutions

  1. Shorten the segment to at most 64 ASCII characters
  2. Supply a non-empty value for the offending segment in the hook payload or CLI argument
  3. Check upstream hook configuration that generates host/session/event values
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-emit/src/lib.rs:99 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/8704dce99959ba7c. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-emit/src/lib.rs:99

    /// (`astrid-emit --topic sage.v1.hook.before_tool_call`).
    /// Mutually exclusive with the positional form; exactly one is
    /// required.
    #[arg(long = "topic", value_name = "TOPIC")]
    pub topic_flag: Option<String>,
}

/// Default wait for a policy hook that needs the broker to accept its frame.
/// Observation hooks pass `0` to make the transport fire-and-forget.
pub const DEFAULT_POLICY_TIMEOUT_MS: u64 = 1_000;

/// Validate a host/session/event segment before putting it in a bus topic.
///
/// These values originate in a host hook payload or command line. Keeping
/// the check at this boundary prevents a caller from smuggling additional
/// topic segments into the fixed hook route.
fn validate_topic_segment(name: &str, value: &str) -> Result<()> {
    if value.is_empty() || value.len() > 64 {
        anyhow::bail!("{name} must be 1-64 ASCII characters");
    }
    if !value
        .bytes()
        .all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'-'))
    {
        anyhow::bail!("{name} must contain only ASCII letters, digits, '_' or '-'");
    }
    Ok(())
}

/// Derive the host hook topic used by the thin `astrid hook` command.
///
/// Every host route carries the session as a topic segment. Codex and the
/// other host runners subscribe to their own `{host}.v1.hook.*.*` namespace;
/// the envelope itself remains the six-field [`build_envelope`] contract.
///
/// # Errors
/// Returns an error when any segment is empty, too long, or contains a topic

View on GitHub (pinned to affd8760f4)