fixbug: fix todo_description

This commit is contained in:
莘权 马 2024-01-10 19:51:38 +08:00
parent 12ac57af4c
commit 0788080e20

View file

@ -504,7 +504,13 @@ class Role(SerializationMixin, is_polymorphic_base=True):
@property
def todo(self) -> str:
"""AgentStore uses this attribute to display to the user what actions the current role should take."""
"""
AgentStore uses this attribute to display to the user what actions the current role should take.
"""
if self.rc.todo:
if self.rc.todo.desc:
return self.rc.todo.desc
return any_to_name(self.rc.todo)
if self.actions:
return any_to_name(self.actions[0])
return ""