Skip to content

Commit 31b1d8a

Browse files
committed
Fix Sequential and Parallel
1 parent 17fa527 commit 31b1d8a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

coagent/agents/parallel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async def started(self) -> None:
100100
@handler(deferred=True)
101101
async def handle(self, msg: GenericMessage, ctx: Context) -> None:
102102
if len(self._agent_types) == 0:
103-
self.replier.raise_exc(msg, RuntimeError("No agent types provided."))
103+
await self.replier.raise_exc(msg, RuntimeError("No agent types provided."))
104104
return
105105

106106
# Let the aggregator agent reply to the sending agent, if asked.
@@ -113,7 +113,8 @@ async def handle(self, msg: GenericMessage, ctx: Context) -> None:
113113
status = AggregationStatus.decode(result)
114114
if status.busy:
115115
# The aggregator agent is busy.
116-
raise RuntimeError("Parallel agent is busy.")
116+
await self.replier.raise_exc(msg, RuntimeError("Parallel agent is busy."))
117+
return
117118

118119
for agent_type in self._agent_types:
119120
addr = Address(name=agent_type, id=self.address.id)

coagent/agents/sequential.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async def started(self) -> None:
3030
@handler(deferred=True)
3131
async def handle(self, msg: GenericMessage, ctx: Context) -> None:
3232
if len(self._agent_types) == 0:
33-
self.replier.raise_exc(msg, RuntimeError("No agent types provided."))
33+
await self.replier.raise_exc(msg, RuntimeError("No agent types provided."))
3434
return
3535

3636
# Let the last agent reply to the sending agent, if asked.

0 commit comments

Comments
 (0)