mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-30 14:56:01 +00:00
Non-priority slash commands (e.g. /new, /help, /dream-log) arriving while a session has an active LLM turn were silently queued into the pending injection buffer and later injected as raw user messages into the LLM conversation. This caused the model to respond to "/new" as plain text instead of executing the command. Root cause: the run() loop only checked priority commands (/stop, /restart, /status) before routing messages to the pending queue. All other command tiers (exact, prefix) bypassed command dispatch entirely. Changes: - Add CommandRouter.is_dispatchable_command() to match exact/prefix tiers, mirroring the existing is_priority() pattern. - In run(), intercept dispatchable commands before pending queue insertion and dispatch them directly via _dispatch_command_inline(). - Extract _cancel_active_tasks() from cmd_stop for reuse; cmd_new now cancels active tasks before clearing the session to prevent shared mutable state corruption from concurrent asyncio coroutines. - Update /new semantics: stops active task first, then clears session. - Update documentation in help text, docs, and Discord command list.
1.4 KiB
1.4 KiB
In-Chat Commands
These commands work inside chat channels and interactive agent sessions:
| Command | Description |
|---|---|
/new |
Stop current task and start a new conversation |
/stop |
Stop the current task |
/restart |
Restart the bot |
/status |
Show bot status |
/dream |
Run Dream memory consolidation now |
/dream-log |
Show the latest Dream memory change |
/dream-log <sha> |
Show a specific Dream memory change |
/dream-restore |
List recent Dream memory versions |
/dream-restore <sha> |
Restore memory to the state before a specific change |
/help |
Show available in-chat commands |
Periodic Tasks
The gateway wakes up every 30 minutes and checks HEARTBEAT.md in your workspace (~/.nanobot/workspace/HEARTBEAT.md). If the file has tasks, the agent executes them and delivers results to your most recently active chat channel.
Setup: edit ~/.nanobot/workspace/HEARTBEAT.md (created automatically by nanobot onboard):
## Periodic Tasks
- [ ] Check weather forecast and send a summary
- [ ] Scan inbox for urgent emails
The agent can also manage this file itself — ask it to "add a periodic task" and it will update HEARTBEAT.md for you.
Note: The gateway must be running (
nanobot gateway) and you must have chatted with the bot at least once so it knows which channel to deliver to.