-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Closed
Labels
🐞 bugSomething isn't workingSomething isn't working
Description
Self Checks
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- Please do not modify this template :) and fill in all the required fields.
Dify version
0.11.2
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
- Modify the environment variable ACCESS_TOKEN_EXPIRE_MINUTES to "1", so the access token will expire in 1 minute.
- Enter the agent's Debug and Preview interface and send a message, triggering the /chat-messages API.
- Wait 1 minute for the token to expire, then send another message, calling /chat-messages again.
After completing the steps mentioned above, the browser starts an infinite loop, alternately calling /refresh-token and /chat-messages, while the chat box continually shows the agent as "speaking."
This issue occurs because, after the frontend receives a 401 unauthorized response from the /chat-messages call, it requests a token refresh. However, when it calls /chat-messages again, it doesn't use the new token. Since the old token has expired, it still gets a 401 unauthorized response from /chat-messages. As a result, the frontend keeps requesting /refresh-token, but this effort is in vain.
✔️ Expected Behavior
After using /refresh-token, it's necessary to explicitly use the updated token when calling /chat-messages again.
❌ Actual Behavior
dosubot
Metadata
Metadata
Assignees
Labels
🐞 bugSomething isn't workingSomething isn't working