fix(command): explain empty dream runs

This commit is contained in:
chengyongru
2026-06-17 00:47:59 +08:00
committed by Xubin Ren
parent dcb33cf919
commit dcf76117ab
2 changed files with 73 additions and 3 deletions
+19 -1
View File
@@ -326,7 +326,8 @@ async def cmd_dream(ctx: CommandContext) -> OutboundMessage:
if result is None:
await loop.bus.publish_outbound(OutboundMessage(
channel=msg.channel, chat_id=msg.chat_id,
content="Dream: nothing to process.",
content=_format_dream_no_input_message(),
metadata={"render_as": "text"},
))
return
prompt, last_cursor = result
@@ -374,6 +375,23 @@ async def cmd_dream(ctx: CommandContext) -> OutboundMessage:
)
def _format_dream_no_input_message() -> str:
return "\n".join([
"Dream has no conversation history to process yet.",
"",
"Dream reads new entries from `memory/history.jsonl` after the current Dream cursor.",
(
"Short chats only reach that file after token compaction or idle auto-compact, "
"so a fresh or short WebUI chat may leave Dream with no input."
),
"",
"Next steps:",
"- Enable `agents.defaults.idleCompactAfterMinutes` so completed chats become Dream input automatically.",
"- Compact the current chat into memory once that manual action is available.",
"- If you expected history to exist, check whether `memory/history.jsonl` has new entries after the Dream cursor.",
])
def _extract_changed_files(diff: str) -> list[str]:
"""Extract changed file paths from a unified diff."""
files: list[str] = []