feat(memory): add workspace Dream prompt override

This commit is contained in:
chengyongru
2026-07-03 00:41:51 +08:00
committed by Xubin Ren
parent 5af22042ec
commit f38fd7d5d3
22 changed files with 295 additions and 10 deletions
+11
View File
@@ -280,6 +280,7 @@ async def test_start_creates_separate_pools_with_proxy(monkeypatch) -> None:
assert any(cmd.command == "dream" for cmd in app.bot.commands)
assert any(cmd.command == "dream_log" for cmd in app.bot.commands)
assert any(cmd.command == "dream_restore" for cmd in app.bot.commands)
assert any(cmd.command == "dream_prompt" for cmd in app.bot.commands)
@pytest.mark.asyncio
@@ -1570,6 +1571,14 @@ async def test_forward_command_normalizes_telegram_safe_dream_aliases() -> None:
assert len(handled) == 1
assert handled[0]["content"] == "/dream-restore deadbeef"
handled.clear()
update = _make_telegram_update(text="/dream_prompt@nanobot_test init", reply_to_message=None)
await channel._forward_command(update, None)
assert len(handled) == 1
assert handled[0]["content"] == "/dream-prompt init"
def test_telegram_bus_slash_command_regex_matches_agent_loop_commands() -> None:
"""Bus-routed slash commands must match the Telegram handler regex (see builtin router)."""
@@ -1588,6 +1597,7 @@ def test_telegram_bus_slash_command_regex_matches_agent_loop_commands() -> None:
assert pat.fullmatch("/trigger@nanobot_bot CI summary")
assert pat.fullmatch("/dream-log deadbeef") is None
assert pat.fullmatch("/dream-restore deadbeef") is None
assert pat.fullmatch("/dream-prompt init") is None
@pytest.mark.asyncio
@@ -1608,6 +1618,7 @@ async def test_on_help_includes_restart_command() -> None:
assert "/skill" in help_text
assert "/dream" in help_text
assert "/dream-log" in help_text
assert "/dream-prompt" in help_text
assert "/goal" in help_text
assert "/trigger" in help_text
assert "/pairing" in help_text