A programming framework for agentic AI
Decrement the count of outstanding tasks before returning in the event of an exception. (#406)
Enhao Zhang62e5e5b88d1a
diff --git a/python/src/agnext/application/_single_threaded_agent_runtime.py b/python/src/agnext/application/_single_threaded_agent_runtime.pyindex 833e29d1d..4170a8735 100644--- a/python/src/agnext/application/_single_threaded_agent_runtime.py+++ b/python/src/agnext/application/_single_threaded_agent_runtime.py@@ -272,6 +272,7 @@ class SingleThreadedAgentRuntime(AgentRuntime):)except BaseException as e:message_envelope.future.set_exception(e)+ self._outstanding_tasks.decrement()returnself._message_queue.append(@@ -327,6 +328,7 @@ class SingleThreadedAgentRuntime(AgentRuntime):except BaseException as e:# Ignore cancelled errors from logsif isinstance(e, CancelledError):+ self._outstanding_tasks.decrement()returnlogger.error("Error processing publish message", exc_info=True)finally: