Skip to content

fix: route background memory review by destination - #24846

Open
nicha16 wants to merge 1 commit into
NousResearch:mainfrom
nicha16:hermes-pr-memory-review-routing-20260513
Open

fix: route background memory review by destination#24846
nicha16 wants to merge 1 commit into
NousResearch:mainfrom
nicha16:hermes-pr-memory-review-routing-20260513

Conversation

@nicha16

@nicha16 nicha16 commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make background memory review destination-first
  • Route stable user facts, assistant/environment facts, reusable procedures, and session-only task history to the right stores
  • Update prompt tests for the narrower memory admission behavior

Test plan

  • python -m pytest tests/run_agent/test_background_review.py tests/run_agent/test_review_prompt_class_first.py -q -o 'addopts='

@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/memory Memory tool and memory providers P3 Low — cosmetic, nice to have labels May 13, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused memory-routing change. The underlying issue remains on current main: agent/background_review.py:160-168 and agent/background_review.py:276-281 still use broad admission wording, while tools/memory_tool.py:1076-1086 already defines the narrower USER.md/MEMORY.md/skip contract.

Problems

  • The prompt definitions were moved from run_agent.py to agent/background_review.py by d35ee7bc; run_agent.py:1576-1582 now only re-exports them. The current PR is therefore dirty against main and its implementation hunk cannot be applied at the original location.

Suggested changes

  • Transplant the prompt and test intent to agent/background_review.py, keeping the routing language aligned with tools/memory_tool.py:1076-1086.

Automated hermes-sweeper review.

Comment thread run_agent.py
@@ -3986,14 +3986,24 @@ def _cleanup_task_resources(self, task_id: str) -> None:
# ------------------------------------------------------------------

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current main moved these prompt definitions to agent/background_review.py in d35ee7bc; run_agent.py:1576-1582 now only re-exports them. Please salvage this hunk at the active source location so the routing change reaches the prompt used by the background-review thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/memory Memory tool and memory providers type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants