tinyhumansai/openhuman · error · anyhow::Error
action must be 'close' or 'reopen'
Error message
action must be 'close' or 'reopen'
What it means
anyhow::ensure! argument guard in update_channel_thread: the action parameter is neither 'close' nor 'reopen' — the only two actions the backend thread-update route accepts. The guard fails fast client-side so an invalid action never reaches the wire as a 400 from the backend.
Source
Thrown at src/api/rest.rs:1081
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(
&self,View on GitHub (pinned to 7491200858)
Solutions
- Pass action as exactly "close" or "reopen"
- Check for typos/casing in the caller (e.g. "Close", "archive")
- Use the thread-listing UI flow that already emits the correct verbs
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/api/rest.rs:1081 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/f57ce429a91a6ddb.
Report an issue: GitHub.