Skip to content

fix: classify greetings as chitchat in planner fallback - #255

Open
panshularora wants to merge 1 commit into
c2siorg:mainfrom
panshularora:fix/planner-chitchat-fallback
Open

panshularora wants to merge 1 commit into
c2siorg:mainfrom
panshularora:fix/planner-chitchat-fallback

Conversation

@panshularora

@panshularora panshularora commented Sep 4, 2026 •

Copy link
Copy Markdown

Description

When Hugging Face intent classification is unavailable, _keyword_fallback_intent() defaulted unmatched input to search. Greetings like hello and thanks then went through retrieval and came back as Found N articles... even though ResponderAgent already has chitchat replies.

The fallback now returns chitchat when every token is a greeting/thanks (punctuation stripped, so thanks! counts). A message that also has a topic, e.g. hello ransomware, still goes to search.

Related Issue

Fixes #254

Motivation and Context

classify_intent() already returns None without a working HUGGINGFACE_TOKEN. The keyword fallback is the path that actually runs in that case, and it never set intent: "chitchat".

How Has This Been Tested?

From api-service:

python -m pytest tests/test_planner.py tests/test_graph_routing.py tests/test_responder.py -q

30 passed.

Covers:

  • hello / thanks / thanks! / thank you / bye -> chitchat
  • hello ransomware and ransomware stay search
  • graph routing: fallback greeting skips the scraper and does not return Found ... articles

Screenshots (if appropriate):

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

When classify_intent() is unavailable, unmatched input defaulted to
search, so "hello" and "thanks" went through retrieval.

Detect short greetings/thanks first, keep topic queries on search.

Fixes c2siorg#254

Assisted-By: Grok
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.

[BUG] Chat planner fallback classifies greetings as search instead of chitchat

1 participant