[AI-133][AI-134] Add keyword command routing and help discovery hint#62
Conversation
Introduces a shared command-handler module with parseCommandKeyword so users can invoke help, ask, and search from the agent panel and channel threads without relying on slash commands. Exact "help" and prefixed "ask <args>"/"search <args>" are routed before the LLM; all other text (e.g. "help me understand X") falls through normally. Updates the assistant greeting to surface the help keyword as a discovery hint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extends parseCommandKeyword to recognise the "fiona " prefix so users can type "fiona help", "fiona ask <question>", or "fiona search <query>" in the agent panel or a thread without needing an @-mention or slash command. The prefix is stripped before applying the same disambiguation rules, so "fiona help me with X" still falls through to the LLM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move parseCommandKeyword check in message.js inside handleInteractionWithTelemetry so keyword commands (help, ask, search) go through rate limiting before responding. Rename args→rawArgs in parseCommandKeyword return with JSDoc sanitization warning to prevent silent user-input passthrough when ask/search are wired to the LLM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
95aa29a to
3a48efc
Compare
…ance, fix coming-soon wording Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…word map Eliminates duplicated if/else routing block from message.js and app_mention.js. Adding a new keyword now requires a single entry in NOT_YET_TEXT in command-handler.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds keyword-based command routing to the Fiona Slack assistant so that help, ask <…>, search <…>, and fiona <command> variants work in assistant threads and the agent panel (where slash commands aren’t available), and updates the assistant thread greeting to hint users to type help.
Changes:
- Introduces a shared
command-handler.jsmodule for parsing keyword commands and sending help/coming-soon responses viasay(). - Routes keyword commands inside the existing telemetry wrapper and after rate-limit checks for both assistant thread messages and
app_mentionevents. - Updates greeting/help messaging and adds/updates tests for keyword routing behavior and discovery hints.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/fiona-slack/src/listeners/commands/command-handler.js | New shared parsing + routing helpers and shared help/coming-soon text constants. |
| apps/fiona-slack/src/listeners/assistant/message.js | Adds keyword routing for assistant thread messages before LLM invocation (post rate-limit). |
| apps/fiona-slack/src/listeners/events/app_mention.js | Adds keyword routing for app mentions before LLM invocation (post rate-limit). |
| apps/fiona-slack/src/listeners/assistant/assistant_thread_started.js | Updates greeting to include a help discovery hint. |
| apps/fiona-slack/src/listeners/commands/fiona.js | Refactors to import shared text constants from the new command-handler module. |
| apps/fiona-slack/tests/listeners/commands/command-handler.test.js | New unit tests for keyword parsing/routing and message constants. |
| apps/fiona-slack/tests/listeners/assistant/message.test.js | Adds keyword routing tests, including rate-limit behavior expectations. |
| apps/fiona-slack/tests/listeners/events/app-mention.test.js | Adds keyword routing tests for mention flows. |
| apps/fiona-slack/tests/listeners/assistant/assistant-thread-started.test.js | Adds test asserting greeting includes a “type help” discovery hint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…cord telemetry command-handler.js: re-escape backticks inside the HELP_TEXT template literal. The previous commit replaced \` with unescaped ` which broke the JS parse and caused Biome lint failures. app_mention.js / message.js: remove markInteractionRecorded() from keyword-routing paths. Previously this suppressed handleInteractionWithTelemetry's finally-block recordInteraction() call, leaving help/ask/search commands with no telemetry. Letting the wrapper run its finally block records a standard success interaction. Tests: update keyword routing tests to reflect that callLLM is skipped and say is called. Telemetry-finally-block coverage lives in interaction-telemetry.test.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…key guard, fire-and-forget capture - Restore cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 to setup:emulator npm script - Add DEPLOYMENT_TYPE production guard to interaction-store.js and feedback-store.js getContainer, matching conversation-capture-store.js pattern - Change captureConversation from await to fire-and-forget (.catch) in app_mention.js and message.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NODE_TLS_REJECT_UNAUTHORIZED=0 was intentionally removed from this script in a prior PR. Developers set it inline when needed: $env:NODE_TLS_REJECT_UNAUTHORIZED=0; npm run setup:emulator Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Cosmos DB Emulator uses a self-signed certificate. NODE_TLS_REJECT_UNAUTHORIZED=0 must be set when running setup:emulator. Updates docs/testing-with-cosmos-emulator.md and apps/fiona-slack/README.md to show the correct inline env var pattern, consistent with how it was already documented in apps/usage-report-function/README.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| /fiona help Show this help message | ||
| /fiona ask <question> Ask a question about Ed-Fi (coming soon) | ||
| /fiona search <query> Search Ed-Fi documentation (coming soon) |
There was a problem hiding this comment.
Discussed with Steven A and deciding to remove the /fiona portion from the front to just leave a list of available commands here, then using the "How to reach Fiona" below to communicate how the user can call the commands.
…rip /fiona prefix from HELP_TEXT - Wrap captureConversation in await/try-catch in both app_mention.js and message.js for consistency and uniform error handling - Remove /fiona prefix from HELP_TEXT command list; bare keyword forms (help, ask <question>, search <query>) now shown, with slash-command usage explained in the How to reach Fiona section below - Update tests to assert on Available commands instead of /fiona help Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>




Summary
helpkeyword discovery hint, so users in the agent panel know how to access commandshelp,ask,search, and two-wordfiona <command>variants) as alternatives to slash commands, which are unavailable in threads and the Slack agent panelhandleInteractionWithTelemetry(afterhandleRateLimitedInteraction), matching the existingapp_mention.jspattern; renamesargs→rawArgsinparseCommandKeywordreturn with JSDoc sanitization warningChanges
command-handler.js(new) — shared module withparseCommandKeyword,handleHelpViaSay,handleComingSoonViaSay, and text constantsmessage.js— keyword routing moved inside telemetry wrapper, after rate-limit checkapp_mention.js— keyword routing added inside telemetry wrapper withmarkInteractionRecorded()assistant_thread_started.js— greeting updated withhelpkeyword hintfiona.js— imports text constants from shared moduleTest Plan
npm testinapps/fiona-slack)help" hinthelpin agent panel → help text appears (not ephemeral)fiona helpin agent panel → same help texthelp me understand X→ falls through to LLM normallyhelp→ receives rate-limit message, not help text/fiona helpin a channel → still works unchanged🤖 Generated with Claude Code