storkit: merge 440_refactor_consolidate_is_permission_approval_into_chat_util

This commit is contained in:
dave
2026-03-28 19:44:00 +00:00
parent 2867e1d15f
commit 8cd881c8f1
4 changed files with 63 additions and 78 deletions
+1 -11
View File
@@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize};
use crate::agents::AgentPool;
use crate::chat::transport::matrix::{ConversationEntry, ConversationRole, RoomConversation};
use crate::chat::util::is_permission_approval;
use crate::slog;
use crate::chat::ChatTransport;
use crate::http::context::{PermissionDecision, PermissionForward};
@@ -86,17 +87,6 @@ pub struct SlackWebhookContext {
pub permission_timeout_secs: u64,
}
// ── Permission approval detection ──────────────────────────────────────
/// Returns `true` if the message body should be interpreted as permission approval.
fn is_permission_approval(body: &str) -> bool {
let trimmed = body.trim().to_ascii_lowercase();
matches!(
trimmed.as_str(),
"yes" | "y" | "approve" | "allow" | "ok"
)
}
// ── Incoming message dispatch ───────────────────────────────────────────
pub(super) async fn handle_incoming_message(