Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

概述 / Overview

Adds sender_id and sender_name variables to pipeline query variables, making user identification available to Dify workflows. This enables identity-based authentication and personalization in WeChat Work (企微) + Dify scenarios.

New variables available in Dify workflows:

Variable Legacy Variable Description
sender_id langbot_sender_id Sender's ID (string)
sender_name langbot_sender_name Sender's display name

Changes:

  • preproc.py: Extract sender name from FriendMessage/GroupMessage events, add both variables to query
  • difysvapi.py: Pass variables as legacy langbot_* inputs to workflow runs

更改前后对比截图 / Screenshots

N/A - Backend variables only, no UI changes.

检查清单 / Checklist

PR 作者完成 / For PR author

  • 阅读仓库贡献指引了吗? / Have you read the contribution guide?
  • 与项目所有者沟通过了吗? / Have you communicated with the project maintainer?
  • 我确定已自行测试所作的更改,确保功能符合预期。 / I have tested the changes and ensured they work as expected.

项目维护者完成 / For project maintainer

  • 相关 issues 链接了吗? / Have you linked the related issues?
  • 配置项写好了吗?迁移写好了吗?生效了吗? / Have you written the configuration items? Have you written the migration? Has it taken effect?
  • 依赖加到 pyproject.toml 和 core/bootutils/deps.py 了吗 / Have you added the dependencies to pyproject.toml and core/bootutils/deps.py?
  • 文档编写了吗? / Have you written the documentation?
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: LangBot+dify+企微场景,增加user_id和user_name字段参数</issue_title>
<issue_description>### 这是一个?

新功能

详细描述

LangBot机器人在对接企微机器人的时候,能不能把当前企微用户的user_id和user_name传递给到后续的dify工作流,作为入参,需要根据user_id来做一些身份识别或者是权限认证</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 1, 2025 03:28
This adds user identification fields that can be passed to Dify workflows:
- sender_id: the sender's ID (converted to string)
- sender_name: the sender's display name (from Friend.nickname or GroupMember.member_name)

Both variables are also available as legacy inputs:
- langbot_sender_id
- langbot_sender_name

Resolves the feature request to pass WeChat Work user info to Dify workflows.

Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>
Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>
Copilot AI changed the title [WIP] Add user_id and user_name parameters to LangBot feat: add sender_id and sender_name variables for Dify workflows Dec 1, 2025
Copilot AI requested a review from RockChinQ December 1, 2025 03:34
Copilot finished work on behalf of RockChinQ December 1, 2025 03:34
@RockChinQ RockChinQ marked this pull request as ready for review December 1, 2025 03:35
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. eh: Feature enhance: 新功能添加 / add new features IM: wecom 企业微信 适配器相关 / WeCom and WeComCS adapter related m: Session 会话和消息模块 / Sessions management labels Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eh: Feature enhance: 新功能添加 / add new features IM: wecom 企业微信 适配器相关 / WeCom and WeComCS adapter related m: Session 会话和消息模块 / Sessions management size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: LangBot+dify+企微场景,增加user_id和user_name字段参数

2 participants