mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-28 18:36:22 +02:00
fixbug: recovered role can't observe new message
This commit is contained in:
parent
ab846f65e4
commit
8a9cd6a2e7
3 changed files with 14 additions and 3 deletions
|
|
@ -422,8 +422,8 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
|
|||
"""Prepare new messages for processing from the message buffer and other sources."""
|
||||
# Read unprocessed messages from the msg buffer.
|
||||
news = []
|
||||
if self.recovered:
|
||||
news = [self.latest_observed_msg] if self.latest_observed_msg else []
|
||||
if self.recovered and self.latest_observed_msg:
|
||||
news = self.rc.memory.find_news(observed=[self.latest_observed_msg], k=10)
|
||||
if not news:
|
||||
news = self.rc.msg_buffer.pop_all()
|
||||
# Store the read messages in your own memory to prevent duplicate processing.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue