mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-06 17:38:35 +00:00
Dream jobs don't create git commits if there were no changes
fixes #4872
This commit is contained in:
parent
7675364eae
commit
0a1c98c142
@ -1537,6 +1537,13 @@ def _run_gateway(
|
|||||||
if productive:
|
if productive:
|
||||||
store.set_last_dream_cursor(last_cursor)
|
store.set_last_dream_cursor(last_cursor)
|
||||||
logger.info("Dream cron job completed, cursor advanced to {}", last_cursor)
|
logger.info("Dream cron job completed, cursor advanced to {}", last_cursor)
|
||||||
|
if store.git.is_initialized():
|
||||||
|
msg = build_dream_commit_message(
|
||||||
|
"dream: periodic memory consolidation", diff_body,
|
||||||
|
)
|
||||||
|
sha = store.git.auto_commit(msg)
|
||||||
|
if sha:
|
||||||
|
logger.info("Dream commit: {}", sha)
|
||||||
elif MemoryStore.dream_run_completed(resp):
|
elif MemoryStore.dream_run_completed(resp):
|
||||||
logger.info(
|
logger.info(
|
||||||
"Dream cron job completed with no memory changes; "
|
"Dream cron job completed with no memory changes; "
|
||||||
@ -1557,13 +1564,6 @@ def _run_gateway(
|
|||||||
source="dream",
|
source="dream",
|
||||||
timezone_name=config.agents.defaults.timezone,
|
timezone_name=config.agents.defaults.timezone,
|
||||||
)
|
)
|
||||||
if store.git.is_initialized():
|
|
||||||
msg = build_dream_commit_message(
|
|
||||||
"dream: periodic memory consolidation", diff_body,
|
|
||||||
)
|
|
||||||
sha = store.git.auto_commit(msg)
|
|
||||||
if sha:
|
|
||||||
logger.info("Dream commit: {}", sha)
|
|
||||||
store.compact_history()
|
store.compact_history()
|
||||||
prune_dream_sessions(agent.sessions.sessions_dir)
|
prune_dream_sessions(agent.sessions.sessions_dir)
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user