Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.
Rust ai-agentsai-assistantai-botautomationbotbots-teamchatbotclaude-duetgrokgrok-botgrok-bot-alternativeharnessllmmulti-agentopenai-dotsopenbotpersonal-agentrustself-hostedselfhosted-ai
A handle the person linked isn't an unknown teammate (M1-2)
Lin (kwant bot)f31064c4a971
diff --git a/src/router/mod.rs b/src/router/mod.rsindex c6acca04..ddae0a35 100644--- a/src/router/mod.rs+++ b/src/router/mod.rs@@ -9,7 +9,7 @@ pub mod team;pub use depends::handoff_dependencies;pub use fallback::heuristic_fallback;pub use laya::LayaRouter;-pub use tags::{handoff_mentions, handoff_targets, only_credited, HandoffMentions, parse_mentions, parse_mentions_with_lookup, TagMention};+pub use tags::{handoff_mentions, handoff_targets, links_handle, only_credited, HandoffMentions, parse_mentions, parse_mentions_with_lookup, TagMention};pub use team::{heuristic_pick_kwant, heuristic_team_decision, matched_terms, parse_laya_kwant_choice,parse_laya_team_answers, ChannelRoute, TeamDecision,diff --git a/src/router/tags.rs b/src/router/tags.rsindex 4660792b..2d9b0211 100644--- a/src/router/tags.rs+++ b/src/router/tags.rs@@ -104,6 +104,19 @@ fn in_link(chars: &[char], at: usize) -> bool {close.is_some_and(|c| chars[c] == ']' && chars.get(c + 1) == Some(&'('))}+/// Whether `text` links the account `@name` (`https://www.tiktok.com/@munichspots/…`,+/// `[@munichspots](…)`, see [`in_link`]). A reply that then names it as plain `@munichspots` means+/// that account, not a teammate.+pub fn links_handle(text: &str, name: &str) -> bool {+ let chars: Vec<char> = text.to_lowercase().chars().collect();+ let tag: Vec<char> = format!("@{}", name.to_lowercase()).chars().collect();+ (0..chars.len()).any(|at| {+ chars[at..].starts_with(&tag)+ && in_link(&chars, at)+ && !chars.get(at + tag.len()).is_some_and(|&c| c.is_ascii_alphanumeric() || c == '_' || c == '-')+ })+}+fn is_team_mention(token: &str) -> bool {if token.contains('-') {return true;@@ -408,6 +421,17 @@ mod tests {assert_eq!(handoff_targets("[@Analyst] and/or @Community", &names), vec![1, 0]);}+ /// QA on 0.6.4 (M1-2): a reply named the account the person linked as plain "@munichspots".+ #[test]+ fn a_linked_account_is_found_by_its_handle() {+ let link = "Like https://www.tiktok.com/@munichspots/video/7273068214848982304?";+ assert!(links_handle(link, "munichspots") && links_handle(link, "MunichSpots"));+ assert!(links_handle("by [@munichspots](https://www.tiktok.com/@munichspots)", "munichspots"));+ assert!(!links_handle(link, "munich") && !links_handle(link, "munichspots2"));+ // Plain mentions don't link an account+ assert!(!links_handle("Ask @munichspots, or @Analyst", "munichspots"));+ }+/// Oleks's screenshot (2026-10-24): "Handing off now: @Social revise …, @Writer draft Pillar 1 …"/// asks; "As @SEO found, …" only credits.#[test]diff --git a/src/server/routes.rs b/src/server/routes.rsindex ae8c8663..a4ef4dab 100644--- a/src/server/routes.rs+++ b/src/server/routes.rs@@ -1065,7 +1065,7 @@ async fn run_handoffs(scope: &TurnScope, already_spoken: &[String], replies: &[(let names: Vec<&str> = scope.teammates.iter().map(|k| k.name.as_str()).collect();let found = crate::router::handoff_mentions(text, &names);let deps = crate::router::handoff_dependencies(text, &names);- skipped.extend(found.unknown.into_iter().map(|n| (n, String::new())));+ skipped.extend(unknown_mentions(found.unknown, user_prompt, text));skipped.extend(found.in_code_block.iter().map(|&i| (scope.teammates[i].name.clone(), IN_CODE_BLOCK.to_string())));for &i in &found.targets {let k = &scope.teammates[i];@@ -1283,6 +1283,14 @@ async fn report_skipped(scope: &TurnScope, skipped: Vec<(String, String)>) {}}+/// `@name`s that match no teammate, for [`report_skipped`] (an empty reason), less the accounts the+/// person's message or the reply links: "I based this on @munichspots" after a TikTok link names+/// that account, it doesn't hand anything on (QA on 0.6.4, M1-2).+fn unknown_mentions(unknown: Vec<String>, user_prompt: &str, reply: &str) -> Vec<(String, String)> {+ let linked = |n: &str| crate::router::links_handle(user_prompt, n) || crate::router::links_handle(reply, n);+ unknown.into_iter().filter(|n| !linked(n)).map(|n| (n, String::new())).collect()+}+/// "Not sent to A, B: why" for refused mentions grouped by reason; `None` when there are none.pub fn refusal_line(groups: &[(String, Vec<String>)]) -> Option<String> {let parts: Vec<String> = groups.iter().map(|(why, names)| format!("{}: {why}", names.join(", "))).collect();@@ -1358,7 +1366,7 @@ pub(super) async fn delegate_mentions(.into_iter().map(|(d, p)| (scope.teammates[d].id.clone(), scope.teammates[p].id.clone())).collect();- let mut skipped: Vec<(String, String)> = found.unknown.into_iter().map(|n| (n, String::new())).collect();+ let mut skipped = unknown_mentions(found.unknown, user_prompt, text);skipped.extend(found.in_code_block.iter().map(|&i| (scope.teammates[i].name.clone(), IN_CODE_BLOCK.to_string())));// The lead hears a relayed result anyway, and a bot can't hand work to itselflet speaker = relay.map_or(lead.id.as_str(), |r| r.from.id.as_str());diff --git a/tests/delegation_test.rs b/tests/delegation_test.rsindex 7d2b4a1c..4d367e56 100644--- a/tests/delegation_test.rs+++ b/tests/delegation_test.rs@@ -1178,6 +1178,25 @@ async fn mentions_that_hand_nothing_on_are_said_in_the_channel() {assert!(!delegated_growth, "over the limit, Growth isn't asked");}+/// QA on 0.6.4 (M1-2): a reply that named the TikTok account the person linked as plain+/// "@munichspots" got "Not sent to munichspots: no teammate has that name here". Another unknown+/// name in the same reply is still said, for the lead's reply and for another bot's.+#[tokio::test]+async fn an_account_the_person_linked_is_not_said_as_an_unknown_teammate() {+ let env = setup().await;+ let channel = team_channel_with(&env, "tiktok-links", &[&env.lead, &env.specialist]).await;+ let link = "https://www.tiktok.com/@munichspots/video/7273068214848982304";+ for (n, bot) in [(1, &env.lead), (2, &env.specialist)] {+ let who = name(&env, bot).await;+ say_in(&env, &channel, &format!("@{who} A hook like {link} REPLYTAG:hook{n} MENTION:munichspots+Marketer")).await;+ wait_for("the unknown-name notice", || async { refusals(&channel_messages(&env, &channel).await).len() == n }).await;+ let replied = channel_messages(&env, &channel).await.iter().any(|m| m.sender_id == who && m.text.contains(&format!("answer hook{n} @munichspots")));+ assert!(replied, "{who} answered");+ }+ let notes = refusals(&channel_messages(&env, &channel).await);+ assert_eq!(notes, vec!["Not sent to Marketer: no teammate has that name here".to_string(); 2]);+}+/// Rigel's ping-pong (2026-10-21): two bots naming each other ran all 8 rounds of a request. One/// teammate is handed work by mention at most [`per_bot_limit`] times per user message; the next/// mention starts nothing and leaves one Continue notice.