[Bug] Handle Gemini error responses safely in /quick ai
@CodeMatrix1 is already working on this.
Since Mar 30, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Start at the /quick ai entry point and trace the Gemini response handling around response.data.candidates[0].content.parts[0].text. Reproduce an overload or temporary-unavailability response, then verify that explicit provider messages are surfaced and unexpected responses are logged instead of causing a generic failure.
Written by the indexing model from the issue text.
Description
What happened?
Description
When /quick ai is used with Gemini and the provider returns an error payload instead of generated candidate text, the AI flow fails.
The current implementation assumes the Gemini response always contains text at:
response.data.candidates[0].content.parts[0].text
In practice, Gemini can return an error object instead of candidates, for example when the model is overloaded or temporarily unavailable. In those cases, /quick ai does not handle the response shape safely.
Expected behavior
/quick aishould safely handle Gemini responses that do not includecandidates- if Gemini returns an explicit error payload, the app should surface the provider message instead of failing
- if Gemini returns an unexpected shape without generated text, the app should log the error in gemini response.
Actual behaviour
/quick aiassumes the Gemini response always contains generated text atresponse.data.candidates[0].content.parts[0].text- when Gemini returns an error payload instead of
candidates, the AI flow fails - proper logs are not generated
- the modal falls back to a generic failure message instead of handling the provider response safely
Steps to reproduce
- Install the Quick Replies app
- Configure Gemini as the AI provider
- Trigger
/quick ai - Enter a prompt and click
Generate - Hit a Gemini error response such as overload / temporary unavailability
- Observe that the response does not contain generated candidate text
Relevant ScreenShots
Version
v8.2.1
What browsers are you seeing the problem on?
Firefox
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RocketChat/Apps.QuickReplies
-
[Bug]: Contextual bar actions do not work and duplicate reply names are allowed during editsMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
RocketChat/Apps.QuickReplies#70 · 1 comment ·
-
[Bug]: /quick ai error messages are not role-aware and lack actionable guidanceMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
[Feat] One Click AI-Powered Reply Suggestions for Improved UXMay be free again @moyrsd claimed this 583 days ago, and no pull request is open. Openenhancement
RocketChat/Apps.QuickReplies#59 · 3 comments · 1 assignee ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
RocketChat/Apps.QuickReplies#55 · 2 comments ·
All issues in RocketChat/Apps.QuickReplies
Similar issues
-
bug
Difficulty 2/5 Half a day Newbie friendliness 68/100
amosblomqvist/learnharness#758 ·
Maintainers usually reply within 2 days
-
Change WorkspacesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
bitfocus/companion-module-renewedvision-propresenter-api#134 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
rcpch/digital-growth-charts-react-component-library#304 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dsh-market/dsh-market#1210 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
trustjonathan/STUDY-HUB#13 ·