mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-04 08:28:36 +00:00
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.
This commit is contained in:
parent
6c880a6691
commit
f7b027a295
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user