mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-02 20:32:38 +02:00
Merge branch 'feature/inner_msg' into 'mgx_ops'
feat: Role自己的消息不经过env对象转发 See merge request pub/MetaGPT!88
This commit is contained in:
commit
eaa78d9db4
1 changed files with 3 additions and 0 deletions
|
|
@ -443,6 +443,9 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
|
|||
"""If the role belongs to env, then the role's messages will be broadcast to env"""
|
||||
if not msg:
|
||||
return
|
||||
if all(to in {any_to_str(self), self.name} for to in msg.send_to): # Message to myself
|
||||
self.put_message(msg)
|
||||
return
|
||||
if not self.rc.env:
|
||||
# If env does not exist, do not publish the message
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue