astrid-runtime/astrid · error

running daemon does not expose workspace selection…

Error message

running daemon does not expose workspace selection metadata; run `astrid restart`

What it means

validate_daemon_workspace_metadata parses the daemon's versioned readiness metadata, which must have the prefix `v1:` followed by a workspace fingerprint. If the metadata lacks that prefix, the running daemon predates the workspace-selection metadata feature and cannot be verified, so the CLI fails and asks you to restart the daemon.

Solutions

  1. Run `astrid restart` so the daemon is relaunched with the current CLI that emits `v1:` metadata
  2. Stop the stale daemon manually and start it again with the upgraded CLI
  3. Verify CLI and daemon versions match (`astrid --version` vs daemon build)
Defensive patterns

Strategy: try-catch

Validate before calling

// caller-side check before connecting
let metadata_ok = daemon_metadata.starts_with("v1:");
if !metadata_ok { println!("daemon too old; run astrid restart"); }

Try / catch

if let Err(e) = ensure_daemon_workspace_matches(&home, &expected).await {
    if e.to_string().contains("workspace selection metadata") {
        run_restart(&home).await?;
    } else { return Err(e); }
}

Prevention

When it happens

Trigger: Connecting to a daemon started by an older CLI version that emits no `v1:`-prefixed metadata string; metadata is empty or whitespace; ensure_daemon_workspace_matches inspects the readiness payload during connect.

Common situations: Upgrading the astrid CLI while an old daemon from a previous version is still running; long-lived daemon started before a CLI update.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


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

Appendix: source

Thrown at crates/astrid-cli/src/commands/daemon/workspace_fingerprint.rs:70

    let resolved_home = AstridHome::resolve().context("failed to resolve Astrid home")?;
    let mut fingerprints = Vec::new();
    for layout in layouts_for_workspace_root(&root, &resolved_home) {
        let fingerprint = checked_workspace_selection_fingerprint(&root, &layout)
            .context("selected workspace state path is unsafe")?;
        if !fingerprints.contains(&fingerprint) {
            fingerprints.push(fingerprint);
        }
    }
    Ok(fingerprints)
}

/// Validate the versioned readiness metadata emitted by the daemon.
pub(crate) fn validate_daemon_workspace_metadata(
    metadata: &str,
    expected: &[String],
) -> Result<()> {
    let Some(actual) = metadata.trim().strip_prefix("v1:") else {
        anyhow::bail!(
            "running daemon does not expose workspace selection metadata; run `astrid restart`"
        );
    };
    if !expected.iter().any(|fingerprint| fingerprint == actual) {
        anyhow::bail!(
            "running daemon belongs to another project or workspace layout; run `astrid restart` from this project"
        );
    }
    Ok(())
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn runtime_home_accepts_aos_fingerprint_for_default_cli_layout() {
        let home_root = tempfile::tempdir().expect("home root");

View on GitHub (pinned to affd8760f4)