[Bug] Handle Gemini error responses safely in /quick ai
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript
调研方向
从 /quick ai 入口开始,跟踪 response.data.candidates[0].content.parts[0].text 附近的 Gemini 响应处理。复现过载或暂时不可用的响应,然后验证明确的提供商消息会被呈现,并且意外响应会被记录日志,而不是导致通用失败。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- TypeScript
- 星标
- 7
- 派生
- 21
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RocketChat/Apps.QuickReplies 的其他 Issue
-
[Bug]: Contextual bar actions do not work and duplicate reply names are allowed during edits可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 3/5 1-2 天 新手友好度 48/100
RocketChat/Apps.QuickReplies#70 · 1 条评论 ·
-
[Bug]: /quick ai error messages are not role-aware and lack actionable guidance可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 4/5 3-5 天 新手友好度 45/100
-
bug
难度 3/5 1-2 天 新手友好度 45/100
-
[Feat] One Click AI-Powered Reply Suggestions for Improved UX可能重新可做 @moyrsd 于 583 天前认领,目前没有进行中的 PR。 未关闭enhancement
RocketChat/Apps.QuickReplies#59 · 3 条评论 · 已指派 1 人 ·
-
bug
难度 2/5 1-3 小时 新手友好度 35/100
RocketChat/Apps.QuickReplies#55 · 2 条评论 ·
查看 RocketChat/Apps.QuickReplies 的全部 Issue
相似的 Issue
-
Bug: Broken RTL / BiDi text rendering when mixing Persian (Farsi) with English or numbers可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 半天 新手友好度 68/100
amosblomqvist/learnharness#758 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
bitfocus/companion-module-renewedvision-propresenter-api#134 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
rcpch/digital-growth-charts-react-component-library#304 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
dsh-market/dsh-market#1210 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 86/100
trustjonathan/STUDY-HUB#13 ·