Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

chore: Update commons.py (#3212)

Tao Sunde59078b6860
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index b1101cafe..b3a7ce14a 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -26,7 +26,7 @@ body:
attributes:
label: What version of camel are you using?
description: Run command `python3 -c 'print(__import__("camel").__version__)'` in your shell and paste the output here.
- placeholder: E.g., 0.2.76a11
+ placeholder: E.g., 0.2.76a12
validations:
required: true
diff --git a/camel/__init__.py b/camel/__init__.py
index f3ad5312d..61941e8b7 100644
--- a/camel/__init__.py
+++ b/camel/__init__.py
@@ -14,7 +14,7 @@
from camel.logger import disable_logging, enable_logging, set_log_level
-__version__ = '0.2.76a11'
+__version__ = '0.2.76a12'
__all__ = [
'__version__',
diff --git a/camel/utils/commons.py b/camel/utils/commons.py
index 20abffb22..63737243d 100644
--- a/camel/utils/commons.py
+++ b/camel/utils/commons.py
@@ -1015,6 +1015,19 @@ def with_timeout(timeout=None):
if effective_timeout is None:
return func(*args, **kwargs)
+ # If current thread has a running asyncio event loop, avoid
+ # switching threads to preserve asyncio context (e.g., for
+ # asyncio.create_task). Execute inline without enforcing a
+ # sync timeout to keep event loop semantics intact.
+ try:
+ asyncio.get_running_loop()
+ loop_running = True
+ except RuntimeError:
+ loop_running = False
+
+ if loop_running:
+ return func(*args, **kwargs)
+
# Container to hold the result of the function call
result_container = []
diff --git a/docs/conf.py b/docs/conf.py
index 4505cb7a1..120ceaa8c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -27,7 +27,7 @@ sys.path.insert(0, os.path.abspath('..'))
project = 'CAMEL'
copyright = '2024, CAMEL-AI.org'
author = 'CAMEL-AI.org'
-release = '0.2.76a11'
+release = '0.2.76a12'
html_favicon = (
'https://raw.githubusercontent.com/camel-ai/camel/master/misc/favicon.png'
diff --git a/pyproject.toml b/pyproject.toml
index 4d1d5f0bb..3c886cf30 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "camel-ai"
-version = "0.2.76a11"
+version = "0.2.76a12"
description = "Communicative Agents for AI Society Study"
authors = [{ name = "CAMEL-AI.org" }]
requires-python = ">=3.10,<3.13"
diff --git a/uv.lock b/uv.lock
index 09b852aa9..ba5d89d03 100644
--- a/uv.lock
+++ b/uv.lock
@@ -335,14 +335,14 @@ wheels = [
[[package]]
name = "asgiref"
-version = "3.9.2"
+version = "3.10.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "typing-extensions", marker = "python_full_version < '3.11'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/7f/bf/0f3ecda32f1cb3bf1dca480aca08a7a8a3bdc4bed2343a103f30731565c9/asgiref-3.9.2.tar.gz", hash = "sha256:a0249afacb66688ef258ffe503528360443e2b9a8d8c4581b6ebefa58c841ef1", size = 36894, upload-time = "2025-09-23T15:00:55.136Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/46/08/4dfec9b90758a59acc6be32ac82e98d1fbfc321cb5cfa410436dbacf821c/asgiref-3.10.0.tar.gz", hash = "sha256:d89f2d8cd8b56dada7d52fa7dc8075baa08fb836560710d38c292a7a3f78c04e", size = 37483, upload-time = "2025-10-05T09:15:06.557Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/c7/d1/69d02ce34caddb0a7ae088b84c356a625a93cd4ff57b2f97644c03fad905/asgiref-3.9.2-py3-none-any.whl", hash = "sha256:0b61526596219d70396548fc003635056856dba5d0d086f86476f10b33c75960", size = 23788, upload-time = "2025-09-23T15:00:53.627Z" },
+ { url = "https://files.pythonhosted.org/packages/17/9c/fc2331f538fbf7eedba64b2052e99ccf9ba9d6888e2f41441ee28847004b/asgiref-3.10.0-py3-none-any.whl", hash = "sha256:aef8a81283a34d0ab31630c9b7dfe70c812c95eba78171367ca8745e88124734", size = 24050, upload-time = "2025-10-05T09:15:05.11Z" },
]
[[package]]
@@ -629,7 +629,7 @@ wheels = [
[[package]]
name = "camel-ai"
-version = "0.2.76a11"
+version = "0.2.76a12"
source = { editable = "." }
dependencies = [
{ name = "colorama" },