tinyhumansai/openhuman · error · anyhow::Error

threadId is required

Error message

threadId is required

What it means

anyhow::ensure! argument guard in update_channel_thread: after trimming, the thread_id parameter is empty. The method POSTs channels/{channel}/threads/{thread_id} with a close/reopen action; an empty thread id would build a malformed backend route (…/threads/) and fail remotely, so the request is rejected client-side before any network call.

Solutions

  1. Pass the real thread id obtained from the channel's thread listing/creation response
  2. Trim-check caller inputs before invoking the helper
  3. Debug the caller if an id was expected — the value was empty or whitespace at source
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/api/rest.rs:1080 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/e9541d31b0810516. Report an issue: GitHub.

Appendix: source

Thrown at src/api/rest.rs:1080

            bearer_jwt,
            Method::POST,
            &format!("channels/{encoded}/threads"),
            Some(body),
        )
        .await
    }

    /// Updates an existing thread (e.g., closing or reopening it).
    pub async fn update_channel_thread(
        &self,
        channel: &str,
        bearer_jwt: &str,
        thread_id: &str,
        action: &str,
    ) -> Result<Value> {
        let channel = channel.trim().trim_matches('/');
        anyhow::ensure!(!channel.is_empty(), "channel is required");
        anyhow::ensure!(!thread_id.trim().is_empty(), "threadId is required");
        anyhow::ensure!(
            action == "close" || action == "reopen",
            "action must be 'close' or 'reopen'"
        );
        let encoded_channel = urlencoding::encode(channel);
        let encoded_thread = urlencoding::encode(thread_id.trim());
        let body = serde_json::json!({ "action": action });
        self.authed_json(
            bearer_jwt,
            Method::PATCH,
            &format!("channels/{encoded_channel}/threads/{encoded_thread}"),
            Some(body),
        )
        .await
    }

    /// Lists threads in a communication channel, optionally filtering by status.
    pub async fn list_channel_threads(

View on GitHub (pinned to 7491200858)