feat: Add slash command help system (#57) #62

Merged
shoko merged 18 commits from fix/issue-57 into main 2026-04-14 04:03:29 +02:00
Owner

Summary

  • Add slash command help system for the conversational interface
  • Implements /, /help, and /<tool-name> commands as described in issue #57

Changes

Backend

  • Added TOOL_REGISTRY with metadata for all available tools (Randebu built-in and AVE Cloud Skills)
  • Added format_tools_list(), format_tool_help(), and format_general_help() functions
  • Added _handle_slash_command() method to ConversationalAgent to intercept and handle slash commands

Frontend

  • Updated ChatInterface component to detect / prefix and show a help dropdown
  • Added keyboard navigation support (Arrow Up/Down, Tab, Enter, Escape)
  • Tools are filtered as user types after the /

Commands Supported

  • / - Shows list of all available tools
  • /help - Shows general help about Randebu
  • /backtest, /simulate, /strategy - Randebu built-in tool help
  • /search, /risk, /token, /price - AVE Cloud Skills help

Testing

  • Backend syntax verified
  • Frontend changes follow existing code patterns
## Summary - Add slash command help system for the conversational interface - Implements `/`, `/help`, and `/<tool-name>` commands as described in issue #57 ## Changes ### Backend - Added `TOOL_REGISTRY` with metadata for all available tools (Randebu built-in and AVE Cloud Skills) - Added `format_tools_list()`, `format_tool_help()`, and `format_general_help()` functions - Added `_handle_slash_command()` method to `ConversationalAgent` to intercept and handle slash commands ### Frontend - Updated `ChatInterface` component to detect `/` prefix and show a help dropdown - Added keyboard navigation support (Arrow Up/Down, Tab, Enter, Escape) - Tools are filtered as user types after the `/` ## Commands Supported - `/` - Shows list of all available tools - `/help` - Shows general help about Randebu - `/backtest`, `/simulate`, `/strategy` - Randebu built-in tool help - `/search`, `/risk`, `/token`, `/price` - AVE Cloud Skills help ## Testing - Backend syntax verified - Frontend changes follow existing code patterns
shoko added 1 commit 2026-04-13 15:05:48 +02:00
Implement slash command help system as described in issue #57:

- Add Tool Registry in backend with metadata for all available tools
- Add command parser for '/' prefix in ConversationalAgent
- Add slash command handling functions:
  - '/' shows list of all available tools
  - '/help' shows general help about Randebu
  - '/<tool-name>' shows detailed help for specific tool
- Update frontend ChatInterface to detect '/' and show formatted help dropdown
- Add keyboard navigation (Arrow keys, Tab, Enter, Escape) for slash menu
First-time contributor

are you not missed any tools we already implemented in the code? I think the issue is a bit outdated so please check our tools first

are you not missed any tools we already implemented in the code? I think the issue is a bit outdated so please check our tools first
shoko added 1 commit 2026-04-13 15:48:20 +02:00
shoko added 1 commit 2026-04-13 15:51:19 +02:00
shoko added 1 commit 2026-04-13 18:22:04 +02:00
- Reset conversational.py to pr-58 working AVE integration
- Added TOOL_REGISTRY with all available slash commands
- Added _handle_slash_command for skill activation
- Slash commands show brief acknowledgment when used alone
- Slash commands with args are passed to AI for handling
- Added dropdown menu in ChatInterface for skill discovery
- Menu positions above textarea
- Menu shows filtered tools as user types
shoko added 1 commit 2026-04-14 01:02:56 +02:00
- Added _get_strategy_response method to query bot's strategy_config from DB
- Shows formatted strategy with conditions, actions, and risk management
- Shows helpful message if no strategy is configured yet
shoko added 1 commit 2026-04-14 01:07:51 +02:00
- Added _execute_trending method that runs the trending CLI command
- Returns formatted list of trending tokens on BSC
- Shows error message if no tokens found or command fails
shoko added 1 commit 2026-04-14 01:23:09 +02:00
Commands now execute in two steps:
1. User sends /search -> acknowledge and wait for param
2. User sends 'pepe' -> auto-execute search with 'pepe'

Commands without params (/backtest, /simulate, /trending, /strategy) execute directly.

Pending commands tracked via self.pending_command state.
shoko added 1 commit 2026-04-14 01:32:16 +02:00
- Added _execute_backtest_direct() that extracts params from message or strategy config
- Added _execute_simulate_direct() that extracts params from message or strategy config
- Both commands now execute directly when called with /backtest or /simulate
- If token address is missing, asks user for the parameter
shoko added 1 commit 2026-04-14 01:34:11 +02:00
- Fixed missing message argument when calling direct execution methods
- Both /backtest and /simulate now work without arguments
shoko added 1 commit 2026-04-14 01:37:21 +02:00
- Added _get_token_info helper to fetch symbol and name
- Backtest result now shows: **PEPE** (Pepe) -
shoko added 1 commit 2026-04-14 01:56:00 +02:00
- Added _is_error_output helper to detect errors in CLI output
- API errors like 'API error 403' now show proper error message instead of 'No price data available'
- Updated all command execution methods to use the helper
shoko added 1 commit 2026-04-14 02:03:37 +02:00
The price API requires full contract addresses (0x...-bsc), but users typically provide symbols.
Now /price TRADOOR will search for the token and show price info from search results.
shoko added 1 commit 2026-04-14 02:12:49 +02:00
The price API requires full contract addresses (0x...-bsc format).
Improved error handling and formatting for price responses.
shoko added 1 commit 2026-04-14 02:19:50 +02:00
- Store recent search results in agent instance
- When price returns empty, suggest using /search tool
- Check if user input matches recent search results and use that address
shoko added 1 commit 2026-04-14 02:28:25 +02:00
- Display token name and symbol in risk analysis output
- Handle is_honeypot: -1 as 'Unknown (could not determine)'
- Show risk level (Low/Medium/High) with risk score
- Use risk_level field instead of status
shoko added 1 commit 2026-04-14 02:33:41 +02:00
Search API returns 'price_change_24h' not 'token_price_change_24h'. Now checks for both.
shoko added 1 commit 2026-04-14 02:37:52 +02:00
Was returning 'N/A' incorrectly when token_price_change_24h was missing.
Now properly checks: price_change_24h OR token_price_change_24h OR 'N/A'
shoko added 1 commit 2026-04-14 03:43:33 +02:00
There was duplicate code handling search_tokens in the AI tool calling section.
han approved these changes 2026-04-14 03:57:17 +02:00
han left a comment
First-time contributor

lgtm

lgtm
shoko merged commit 8acce849f4 into main 2026-04-14 04:03:29 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#62