mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 06:17:41 +00:00
fix(mcp): expose delegate tool via MCP bridge (#1247)
The BridgeToolNames allowlist omitted "delegate", so claude-cli / Claude-Code-backed agents never received the tool even when their orchestration mode resolved to "delegate" with active agent_links. The native agent loop injects delegate per orchestration mode, but bridge sessions only see this curated allowlist, making inter-agent delegation impossible from bridge-backed agents. delegate is safe to expose unconditionally: it self-gates via CanDelegate/agent_links and resolves its source agent from the X-Agent-ID header context, exactly like team_tasks (already bridged).
This commit is contained in:
1 parent
e154c4f54d
commit
719d5934bb
1 file changed
+4
@@ -17,6 +17,8 @@ import (
|
||||
|
||||
// BridgeToolNames is the subset of GoClaw tools exposed via the MCP bridge.
|
||||
// Excluded: spawn (agent loop), create_forum_topic (channels).
|
||||
// delegate is included: it self-gates via CanDelegate/agent_links and resolves
|
||||
// its source agent from the X-Agent-ID header context, same as team_tasks.
|
||||
var BridgeToolNames = map[string]bool{
|
||||
// Filesystem
|
||||
"read_file": true,
|
||||
@@ -48,6 +50,8 @@ var BridgeToolNames = map[string]bool{
|
||||
"sessions_send": true,
|
||||
// Team tools (context from X-Agent-ID/X-Channel/X-Chat-ID headers)
|
||||
"team_tasks": true,
|
||||
// Inter-agent delegation (self-gates via CanDelegate / agent_links)
|
||||
"delegate": true,
|
||||
}
|
||||
|
||||
// NewBridgeServer creates a StreamableHTTPServer that exposes GoClaw tools as MCP tools.
|
||||
|
||||
Reference in new issue
Block a user