openclaw - 💡(How to fix) Fix Feature Request: 支持跨渠道 accountId 绑定 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#54853Fetched 2026-04-08 01:35:14
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Code Example

{
  "agents": {
    "list": [{
      "id": "becky-work-assistant",
      "feishuAccountId": "becky"
    }]
  }
}

---

Config invalid
Problem:
  - agents.list.5: Unrecognized key: "feishuAccountId"

---

{
  "agents": {
    "list": [{
      "id": "becky-work-assistant",
      "name": "Becky的小助手",
      "channelBindings": {
        "feishu": {
          "accountId": "becky"
        }
      }
    }]
  }
}
RAW_BUFFERClick to expand / collapse

问题描述

背景

当前 OpenClaw 支持多渠道(飞书、钉钉等)和多 Agent 架构,每个 Agent 可以绑定到特定的 bind_user。

问题

当 Agent 从钉钉渠道调用飞书工具时,无法指定使用哪个飞书账号(accountId),导致权限越界:

  • becky 的钉钉 Agent (becky-work-assistant) 可以操作 lester 的飞书文档
  • 原因:飞书工具使用默认应用(lester 的),而非 becky 的飞书应用

验证

尝试在 Agent 配置中添加 feishuAccountId 字段:

{
  "agents": {
    "list": [{
      "id": "becky-work-assistant",
      "feishuAccountId": "becky"
    }]
  }
}

结果:

Config invalid
Problem:
  - agents.list.5: Unrecognized key: "feishuAccountId"

期望行为

方案 A:Agent 级别绑定

在 Agent 配置中支持 channelBindings 字段:

{
  "agents": {
    "list": [{
      "id": "becky-work-assistant",
      "name": "Becky的小助手",
      "channelBindings": {
        "feishu": {
          "accountId": "becky"
        }
      }
    }]
  }
}

当该 Agent 调用飞书工具时,自动使用绑定的 accountId 对应的飞书应用凭证。


使用场景

场景 1:多用户隔离

Agent钉钉渠道飞书渠道飞书工具权限
dingtalk-lesterlester-lester 的文档
becky-work-assistantbecky-becky 的文档
feishu-becky-beckybecky 的文档

期望: becky 的钉钉 Agent 调用飞书工具时,使用 becky 的飞书应用。


影响

  • 安全性:防止跨用户权限越界
  • 多租户支持:支持真正的多用户隔离
  • 企业应用:支持企业级多用户场景

环境信息

  • OpenClaw 版本:2026.3.23-2
  • Node.js:v22.22.0
  • OS:Linux 5.15.0-170-generic (x64)

extent analysis

Fix Plan

To address the issue, we need to implement the channelBindings field in the Agent configuration. Here are the steps:

  1. Update the Agent configuration schema to include the channelBindings field.
  2. Add a validation check to ensure the channelBindings field is properly formatted.
  3. Modify the Feishu tool to use the bound accountId when called by an Agent.

Example Code:

// Update the Agent configuration schema
const agentSchema = {
  type: 'object',
  properties: {
    id: { type: 'string' },
    name: { type: 'string' },
    channelBindings: {
      type: 'object',
      properties: {
        feishu: {
          type: 'object',
          properties: {
            accountId: { type: 'string' }
          }
        }
      }
    }
  }
};

// Add a validation check
function validateAgentConfig(config) {
  if (config.channelBindings && config.channelBindings.feishu) {
    if (!config.channelBindings.feishu.accountId) {
      throw new Error('accountId is required for Feishu channel binding');
    }
  }
}

// Modify the Feishu tool to use the bound accountId
function getFeishuApp(accountId) {
  // Return the Feishu app instance for the given accountId
}

function callFeishuTool(agent, toolName) {
  const feishuAccountId = agent.channelBindings?.feishu?.accountId;
  const feishuApp = getFeishuApp(feishuAccountId);
  // Use the feishuApp instance to call the tool
}

Verification

To verify the fix, create an Agent with the channelBindings field set to a valid accountId, and then call the Feishu tool using that Agent. The tool should use the bound accountId to authenticate and authorize the request.

Example Test Case:

const agent = {
  id: 'becky-work-assistant',
  name: 'Becky的小助手',
  channelBindings: {
    feishu: {
      accountId: 'becky'
    }
  }
};

callFeishuTool(agent, 'example-tool');
// Verify that the tool was called with the correct accountId

Extra Tips

  • Make sure to update the documentation to reflect the new channelBindings field and its usage.
  • Consider adding additional validation checks to ensure that the accountId is valid and exists in the system.
  • If you're using a database to store the Agent configurations, make sure to update the database schema to include the channelBindings field.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Feature Request: 支持跨渠道 accountId 绑定 [1 participants]