tinyhumansai/openhuman · error · anyhow::Error

invalid `cards

Error message

invalid `cards`: {e}

What it means

The `cards` array supplied to the todo tool's op=replace failed to deserialize into card objects — the wrapped error names the exact serde mismatch (wrong field type, unknown structure). Fires after the presence check but before any write, so the board is unchanged.

Solutions

  1. Match each card object to the todo card schema (string ids, valid status values)
  2. Check the serde error text for the offending field and value
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/agent/tools/todo.rs:158 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/60929e4d5d509d14. Report an issue: GitHub.

Appendix: source

Thrown at src/openhuman/agent/tools/todo.rs:158

                patch.content = optional_string(&args, "content");
                ops::edit(&location, &id, patch).await
            }
            "update_status" => {
                let id = required_string(&args, "id")?;
                let status = required_string(&args, "status")?;
                let status = ops::parse_status(&status).map_err(anyhow::Error::msg)?;
                ops::update_status(&location, &id, status).await
            }
            "remove" => {
                let id = required_string(&args, "id")?;
                ops::remove(&location, &id).await
            }
            "replace" => {
                let cards = args
                    .get("cards")
                    .ok_or_else(|| anyhow::anyhow!("missing `cards` for op=replace"))?;
                let cards: Vec<TaskBoardCard> = serde_json::from_value(cards.clone())
                    .map_err(|e| anyhow::anyhow!("invalid `cards`: {e}"))?;
                ops::replace(&location, cards).await
            }
            "clear" => ops::clear(&location).await,
            "list" => ops::list(&location).await,
            other => {
                return Ok(ToolResult::error(format!(
                "unknown op '{other}' (expected add|edit|update_status|remove|replace|clear|list)"
            )))
            }
        };

        match result {
            Ok(snap) => {
                let payload = json!({
                    "threadId": snap.thread_id,
                    "cards": snap.cards,
                    "markdown": snap.markdown,
                });

View on GitHub (pinned to 7491200858)