fix(memory): progress past completed no-op batches

This commit is contained in:
shixi-li
2026-07-27 02:00:41 +08:00
committed by Xubin Ren
parent b55b76d755
commit 15e42059bd
4 changed files with 98 additions and 33 deletions
+8 -9
View File
@@ -437,17 +437,16 @@ async def cmd_dream(ctx: CommandContext) -> OutboundMessage:
on_progress=_silent,
)
elapsed = time.monotonic() - t0
# Ground truth: the real file delta, not the LLM's self-report.
# The real file delta grounds the audit record; clean completion
# decides whether this history batch has finished processing.
diff_body = store.dream_content_diff()
productive = bool(diff_body) or (
not store.git.is_initialized()
and MemoryStore.dream_run_completed(resp)
)
if productive:
completed = MemoryStore.dream_run_completed(resp)
if completed:
store.set_last_dream_cursor(last_cursor)
content = f"Dream completed in {elapsed:.1f}s."
elif MemoryStore.dream_run_completed(resp):
content = f"Dream completed in {elapsed:.1f}s; no memory changes."
if diff_body:
content = f"Dream completed in {elapsed:.1f}s."
else:
content = f"Dream completed in {elapsed:.1f}s; no memory changes."
else:
content = (
f"Dream did not complete after {elapsed:.1f}s; "