Skip to content

armgit / kwant

Public Imported from GitHub
0

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.

Routing: multi-role work says so even when the lead is one of the roles

Lin (kwant bot)b8e9b981078a
diff --git a/src/router/team.rs b/src/router/team.rs
index 19bba348..b6f03e4d 100644
--- a/src/router/team.rs
+++ b/src/router/team.rs
@@ -455,9 +455,6 @@ pub fn pick_member<'a>(
}
}
}
- if matched.iter().any(|m| m.id == lead.id) {
- return Some(Pick { kwant: lead, basis: "keywords", reason: format!("{} ({}) matched words in your message and leads here", lead.name, lead.title), terms });
- }
return Some(to_lead(matched, terms));
}
let (k, _, terms) = best[0];
diff --git a/tests/router_test.rs b/tests/router_test.rs
index 515e470c..4c455a96 100644
--- a/tests/router_test.rs
+++ b/tests/router_test.rs
@@ -479,6 +479,13 @@ fn code_requests_go_to_the_matching_role_and_the_rest_to_the_lead() {
assert!(reason.contains("Pixel (Frontend Engineer)") && reason.ends_with("Ada (Tech Lead), to answer or hand parts on"), "{reason}");
assert!(terms.contains(&"endpoint".to_string()) && terms.contains(&"page".to_string()), "{terms:?}");
+ // Also when the lead is one of the roles
+ let mut led_by_backend = team.clone();
+ led_by_backend.lead_kwant_id = "be".into();
+ let (id, reason, basis, _) = direct(kwnt::router::heuristic_team_decision("Add an API endpoint and a settings page that shows it", &led_by_backend, &members));
+ assert_eq!((id.as_str(), basis.as_str()), ("be", "several"), "{reason}");
+ assert!(reason.ends_with("so it went to the team lead, Lin (Backend Engineer (Go)), to answer or hand parts on"), "{reason}");
+
// Discussion words still start a discussion, but whole words only and not "strategy"
assert!(matches!(
kwnt::router::heuristic_team_decision("Should we migrate to Postgres? Compare the tradeoffs", &team, &members),