New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flaky tool calls, maybe missing authorization or auth out of sync #3999
Comments
It sounds like the intermittent 401 Unauthorized errors you're encountering could stem from issues related to credential validation or token management within your Dify setup. Here are a few targeted areas to investigate:
To address these issues, review your token management strategy to ensure tokens have appropriate expiration times and a reliable renewal mechanism. Also, investigate potential concurrency issues that could affect credential validation, particularly in scenarios with high load. Lastly, compare the environments between direct tool panel calls and agent calls for any differences that could influence authentication success. These steps should help you narrow down the cause of the intermittent 401 Unauthorized errors and guide you towards a resolution.
|
have you added |
@Yeuoly Yes, I added the prefix in the tool panel, because when I didn't add it, the test run will fail with 401. So I guess it's due to behavior discrepancy between test runner in the tool panel and the tool caller in agent workflows? |
thanks for telling this, its really weird, I will check it AFAP |
@Yeuoly FYI, here is the code for the plugin. https://github.com/ifsheldon/gpt_plugin_template_rs |
Self Checks
Dify version
0.6.5
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I have implemented my own plugin with simple bearer authorization. I tested it's usable in the tool panel, but when using it in an agent, there's a chance the tool call fails due to 401 Unauthorized. It's really weird, since sometimes the tool call succeeds.
You can try with a simple plugin with a python backend. Or, I can share my plugin with you since it's just a demo only for testing.
I've check the logs in the api server(see below screenshot). The first 4 calls are produced by an agent I develop. The last two was produced by my testing in the tool panel with the same arguments, no modifications on authorizations.
✔️ Expected Behavior
Smooth tool calls when agents try to call a tool with correct authorization
❌ Actual Behavior
The text was updated successfully, but these errors were encountered: