Skip to content

feat(wecom_bot): support persistent and pass conversation_id#2828

Draft
leslie2046 wants to merge 1 commit intolanggenius:mainfrom
leslie2046:wecombot
Draft

feat(wecom_bot): support persistent and pass conversation_id#2828
leslie2046 wants to merge 1 commit intolanggenius:mainfrom
leslie2046:wecombot

Conversation

@leslie2046
Copy link
Copy Markdown
Contributor

@leslie2046 leslie2046 commented Apr 3, 2026

Related Issues or Context

Supports persistent and pass conversation_id
App ID and user ID can be used together as the key

This PR contains Changes to Non-Plugin

  • Documentation
  • Other

This PR contains Changes to Non-LLM Models Plugin

  • I have Run Comprehensive Tests Relevant to My Changes

This PR contains Changes to LLM Models Plugin

  • My Changes Affect Message Flow Handling (System Messages and User→Assistant Turn-Taking)
  • My Changes Affect Tool Interaction Flow (Multi-Round Usage and Output Handling, for both Agent App and Agent Node)
  • My Changes Affect Multimodal Input Handling (Images, PDFs, Audio, Video, etc.)
  • My Changes Affect Multimodal Output Generation (Images, Audio, Video, etc.)
  • My Changes Affect Structured Output Format (JSON, XML, etc.)
  • My Changes Affect Token Consumption Metrics
  • My Changes Affect Other LLM Functionalities (Reasoning Process, Grounding, Prompt Caching, etc.)
  • Other Changes (Add New Models, Fix Model Parameters etc.)

Version Control (Any Changes to the Plugin Will Require Bumping the Version)

  • I have Bumped Up the Version in Manifest.yaml (Top-Level Version Field, Not in Meta Section)

Dify Plugin SDK Version

  • I have Ensured dify_plugin>=0.3.0,<0.6.0 is in requirements.txt (SDK docs)

Environment Verification (If Any Code Changes)

Local Deployment Environment

  • Dify Version is: , I have Tested My Changes on Local Deployment Dify with a Clean Environment That Matches the Production Configuration.

SaaS Environment

  • I have Tested My Changes on cloud.dify.ai with a Clean Environment That Matches the Production Configuration

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 3, 2026
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:09 — with GitHub Actions Inactive
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:10 — with GitHub Actions Inactive
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:10 — with GitHub Actions Inactive
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:10 — with GitHub Actions Inactive
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:10 — with GitHub Actions Inactive
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:10 — with GitHub Actions Inactive
@dosubot dosubot bot added the enhancement New feature or request label Apr 3, 2026
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:11 — with GitHub Actions Inactive
@leslie2046 leslie2046 changed the title feat(wecom_bot): support persistent conversation_id feat(wecom_bot): support persistent and pass conversation_id Apr 3, 2026
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:11 — with GitHub Actions Inactive
@leslie2046 leslie2046 temporarily deployed to extensions/wecom_bot April 3, 2026 09:11 — with GitHub Actions Inactive
@leslie2046 leslie2046 deployed to extensions/wecom_bot April 3, 2026 09:12 — with GitHub Actions Active
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces multi-turn conversation support for the WeCom bot by implementing session-based storage for conversation IDs. It also updates the dify_plugin dependency to version 0.7.1 and bumps the project version to 0.0.3. Feedback was provided regarding the use of a broad exception handler when retrieving the application ID, suggesting a more explicit type check for better clarity and error handling.

Comment on lines 112 to +116
try:
app = settings.get("app")
app_id = app.get("app_id") if app else ""
except Exception:
app_id = ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a broad try...except Exception can hide unexpected errors and makes the code harder to understand. It's better to handle expected cases explicitly for improved clarity and robustness. You can safely retrieve app_id by checking if app is a dictionary instance.

        app = settings.get("app")
        app_id = (app.get("app_id") or "") if isinstance(app, dict) else ""

@leslie2046 leslie2046 marked this pull request as draft April 3, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant