From f7b027a2953cb80ca946914081431b97376291aa Mon Sep 17 00:00:00 2001 From: axelray-dev <110029405+axelray-dev@users.noreply.github.com> Date: Wed, 24 Jun 2026 02:52:55 +0800 Subject: [PATCH] fix: only advance dream cursor when behind latest (#4242) Address review: avoid overwriting cursor on every restart when Dream is disabled. Now only advances if current cursor is behind the latest position, so repeated restarts don't permanently skip entries. --- nanobot/cli/commands.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py index 13ef6f2a..ae288de2 100644 --- a/nanobot/cli/commands.py +++ b/nanobot/cli/commands.py @@ -1165,7 +1165,9 @@ def _run_gateway( console.print(f"[green]✓[/green] Dream: {dream_cfg.describe_schedule()}") else: console.print("[yellow]○[/yellow] Dream: disabled") - agent.context.memory.set_last_dream_cursor(agent.context.memory.get_latest_cursor()) + latest = agent.context.memory.get_latest_cursor() + if agent.context.memory.get_last_dream_cursor() < latest: + agent.context.memory.set_last_dream_cursor(latest) # Register Heartbeat system job (idempotent on restart) if hb_cfg.enabled: