fix(snapshot): add maxBuffer to git add/commit exec calls#1914
Conversation
ca6129c to
e1c9da1
Compare
The git add and commit commands in createWorkingTreeSnapshot and stageAll lacked maxBuffer configuration, using Node's 1MB default. On large workspaces, git can produce >1MB of stderr warnings, causing "RangeError: stderr maxBuffer length exceeded" (ELECTRON-G4, 14 occurrences). Set maxBuffer to 10MB, matching other git commands in the same file.
e1c9da1 to
ff70b7b
Compare
Code Review:fix(snapshot): add maxBuffer to git add/commit exec calls (#1914)变更概述本 PR 修复 Sentry 问题 ELECTRON-G4( 方案评估结论:✅ 方案合理 三处修改与文件中已有的 问题清单🔵 LOW — 测试未实际触发 maxBuffer 边界文件: 问题说明:两个新增测试使用 200 个内容仅约 9 字节的文件,总 stderr 产出远不足 1MB,不会触发 Node.js 默认 1MB maxBuffer 限制,因此无法验证修复本身的必要性。测试覆盖了代码路径正确性(pass/fail 语义无误),但若将来有人将 建议:在测试注释中明确说明此测试为功能性集成测试(不是 maxBuffer 边界重现测试),帮助未来维护者理解意图。由于实际复现该 overflow 需要超大工作区且难以在 CI 稳定运行,此现状可以接受。 汇总
结论✅ 批准合并 — 无阻塞性问题 修复精准、与现有代码风格完全一致,测试覆盖代码路径正确性,LOW 级别问题不影响合并。 本报告由本地 CONCLUSION: APPROVED |
|
✅ 已自动 review,无阻塞性问题,正在触发自动合并。 |
* 'main' of github.com:wuhao1477/AionUi: (40 commits) fix(agents): prevent unhandled promise rejection in bootstrap initialization (iOfficeAI#1933) fix(gemini): restore context after stopping a reply (iOfficeAI#1932) fix(codex): reject start promise immediately on process exit during startup (iOfficeAI#1929) fix(conversation): sync renamed titles with detail view (iOfficeAI#1927) fix(paste): deduplicate filenames when pasting multiple images simultaneously fix(mobile): add SafeArea support and update app icon (iOfficeAI#1926) fix(database): guard against undefined params in databaseBridge providers (iOfficeAI#1924) fix(conversation): validate type field before creating conversation (iOfficeAI#1921) fix(docs): restore wechat_group_5.png reference to wx-5.png in readme fix(snapshot): add maxBuffer to git add/commit exec calls (iOfficeAI#1914) refactor(acp): consolidate AGENT_SKILLS_DIRS into ACP_BACKENDS_ALL (iOfficeAI#1913) fix(gemini): guard against EACCES in workspace realpath during init (ELECTRON-BM) (iOfficeAI#1912) fix(channels): send raw QR ticket instead of page URL in WeChat WebUI login SSE (iOfficeAI#1910) .md format chore(pr-automation): fix missed sleep 5 in comment to sleep 10 chore(pr-automation): increase auto-merge retry delay to 10s chore(pr-automation): add 5s retry for transient GitHub mergeStateStatus UNKNOWN fix(docs): remove trailing whitespace in OfficeCLI readmes chore(pr-automation): verify auto-merge success before labeling bot:done fix(snapshot): guard against non-existent workspace in WorkspaceSnapshotService.init (iOfficeAI#1906) ...
Summary
RangeError: stderr maxBuffer length exceeded(14 events, actively occurring)maxBuffer: 10 * 1024 * 1024(10MB) togit add .andgit commitcalls increateWorkingTreeSnapshot, and togit add -AinstageAll— these were using Node's default 1MB buffer, which overflows on large workspaces with verbose git stderrmaxBufferconfiguration used by other git commands in the same file (compareGitRepo,compareSnapshot,getBaselineContent)Test plan