chat-plugin-sdk icon indicating copy to clipboard operation
chat-plugin-sdk copied to clipboard

[Bug] Standalone plugin into race condition when setPluginMessage send the aiMessage=true

Open sonisourabh opened this issue 5 months ago • 2 comments

💻 系统环境 | Operating System

macOS

🌐 浏览器 | Browser

Chrome

🐛 问题描述 | Bug Description

I have created a simple standalone plugin following the template example. I am sending the second argument of setPluginMessage as true. The second argument is meant for aIMessage.

If a LLM conversation have loaded the standalone iframe couple of times; it go into race condition where multiple repetition of the same conversation happening and eventually whole conversation become unusable as its keep on repeating.

Can you help me what's the correct way to use or, rectify the problem?

🚦 期望结果 | Expected Behavior

LLM conversation should not go into infinite loop.

📷 复现步骤 | Recurrence Steps

  • Build a standalone plugin with any iframe
  • Use setPluginMessage(msg, true) with true option

📝 补充信息 | Additional Information

I am use true for AIMessage so that after my iframe, LLM continue with conversation.

sonisourabh avatar Nov 24 '25 10:11 sonisourabh

👀 @sonisourabh Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

lobehubbot avatar Nov 24 '25 10:11 lobehubbot

I’m running into the same issue: the agent stops after executing the standalone plugin. When I try to make it continue using the setPluginMessage(msg, true), it gets stuck in an infinite loop. Right now the only workaround is manually typing “continue.”

I checked the documentation, and besides setPluginMessage(msg, true), there's also triggerAIMessage(id). How can I obtain that id?

ggiallo28 avatar Nov 24 '25 18:11 ggiallo28