Skip to content

fix(agent): skip external memory providers in background review agent - #21511

Closed
DanielMaly wants to merge 0 commit into
NousResearch:mainfrom
DanielMaly:fix/background-review-honcho-leak
Closed

fix(agent): skip external memory providers in background review agent#21511
DanielMaly wants to merge 0 commit into
NousResearch:mainfrom
DanielMaly:fix/background-review-honcho-leak

Conversation

@DanielMaly

Copy link
Copy Markdown

What

Prevents the background self-improvement review agent from writing to external memory providers (Honcho, etc.).

Why

_spawn_background_review() creates a forked AIAgent with skip_memory=False (default). This causes external memory providers to initialize and write the review prompt as a user message, polluting peer representations with agent-internal system instructions (e.g. skill management preferences).

This is the same class of bug as #4052, which fixed the cron path but missed the background review path.

Changes

  • run_agent.py: Pass skip_memory=True to the review agent constructor. The review agent only needs built-in memory and skills tools — external providers are unnecessary and harmful.
  • plugins/memory/honcho/__init__.py: Add "background_review" and "subagent" to the cron guard check as defense-in-depth, matching the supermemory plugin's existing behavior.

Testing

  • All existing test_background_review* tests pass (3/3)
  • Verified the Honcho plugin guard now covers background_review and subagent contexts

Closes #21510

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels May 7, 2026
@DanielMaly
DanielMaly force-pushed the fix/background-review-honcho-leak branch 2 times, most recently from 6e8901f to d6007b4 Compare May 9, 2026 19:42
@DanielMaly
DanielMaly force-pushed the fix/background-review-honcho-leak branch from d6007b4 to bbc9964 Compare May 10, 2026 19:00
@DanielMaly DanielMaly closed this May 11, 2026
@DanielMaly
DanielMaly force-pushed the fix/background-review-honcho-leak branch from bbc9964 to 3b122cc Compare May 11, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(honcho): background review agent writes system prompts as user messages, corrupting peer representations

2 participants