Skip to content

fix(chat): ignore transient info messages#1964

Merged
piorpua merged 1 commit intoiOfficeAI:mainfrom
cdxiaodong:fix/1854-ignore-info-transform-message
Mar 31, 2026
Merged

fix(chat): ignore transient info messages#1964
piorpua merged 1 commit intoiOfficeAI:mainfrom
cdxiaodong:fix/1854-ignore-info-transform-message

Conversation

@cdxiaodong
Copy link
Copy Markdown
Member

Summary

  • treat info events as transient messages in transformMessage
  • avoid noisy unsupported-message warnings for Gemini retry notifications
  • add regression coverage to confirm info messages are ignored without logging warnings

Test plan

  • bun run lint
  • bun run format
  • bunx tsc --noEmit
  • bun run test

Fixes #1854

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@piorpua piorpua added the bot:reviewing Review in progress (mutex) label Mar 31, 2026
@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 31, 2026

Code Review:fix(chat): ignore transient info messages (#1964)

变更概述

本 PR 在 transformMessage 的 switch 语句中新增 'info' case,将其归入已有的瞬态消息忽略分支(与 startfinishthought 等同级),避免 Gemini 重试通知等 info 类型消息触发 console.warn 的 unsupported-message 警告。同时更新了回归测试,覆盖了 info 消息被正确忽略且不产生警告的场景。

涉及模块:src/common/chat/chatLib.ts(消息转换层)、tests/unit/transformMessage.test.ts


方案评估

结论:✅ 方案合理

'info' 加入现有的 fall-through 忽略分支是最简单、最一致的方案。没有引入额外复杂度,与项目已有的瞬态消息处理模式完全一致。无更优替代方案。


问题清单

✅ 未发现明显问题,代码质量良好,建议批准合并。


汇总

# 严重级别 文件 问题
无问题

结论

  • 批准合并 — 无阻塞性问题

改动范围小(2 文件,+12 行),逻辑清晰,测试覆盖充分(Codecov 确认所有修改行均已覆盖),与项目现有模式一致。


本报告由本地 pr-review skill 生成,包含完整项目上下文,无截断限制。

CONCLUSION: APPROVED
IS_CRITICAL_PATH: false
PR_NUMBER: 1964

@piorpua
Copy link
Copy Markdown
Contributor

piorpua commented Mar 31, 2026

✅ 已自动 review,无阻塞性问题,正在触发自动合并。

@piorpua piorpua merged commit 9964916 into iOfficeAI:main Mar 31, 2026
14 checks passed
@piorpua piorpua added bot:done Auto-merged by bot and removed bot:reviewing Review in progress (mutex) labels Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:done Auto-merged by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: handle 'info' message type in transformMessage (ELECTRON-X)

2 participants