Skip to content

fix(discord): greeting-prefixed messages misclassified as questions#2162

Merged
alekspetrov merged 1 commit intomainfrom
fix/discord-intent-detection
Mar 13, 2026
Merged

fix(discord): greeting-prefixed messages misclassified as questions#2162
alekspetrov merged 1 commit intomainfrom
fix/discord-intent-detection

Conversation

@alekspetrov
Copy link
Owner

Summary

  • Messages like "Hello! How is it going?" were treated as codebase questions (→ "Looking into that...") instead of greetings
  • Root cause: IsClearQuestion() fast path (matches ? suffix) fired before greeting detection in comms.Handler.detectIntent()
  • Added intent.StartsWithGreeting() — detects messages starting with greeting words (hi, hello, hey, good morning, etc.) up to 10 words
  • Greeting check now runs before the question fast path

Test plan

  • TestStartsWithGreeting — 17 cases covering single-word, multi-word, punctuation, non-greetings, edge cases
  • All existing intent + comms tests pass (no regressions)
  • Manual test: send @Pilot Hello! How is it going? in Discord → should get greeting response

Closes #2159, #2160, #2161

Messages like "Hello! How is it going?" were treated as codebase
questions because IsClearQuestion (ends with ?) fired before greeting
detection in comms.Handler.detectIntent(). Added StartsWithGreeting()
check before the question fast path so greeting-prefixed messages
get the greeting response instead of "Looking into that...".

Closes #2159, #2160, #2161
@alekspetrov alekspetrov merged commit 74eac9c into main Mar 13, 2026
4 checks passed
@alekspetrov alekspetrov deleted the fix/discord-intent-detection branch March 13, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(discord): wire Discord handler to comms.Handler for intent classification

1 participant