tinyhumansai/openhuman · error · anyhow::Error

missing `cards` for op=replace

Error message

missing `cards` for op=replace

What it means

The todo tool was called with op=replace but no `cards` array was supplied. Replace semantics overwrite the whole board, so the full card list is mandatory for that op; the guard fires during argument parsing before the board store is written.

Solutions

  1. Pass `cards` as the complete array of card objects when using op=replace
  2. Prefer op=add/edit/update_status for partial board changes
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/agent/tools/todo.rs:156 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/9ad79b00ba779ccc. Report an issue: GitHub.

Appendix: source

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

                let id = required_string(&args, "id")?;
                let mut patch = patch_from_args(&args)?;
                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,

View on GitHub (pinned to 7491200858)