feat(gateway): deliver background review notifications to user chat#3293
Merged
Conversation
The background memory/skill review (_spawn_background_review) runs after the agent response when turn/iteration counters exceed their thresholds. It saves memories and skills, then prints a summary like '💾 Memory updated · User profile updated'. In CLI mode this goes to the terminal via _safe_print. In gateway mode, _safe_print routes to print() which goes to stdout — invisible to the user. Add a background_review_callback attribute to AIAgent. When set, the background review thread calls it with the summary string after saves complete. The gateway wires this to adapter.send() via the same run_coroutine_threadsafe bridge used by status_callback, delivering the notification to the user's chat.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…ousResearch#3293) The background memory/skill review (_spawn_background_review) runs after the agent response when turn/iteration counters exceed their thresholds. It saves memories and skills, then prints a summary like '💾 Memory updated · User profile updated'. In CLI mode this goes to the terminal via _safe_print. In gateway mode, _safe_print routes to print() which goes to stdout — invisible to the user. Add a background_review_callback attribute to AIAgent. When set, the background review thread calls it with the summary string after saves complete. The gateway wires this to adapter.send() via the same run_coroutine_threadsafe bridge used by status_callback, delivering the notification to the user's chat.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…ousResearch#3293) The background memory/skill review (_spawn_background_review) runs after the agent response when turn/iteration counters exceed their thresholds. It saves memories and skills, then prints a summary like '💾 Memory updated · User profile updated'. In CLI mode this goes to the terminal via _safe_print. In gateway mode, _safe_print routes to print() which goes to stdout — invisible to the user. Add a background_review_callback attribute to AIAgent. When set, the background review thread calls it with the summary string after saves complete. The gateway wires this to adapter.send() via the same run_coroutine_threadsafe bridge used by status_callback, delivering the notification to the user's chat.
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
…ousResearch#3293) The background memory/skill review (_spawn_background_review) runs after the agent response when turn/iteration counters exceed their thresholds. It saves memories and skills, then prints a summary like '💾 Memory updated · User profile updated'. In CLI mode this goes to the terminal via _safe_print. In gateway mode, _safe_print routes to print() which goes to stdout — invisible to the user. Add a background_review_callback attribute to AIAgent. When set, the background review thread calls it with the summary string after saves complete. The gateway wires this to adapter.send() via the same run_coroutine_threadsafe bridge used by status_callback, delivering the notification to the user's chat.
This was referenced May 22, 2026
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…ousResearch#3293) The background memory/skill review (_spawn_background_review) runs after the agent response when turn/iteration counters exceed their thresholds. It saves memories and skills, then prints a summary like '💾 Memory updated · User profile updated'. In CLI mode this goes to the terminal via _safe_print. In gateway mode, _safe_print routes to print() which goes to stdout — invisible to the user. Add a background_review_callback attribute to AIAgent. When set, the background review thread calls it with the summary string after saves complete. The gateway wires this to adapter.send() via the same run_coroutine_threadsafe bridge used by status_callback, delivering the notification to the user's chat.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…ousResearch#3293) The background memory/skill review (_spawn_background_review) runs after the agent response when turn/iteration counters exceed their thresholds. It saves memories and skills, then prints a summary like '💾 Memory updated · User profile updated'. In CLI mode this goes to the terminal via _safe_print. In gateway mode, _safe_print routes to print() which goes to stdout — invisible to the user. Add a background_review_callback attribute to AIAgent. When set, the background review thread calls it with the summary string after saves complete. The gateway wires this to adapter.send() via the same run_coroutine_threadsafe bridge used by status_callback, delivering the notification to the user's chat.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The background memory/skill review (
_spawn_background_review) fires after the agent response when turn/iteration counters exceed their thresholds (default: every 10 turns for memory, every 10 tool iterations for skills). It spawns a review agent that saves memories and skills, then prints a summary like💾 Memory updated · User profile updated.The problem: In CLI mode, the summary goes to the terminal via
_safe_print(). In gateway mode,_safe_printroutes toprint()which goes to the gateway process's stdout — completely invisible to the Telegram/Discord/etc. user. The saves still happen, but silently.Changes
run_agent.py:background_review_callbackattribute (defaultNone)gateway/run.py:_bg_review_sendclosure that bridges sync→async viarun_coroutine_threadsafe(same pattern as_status_callback_sync)background_review_callbackalongside the other per-message callbacksTests
Gateway + agent tests: 1670 passed, 21 skipped.