fix: prevent delegated sub-agent messages from polluting supervisor m…#1037
fix: prevent delegated sub-agent messages from polluting supervisor m…#1037
Conversation
🦋 Changeset detectedLatest commit: 9a259c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This comment has been minimized.
This comment has been minimized.
📝 WalkthroughWalkthroughIntroduces metadata tagging for delegated sub-agent messages containing subAgentId, subAgentName, and parentAgentId. Updates memory manager to filter delegated messages from supervisor conversation context during reads while preserving them with metadata for observability. Changes
Sequence DiagramsequenceDiagram
participant Supervisor as Supervisor Agent
participant SubAgent as Sub-Agent
participant MemMgr as Memory Manager
participant Store as Message Store
Supervisor->>SubAgent: delegate_task (with delegationContext)
SubAgent->>MemMgr: writeMessage (delegated task)
MemMgr->>MemMgr: applyOperationMetadata<br/>(add subAgentId, parentAgentId)
MemMgr->>Store: save message with metadata
SubAgent->>Store: process & respond
SubAgent->>MemMgr: writeMessage (sub-agent response)
MemMgr->>Store: save with delegation metadata
Supervisor->>MemMgr: getMessages (supervisor context)
MemMgr->>Store: retrieve all messages
MemMgr->>MemMgr: filterDelegatedSubAgentMessages<br/>(remove delegated records)
MemMgr->>Supervisor: return filtered context<br/>(only supervisor messages)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying voltagent with
|
| Latest commit: |
9a259c6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5f6cdf1a.voltagent.pages.dev |
| Branch Preview URL: | https://fix-subagent-memory-filter.voltagent.pages.dev |
…emory context
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
What is the new behavior?
fixes (issue)
Notes for reviewers
Summary by cubic
Prevents delegated sub-agent messages from showing up in the supervisor’s memory, keeping parent prompts clean while preserving sub-agent records for debugging. Fixes Linear #1026.
Written for commit 9a259c6. Summary will update on new commits.
Summary by CodeRabbit
Release Notes
New Features
Documentation