fix(core): initialize titleGenerator in __setDefaultMemory#1235
fix(core): initialize titleGenerator in __setDefaultMemory#1235kagura-agent wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAgent.__setDefaultMemory now also updates MemoryManager's conversation title generator when a default Memory is applied; a new MemoryManager.setTitleGenerator method was added and a Changeset entry recorded. Changes
Sequence Diagram(s)sequenceDiagram
participant VoltAgent
participant Agent
participant MemoryManager
participant Memory
VoltAgent->>Agent: __setDefaultMemory(memory: Memory)
Agent->>Agent: createConversationTitleGenerator(memory)
Agent->>MemoryManager: setTitleGenerator(titleGenerator)
Agent->>MemoryManager: setMemory(memory)
MemoryManager-->>Agent: updated state (conversationMemory + titleGenerator)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…#1232) When Memory is passed globally to VoltAgent, __setDefaultMemory updates conversationMemory but not titleGenerator. This causes generateTitle to silently fail (returning 'Conversation' for all threads). Add setTitleGenerator to MemoryManager and call it from __setDefaultMemory so that the title generator is initialized regardless of whether memory is passed globally or per-agent.
4df8fae to
02b7c4a
Compare
🦋 Changeset detectedLatest commit: 02b7c4a 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 |
Summary
Closes #1232
When
Memoryis passed globally toVoltAgent(via thememoryoption),__setDefaultMemoryupdatesconversationMemorybut does not initializetitleGenerator. This causesgenerateTitleto silently fail — all conversations receive the fallback title"Conversation".Changes
MemoryManager: AddedsetTitleGenerator()method to allow updating the title generator after construction.Agent.__setDefaultMemory(): After callingsetMemory(), now also callscreateConversationTitleGenerator()and passes the result tosetTitleGenerator(), ensuring title generation works regardless of whether memory is passed globally or per-agent.Testing
memory-manager.spec.tstests pass.setMemoryonly setconversationMemory, leavingtitleGeneratorasundefined.Summary by CodeRabbit
Summary by cubic
Initialize the conversation title generator when memory is set via
VoltAgent.__setDefaultMemory, fixing #1232. Titles now generate correctly when memory is provided globally or per-agent, instead of the "Conversation" fallback.setTitleGenerator()toMemoryManager.Agent.__setDefaultMemory()now sets the title generator withcreateConversationTitleGenerator(memory)aftersetMemory().Written for commit 02b7c4a. Summary will update on new commits.