Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: Modify the configuration of the OpenClaw DingTalk channel.
  • Loading branch information
zhengkunwang223 committed Apr 8, 2026
commit 6528ffe9d4e67895ea0062db72f0961d6ca0fac7
5 changes: 2 additions & 3 deletions agent/app/service/agents_channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ func extractDingTalkConfig(conf map[string]interface{}) dto.AgentDingTalkConfig
bots = append(bots, dto.AgentDingTalkBot{
AgentChannelBotBase: dto.AgentChannelBotBase{
AccountID: accountID,
Name: extractDisplayName(account, accountID, accountID),
Name: accountID,
Enabled: extractBoolValue(account["enabled"], true),
},
ClientID: extractStringValue(account["clientId"]),
Expand Down Expand Up @@ -896,12 +896,12 @@ func setDingTalkConfig(conf map[string]interface{}, config dto.AgentDingTalkConf
dingtalk["enabled"] = effectiveEnabled
dingtalk["dmPolicy"] = config.DmPolicy
dingtalk["groupPolicy"] = config.GroupPolicy
dingtalk["gatewayToken"] = extractGatewayToken(conf)
dingtalk["separateSessionByConversation"] = config.SeparateSessionByConversation
dingtalk["groupSessionScope"] = config.GroupSessionScope
dingtalk["sharedMemoryAcrossConversations"] = config.SharedMemoryAcrossConversations
dingtalk["asyncMode"] = config.AsyncMode
dingtalk["ackText"] = config.AckText
delete(dingtalk, "gatewayToken")
switch config.DmPolicy {
case "open":
dingtalk["allowFrom"] = []string{"*"}
Expand All @@ -922,7 +922,6 @@ func setDingTalkConfig(conf map[string]interface{}, config dto.AgentDingTalkConf
for _, bot := range config.Bots {
accounts[bot.AccountID] = map[string]interface{}{
"enabled": bot.Enabled,
"name": bot.Name,
"clientId": bot.ClientID,
"clientSecret": bot.ClientSecret,
}
Expand Down
13 changes: 0 additions & 13 deletions agent/app/service/agents_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1498,19 +1498,6 @@ func extractStringList(value interface{}) []string {
}
}

func extractGatewayToken(conf map[string]interface{}) string {
gateway, ok := conf["gateway"].(map[string]interface{})
if !ok {
return ""
}
auth, ok := gateway["auth"].(map[string]interface{})
if !ok {
return ""
}
token, _ := auth["token"].(string)
return token
}

func ensureChildMap(parent map[string]interface{}, key string) map[string]interface{} {
if child, ok := parent[key].(map[string]interface{}); ok {
return child
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/modules/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,5 +315,5 @@ export const installAgentSkill = (req: AI.AgentSkillInstallReq) => {
};

export const approveAgentChannelPairing = (req: AI.AgentChannelPairingApproveReq) => {
return http.post(`/ai/agents/channel/pairing/approve`, req);
return http.post(`/ai/agents/channel/pairing/approve`, req, TimeoutEnum.T_60S);
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<el-table-column :label="t('commons.table.name')" min-width="140">
<template #default="{ row }">
<div class="channel-bots__name">
<span>{{ row.name }}</span>
<span>{{ row.name || row.accountId }}</span>
<el-tag v-if="row.isDefault" type="success" size="small">
{{ t('commons.table.default') }}
</el-tag>
Expand Down Expand Up @@ -76,7 +76,7 @@

<DialogPro v-model="dialogVisible" :title="dialogTitle">
<el-form ref="formRef" :model="form" :rules="rules" label-position="top">
<el-form-item :label="t('commons.table.name')" prop="name">
<el-form-item v-if="showNameField" :label="t('commons.table.name')" prop="name">
<el-input v-model="form.name" :disabled="disabled" />
</el-form-item>
<el-form-item :label="t('aiTools.agents.accountId')" prop="accountId">
Expand Down Expand Up @@ -201,6 +201,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
showNameField: {
type: Boolean,
default: true,
},
undeletableAccountIds: {
type: Array as PropType<string[]>,
default: () => [],
Expand Down Expand Up @@ -230,7 +234,6 @@ const dialogTitle = computed(() => (editIndex.value >= 0 ? t('commons.button.edi

const rules = computed<FormRules>(() => {
const config: FormRules = {
name: [Rules.requiredInput],
accountId: [
Rules.appName,
{
Expand All @@ -248,6 +251,9 @@ const rules = computed<FormRules>(() => {
},
],
};
if (props.showNameField) {
config.name = [Rules.requiredInput];
}
for (const field of props.fields) {
if (!field.required) {
continue;
Expand Down Expand Up @@ -296,13 +302,17 @@ const saveBot = async () => {
}
await formRef.value.validate();
const nextBots = props.bots.map((bot) => ({ ...bot }));
const nextBot = { ...form };
if (!props.showNameField) {
nextBot.name = nextBot.accountId;
}
if (editIndex.value >= 0) {
nextBots.splice(editIndex.value, 1, { ...form });
nextBots.splice(editIndex.value, 1, nextBot);
} else {
if (props.defaultable && nextBots.every((bot) => !bot.isDefault)) {
form.isDefault = true;
nextBot.isDefault = true;
}
nextBots.push({ ...form });
nextBots.push(nextBot);
}
emitBots(nextBots);
dialogVisible.value = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
:bots="form.bots"
:fields="botFields"
:create-bot="createBot"
:show-name-field="false"
summary-label="Client ID"
:summary-formatter="getBotSummary"
:add-disabled="!installed"
Expand Down
Loading