mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Claude 4 Opus returns invalid_request_error in agent mode #355
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MitraSafarinejad on GitHub (Jun 10, 2025).
Self Checks
Dify version
1.3.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Hello team,
I'm currently using Dify v1.3.1 and encountered the following error while using the Claude 4 Opus model in agent mode:
[models] Bad Request Error, Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.1: all messages must have non-empty content except for the optional final assistant message'}}
Additionally, I've noticed that when I open the logs, the "Thinking..." timer starts
Although this issue was marked as fixed in #11238, it is still present in the latest version.
✔️ Expected Behavior
The Claude model should respond to inputs in agent mode without errors, as long as all messages contain valid content.
❌ Actual Behavior
The model returns a 400 error indicating that message 1 has empty content. However, from the user's side, all visible messages include content.
Starting a new chat can sometimes bypass this issue, but it recurs under certain conditions.
@fdb02983rhy commented on GitHub (Jun 10, 2025):
The issue occurred because the text portion didn’t get generated—you’re only seeing the “thinking” part. Try adjusting your prompt or regenerating the response before the point where the text portion is missing.
@dosubot[bot] commented on GitHub (Aug 19, 2025):
Hi, @MitraSafarinejad. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thank you for your understanding and contribution!