atuinsh/atuin · error

daemon sent an unspecified history tail event

Error message

daemon sent an unspecified history tail event

What it means

`TailHistoryReply::from_proto` requires every event to carry a concrete `TailEventProto` variant. When the gRPC oneof is `None` (unspecified/absent), there is no history event to decode, so the client bails. This indicates a malformed or empty event from the daemon.

Solutions

  1. Update client and daemon to matching versions and restart the daemon.
  2. Retry the tail command; if persistent, report a bug with daemon logs.
  3. Check for intermediaries (proxies) that might corrupt the gRPC stream.
Defensive patterns

Strategy: type-guard

Type guard

fn has_event(reply: &TailHistoryReply) -> bool {
    reply.event.is_some()
}

Try / catch

if reply.event.is_none() {
    eprintln!("skipping empty tail event (version skew?)");
    continue;
}
let ev = TailHistoryReply::from_proto(reply)?;

Prevention

When it happens

Trigger: Streaming `atuin history tail` and receiving a `TailHistoryReply` whose `event` field is unset (None).

Common situations: Daemon/client version skew (new daemon field the old client can't decode, collapsing the oneof to None); proxy truncating messages; daemon bug emitting empty replies.

Related errors


AI-assisted analysis of atuinsh/atuin@900007c480 (2026-09-19). Data as JSON: /api/errors/95a176b73c00d4c8. Report an issue: GitHub.

Appendix: source

Thrown at crates/atuin/src/command/client/history.rs:702

    #[serde(skip_serializing_if = "Option::is_none")]
    duration: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    success: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    finished_at: Option<String>,
}

#[cfg(feature = "daemon")]
impl TailEvent {
    fn from_proto(reply: TailHistoryReply) -> Result<Self> {
        let (kind, history) = match reply.event {
            Some(TailEventProto::Started(history)) => (TailKind::Started, history),
            Some(TailEventProto::Ended(history)) => (TailKind::Ended, history),
            Some(TailEventProto::Cancelled(history)) => (TailKind::Cancelled, history),
            Some(TailEventProto::Lagged(_)) => {
                bail!("daemon sent a lag notice as a history event")
            }
            None => bail!("daemon sent an unspecified history tail event"),
        };
        let timestamp = OffsetDateTime::from_unix_nanos_i64(history.timestamp);
        let author_kind = history.author_kind();

        Ok(Self {
            kind,
            history: History {
                id: history
                    .id
                    .ok_or_else(|| eyre::eyre!("daemon tail event is missing the history id"))?
                    .try_into()?,
                timestamp,
                duration: history.duration,
                exit: history.exit,
                command: history.command,
                cwd: history.cwd,
                session: history.session,
                #[allow(deprecated)]

View on GitHub (pinned to 900007c480)