fix: handle Gemini error responses in quick ai#83
Open
CodeMatrix1 wants to merge 1 commit intoRocketChat:mainfrom
Open
fix: handle Gemini error responses in quick ai#83CodeMatrix1 wants to merge 1 commit intoRocketChat:mainfrom
CodeMatrix1 wants to merge 1 commit intoRocketChat:mainfrom
Conversation
Author
|
Hi vipin, let me know if you want me to keep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue(s)
Related to Gemini failures in
/quick aiwhen the API returns an error payload instead of generated candidate text.fixes #82
Acceptance Criteria fulfillment
candidateserror.messaget('AI_Something_Went_Wrong', this.language).Proposed changes (including videos or screenshots)
This PR improves Gemini response handling in
/quick ai.Previously, the Gemini execution path assumed that every successful-looking response contained generated text at:
response.data.candidates[0].content.parts[0].textIn practice, Gemini can return an error payload instead, for example when the model is overloaded or temporarily unavailable. In those cases,
candidatesmay be missing, which caused the quick AI flow to fail.This change:
response.data.error.messageFurther comments
console.logis used here for debugging because it was the most reliable way to inspect the Gemini response payload in the current local setup run, whereasthis.app.getLogger()output was not consistently visible during investigation.This PR is intentionally scoped to Gemini runtime response handling only.
It does not change the broader
/quick aiinteraction flow or AI configuration behavior.