Skip to content

Commit 94292b9

Browse files
committed
Merge branch 'main' into feature-github-actions-update
2 parents f821b95 + a609dab commit 94292b9

File tree

34 files changed

+361
-542
lines changed

34 files changed

+361
-542
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
id: version
1313
attributes:
1414
label: What version of eigent are you using?
15-
placeholder: E.g., 0.0.51
15+
placeholder: E.g., 0.0.52
1616
validations:
1717
required: true
1818

backend/app/service/chat_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ async def step_solve(options: Chat, request: Request, task_lock: TaskLock):
213213
workforce.stop()
214214
except Exception as e:
215215
logger.error(f"Error processing action {item.action}: {e}")
216-
raise e
216+
yield sse_json("error", {"message": str(e)})
217217
# Continue processing other items instead of breaking
218218

219219

@@ -239,6 +239,7 @@ def tree_sub_tasks(sub_tasks: list[Task], depth: int = 0):
239239
return []
240240
return (
241241
chain(sub_tasks)
242+
.filter(lambda x: x.content != "")
242243
.map(
243244
lambda x: {
244245
"id": x.id,

backend/app/service/task.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,9 @@ def create_task_lock(id: str) -> TaskLock:
281281
task_locks[id] = TaskLock(id=id, queue=asyncio.Queue(), human_input={})
282282

283283
# Start cleanup task if not running
284-
global _cleanup_task
285-
if _cleanup_task is None or _cleanup_task.done():
286-
_cleanup_task = asyncio.create_task(_periodic_cleanup())
284+
# global _cleanup_task
285+
# if _cleanup_task is None or _cleanup_task.done():
286+
# _cleanup_task = asyncio.create_task(_periodic_cleanup())
287287

288288
return task_locks[id]
289289

backend/app/utils/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ def search_agent(options: Chat):
706706
stealth=True,
707707
session_id=str(uuid.uuid4())[:8],
708708
default_start_url="about:blank",
709+
cdp_url=f"http://localhost:{env('browser_port', '9222')}",
709710
enabled_tools=[
710711
"browser_click",
711712
"browser_type",

backend/app/utils/toolkit/hybrid_browser_toolkit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from camel.toolkits.hybrid_browser_toolkit.ws_wrapper import \
1616
WebSocketBrowserWrapper as BaseWebSocketBrowserWrapper
1717
from app.component.command import bun, uv
18+
from app.component.environment import env
1819
from app.service.task import Agents
1920
from app.utils.listen.toolkit_listen import listen_toolkit
2021
from app.utils.toolkit.abstract_toolkit import AbstractToolkit
@@ -428,7 +429,7 @@ def clone_for_new_session(self,
428429
dom_content_loaded_timeout=self._dom_content_loaded_timeout,
429430
viewport_limit=self._viewport_limit,
430431
connect_over_cdp=self.config_loader.get_browser_config().connect_over_cdp,
431-
cdp_url=self.config_loader.get_browser_config().cdp_url,
432+
cdp_url=f"http://localhost:{env('browser_port', '9222')}",
432433
)
433434

434435
@classmethod

backend/app/utils/workforce.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def eigent_make_sub_tasks(self, task: Task):
8282

8383
self.reset()
8484
self._task = task
85+
self.set_channel(TaskChannel())
8586
self._state = WorkforceState.RUNNING
8687
task.state = TaskState.OPEN
8788
self._pending_tasks.append(task)
@@ -105,7 +106,6 @@ async def eigent_start(self, subtasks: list[Task]):
105106
"""start the workforce"""
106107
logger.debug(f"start the workforce {subtasks=}")
107108
self._pending_tasks.extendleft(reversed(subtasks))
108-
self.set_channel(TaskChannel())
109109
# Save initial snapshot
110110
self.save_snapshot("Initial task decomposition")
111111

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Add your description here"
55
readme = "README.md"
66
requires-python = "==3.10.16"
77
dependencies = [
8-
"camel-ai[eigent]>=0.2.75a5",
8+
"camel-ai[eigent]>=0.2.75a6",
99
"fastapi>=0.115.12",
1010
"fastapi-babel>=1.0.0",
1111
"uvicorn[standard]>=0.34.2",

backend/uv.lock

Lines changed: 4 additions & 449 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/core/workers.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Eigent is designed to be extensible. Beyond the pre-configured agents, you can significantly expand your workforce's capabilities by connecting to external tools via custom MCP Servers and creating specialized workers to use them.
2+
3+
This guide will walk you through how to integrate a new tool and build a custom worker step-by-step.
4+
5+
## Configuring a Custom MCP Server
6+
7+
The Model Context Protocol (MCP) is the framework that allows Eigent to connect to external tools and services like GitHub, Notion, or any other API. By adding a custom MCP server, you are essentially teaching your workforce a new skill.
8+
9+
- Step 1: Click the **Settings** gear icon → Select the **MCP and Tools** tab.
10+
- Step 2: Click the **+ Add MCP Server** button to open the configuration dialog.
11+
- Step 3: Provide the Server Configuration
12+
- **Paste the JSON configuration** for the server. This JSON file acts as a manifest, telling Eigent what the tool is, what functions it has, and how to call them. You can typically find this configuration file in the documentation of the third-party tool you wish to integrate.
13+
- **Add required credentials**. Many tools require authentication. For example, to connect to GitHub, you will need to generate a Personal Access Token from your GitHub account settings and paste it into the appropriate field.
14+
15+
<aside>
16+
17+
18+
📌 **Note on Security**
19+
20+
Always treat your API keys and access tokens like passwords. Eigent stores them securely, but you should ensure they are generated with the minimum required permissions for the tasks you want to perform.
21+
22+
</aside>
23+
24+
![add mcp servers.gif](/docs/images/add_mcp_servers.gif)
25+
26+
## Creating and Equipping a Custom Worker
27+
28+
Once you've configured a new MCP server, you need to create a worker that knows how to use it. A worker is your specialized agent, and you can equip it with any combination of tools.
29+
30+
- Step 1: On the **Canvas**, click the **+ Add Worker** button located in the bottom toolbar.
31+
- Step 2: Enter a clear Worker **Name** (e.g., "GitHub Specialist") and provide an optional **Description** of its duties (e.g., "Manages pull requests and repository issues").
32+
- Step 3: Equip your Worker with the new tool (most important!)
33+
- Click on the **Agent Tool** dropdown menu.
34+
- Select the custom MCP server you just configured (e.g., Github MCP). You can also add any other tools you want this worker to have.
35+
- Click **Save**.
36+
37+
![add worker.gif](/docs/images/add_worker.gif)
38+
39+
## What’s next?
40+
41+
That's it! You have successfully extended your AI workforce. You can now assign tasks that leverage your new integration.

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"/core/concepts",
6060
"/core/workforce",
6161
"/core/models",
62-
"/core/tools"
62+
"/core/tools",
63+
"workers"
6364
]
6465
},
6566
{

0 commit comments

Comments
 (0)