Description
The current expertise scoring logic uses simple substring matching (kw in context_lower). This results in false positives: for example, the keyword "law" will match inside the word "flaw", triggering a legal expert for a design critique.
Reproduction Steps
- Create an agent with "law" in their expertise keywords.
- Input a message like "There is a minor flaw in this code."
- Observe the expertise score for the legal agent increasing incorrectly.
Expected Behavior
Expertise keywords should only match on full words using regex word boundaries (\b). "law" should only match if the standalone word "law" appears in the context.
Priority
High 🔴
Context
Crucial for the accuracy of 'dynamic' session orchestration. Should be implemented in rooms/session.py using re.search(rf"\b{re.escape(kw)}\b", ...)
Description
The current expertise scoring logic uses simple substring matching (
kw in context_lower). This results in false positives: for example, the keyword "law" will match inside the word "flaw", triggering a legal expert for a design critique.Reproduction Steps
Expected Behavior
Expertise keywords should only match on full words using regex word boundaries (\b). "law" should only match if the standalone word "law" appears in the context.
Priority
High 🔴
Context
Crucial for the accuracy of 'dynamic' session orchestration. Should be implemented in rooms/session.py using
re.search(rf"\b{re.escape(kw)}\b", ...)