fix: default anthropic message type to text when missing - #42203
fix: default anthropic message type to text when missing#42203abhijeetnardele24-hash wants to merge 2 commits into
Conversation
|
Thanks for contributing to Appsmith! Credential-free formatting, lint, type, and unit checks will run after GitHub's workflow approval. An Appsmith maintainer will start privileged integration tests or a deploy preview when needed. No action is required from you while this PR has the |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. WalkthroughThe OAuth form now shows ChangesOAuth form rendering
Vision message handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Vision queries now process retained chat messages as text when no type is present, and OAuth expiration settings are shown only for Authorization Code grants. No current merge-blocking risk is identified. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment Warning |
Description
This PR fixes a bug in the Anthropic AI integration where switching the query mode from "Chat" to "Vision" resulted in a "content not found" error during query execution.
Root cause:
The frontend carries over the
messagesarray data when switching fromchat.jsontovision.json. Since theCHATmessage schema does not contain thetypefield, the resulting JSON array lacks it. However,VisionCommand.javastrictly expectedtypeto be eithertextorimage. When it encountered a null/missingtype, it failed to populate the messagecontent, resulting in a malformed payload and a "content not found" error from the Anthropic API.Fix:
Updated
VisionCommand.javato default a missing or emptytypetotext. This ensures robust parsing and seamlessly handles the payload carried over from the "Chat" command.Fixes #36245
Type of change
How Has This Been Tested?
mvn testpasses foranthropicPlugin.Summary by CodeRabbit