fix(tg): route /compact and /evaluator-prompt to the command router

The Telegram channel forwards slash commands through an allowlist regex
that must mirror the builtin command router. /compact and
/evaluator-prompt were missing from it, and messages starting with '/'
never reach the generic text handler, so both commands were silently
dropped: pressing /compact did nothing at all.

Add both commands to the allowlist, register /compact in the Telegram
command menu, and pin the router/regex pairing in the existing regex
test.
This commit is contained in:
Naster17 authored and chengyongru committed 2026-09-10 11:44:17 +08:00
1 parent dfed706bc0
commit 6a8647cfb6
2 files changed
+9 -1

No files matched your search

@@ -2491,6 +2491,11 @@ def test_telegram_bus_slash_command_regex_matches_agent_loop_commands() -> None:
assert pat.fullmatch("/new@nanobot_bot")
assert pat.fullmatch("/goal@nanobot_bot refine objective")
assert pat.fullmatch("/trigger@nanobot_bot CI summary")
assert pat.fullmatch("/compact")
assert pat.fullmatch("/compact@nanobot_bot")
assert pat.fullmatch("/evaluator-prompt")
assert pat.fullmatch("/evaluator-prompt init")
assert not pat.fullmatch("/unknown-command")
assert pat.fullmatch("/dream-log deadbeef") is None
assert pat.fullmatch("/dream-restore deadbeef") is None
assert pat.fullmatch("/dream-prompt init") is None