Skip to content

perf(ci): speed up unit test gate and add hygiene checks - #6196

Merged
MagicLizi merged 39 commits into
mainfrom
perf/ci-unit-test-throughput
Oct 16, 2026
Merged

MagicLizi merged 39 commits into
mainfrom
perf/ci-unit-test-throughput

Conversation

@MagicLizi

@MagicLizi MagicLizi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

原 Windows unit gate 关键路径约34.1–34.2分钟。本次将 Linux/Windows unit 从2片扩为各4片,分离可并行的runner/数据库检查,优化重型workspace与测试清理,并加入只减不增的测试卫生门禁。目标是缩短完整CI反馈时间,同时保留必要的行为与跨运行时契约。

变更类型

  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护

范围

  • 关联需求:CI吞吐与测试膨胀治理。
  • 包含:两平台完整四分片及空分片修复;runner/DB并行;maker-core独占worker;codexProxyHost复用生产dispose;Windows长参数直接经Node执行Vitest。
  • 卫生门:禁止无依据的真实长等待和模块重载,逐用例hook/helper重载不接受理由豁免;普通unit读取源码作字面量断言需行为化或迁入必需guard。扫描跟踪Vitest/fs静态绑定、解构、赋值别名和局部遮蔽,并区分真实源码执行与文本断言。timer模式只在实际调用/hook处切换;真实Git基准阻止手改抬高基线。
  • 契约:Desktop124份、Mobile41份required guard;Desktop guard独占调度且单worker,typed-send仍扫描2238个runtime roots、使用真实checker并保持15秒限制。只精确登记8份既有根脚本跨文件契约与1份DB迁移源码输入,reset/wait仍受检。
  • 最终相对当前merge base删除或合并迁移49个测试路径;权限、竞态、媒体协议、远程路由与原生契约保留;必要历史行为缺口经真实生产入口恢复。基线最终372个文件,未上调任何额度;9份既有源码契约已移入显式 guard。
  • 不包含:产品能力、服务端、发版或移动原生配置。正常产品行为不变,无breaking change。

UI 变化

不涉及:renderer生产文件仅更新被移除测试的注释引用,没有JSX、样式、交互或文案变化。

  • 引用的设计规范:不涉及,无产品界面变化;现有设计合同继续由guard执行。

怎么验证的

自动验证

当前 PR head 5a3b022:

  • 当前完整 client-ci 38922969203 13/13项成功,同head CodeQL全部通过。Windows四片分别16分33秒/14分55秒/17分24秒/18分30秒,最慢18分30秒;相对原34.1–34.2分钟约缩短46%。Linux四片、类型/guard/runner/数据库与Git集成均通过。下文历史样本仅作此前对照,不替代本head最终证据。

  • Desktop typecheck 通过;Mobile 在独立 frozen-lockfile 依赖环境中 typecheck 通过。完整 check:test-hygiene 372 个文件通过,基线只收紧未上调;check:dev-docs 10/10、diff 检查和 Windows atomic rename 通过。DCO 34 个签名提交、5 个 merge 豁免。

  • Thread reaction 用例保留 me、count=2、完整分页参数及其余断言,仅等待独立 reactors 请求的最终数字:ChatServerControls + ChatReactionButton 60/60 通过,完整命令 30.09 秒(执行 3.47 秒)。独立只读复核无 P0/P1,无产品修改或超时放宽。上一 head 59db 的 run38896139612 只有该条 Windows 第4片用例失败,其余三片 Windows、四片 Linux、verify-checks、runner/DB 和 Git 集成全部通过。

  • 在既有 dropdownMenuHighlight 中补共享 SubContent 的真实点击打开与 body/父菜单 DOM 边界回归:23/23 通过,Vitest 1.70 秒/完整命令 2.59 秒。内存中只移除 SubContent Portal 后,新断言准确失败(exit 1);生产代码字节未改。该覆盖独立于 SidebarFilterPopover。

  • 最新 main 新增的两条 runOnJS 跨 UI/JS native 契约已迁入既有 required guard,原 4 条行为用例完整保留;Mobile 三文件 16/16 通过(12.46 秒)。上一 a93 的 run38894877249 确实因该新主干源码断言命中卫生门而失败,迁移后完整卫生门通过;未放宽基线或改变原生配置。

  • scanner 4项完整自测通过(2.40秒);补齐真实 callback timer 的 const 别名、解构和 Node timers 绑定,按函数捕获时刻区分真假时钟,保留 namespace/default 检测及局部遮蔽。独立12项实际probe与root11项probe全部通过,无P0/P1,未修改基线额度。

  • 最后修复 Promise timer 包装函数的静态漏检:d267f2de52 让包装函数按第一个时长参数计数,callback timer 仍按第二参数并保留捕获时钟判断;常量内层等待只计一次,参数与 fixture 遮蔽继续排除。旧 scanner 对真实回归返回 realWaits:0(exit1),修复后5项 probe正确;完整自测4/4、全仓卫生门374文件通过,独立 reviewer 对最终 head执行8项 probe全部通过。

  • d267 后的收尾修复(65d8f489ac)沿本地 resolve/join/URL 绑定传播仓库锚点,描述性别名不能绕过源码读取检测;真实等待名称只对直接函数调用或已解析的计时器包装生效,meter.pause 等对象方法不再误报。8 个 Desktop 与 1 个 maker-core 源码契约进入显式 guard,相关 scanner/manifest 自测93/93通过,完整卫生扫描373文件、0违规;基线从374收紧到373。

  • 本地完整 test:runner 已最终重跑通过:588项,577通过/11按原条件跳过/0失败,194.20秒;Windows atomic rename 也通过。仅在当前测试进程清除宿主启动变量,系统设置未改。

  • 本轮独立最终审查与原意一致性通过;对 main8252935c 与PR的无冲突组合树中20份后续主干变更测试用真实扫描器逐份检查均无违规。此前 b7 的完整 run38891939786 全部13个job通过,Windows最慢分片18分5秒;该历史性能样本不替代当前head门禁。

  • 此前三处真实组件入口回归119/119通过:活动任务滚动、语音恢复默认、clean IM编辑。本轮收尾两份既有组件文件32/32通过:录音停止、真实模型选择回焦和市场更新/替换保持详情;坏变体均准确失败。空草稿两条既有回归经移除两个闸的变体分别证实有效并已回复关闭。最终Desktop typecheck、完整卫生门374文件、最终两文件实际扫描三项计数均0、docs10/10、diff检查均通过,产品源码未改。

在此前代码阶段还已完成:anthropic-compat-proxy 类型检查、完整双端 guard 与 Mobile unit、相关 Desktop 行为回归和 runner89项调度自测。当前 follow-up 补齐静态callback timer漏检、源码锚点别名与对象方法误报,并保留真实组件历史回归;最终 CI 再次执行完整 Linux/Windows 四分片及两端类型检查。
同机连续对照:codexProxyHost约105→6.7秒(285项及3种随机顺序通过),maker-core从1worker约248秒到4workers约65秒。完整AST卫生扫描约20秒,较最初文本扫描成本更高;不隐瞒该成本。性能审计见docs/dev-rules/desktop-unit-test-performance.md。

测试价值说明

所有新增回归均保护原有行为或具体历史缺口,不新增真实等待。普通unit走生产回调、React hooks/组件或脚本main;纯跨运行时契约进入required guard。最小失败输入、可观察结果、tier与实测如下:

  • codexProxyHost.test.ts:生产dispose清理真实host生命周期,285项保留;unit单文件6.7秒,较105秒显著下降;超过5秒源于既有重依赖初始化。
  • check-test-hygiene.test.mjs:一条违规与其fixture/遮蔽反例验证真实scanTestSource;真实临时Git仓库验证bootstrap、收紧、已提交上调、缺失/坏基准;4项2.52秒,runner。
  • test-workspaces.test.mjs / dev-docs-contract.test.mjs:真实manifest→plan→scheduler验证重型独占、空分片、长argv与必需guard;最小双任务/microtask输入证明旧调度重叠、新调度不重叠。89项约15–18秒/10项不足1秒,专用runner;前者含真实子进程与仓库扫描。
  • CindyMakeSessionNotifications.test.ts:真实Sidebar effect和click验证打开/focus/重复点击清角标及切换/unmount清理;23项3.06秒,unit。
  • accountUsageSnapshot.test.ts:保留真实初次listener安装及全部原有34项,仅单次显式初始化隔离并写理由;0.688秒,unit。quotaCredentialState/claudeAccountUsageKeyRejection/organizationQuotaRefresh保留真实401、账号/endpoint切换和在途竞态;26项整组1.97秒,各文件低于5秒,unit。
  • plugin-usage/current.test.ts复用flush清理保留owner/epoch/teardown;BotTaskOwnerChip保留真实挂载点击,接线合同进入botChatSurface guard;整组20项1.35秒。
  • sessionImportAutoScan.test.ts:真实SessionImportSection挂载,StrictMode首次无需点击扫描一次;remount先呈现缓存,再替换结果;2项完整命令2.15秒,unit。
  • IM startupDefaultRouteBackfill:真实startImConnection验证启动补全、当前DB/config、非阻塞顺序及重复ready/restart;2项1.39秒,unit。
  • pi-package-store-security原11处真实filesystem polling/慢I/O注入补具体理由;remoteCollabHandoff仅提前启用fake clock。两文件208通过/5跳过,25.46秒;Pi文件的真实安装与跨实例安全回归既有成本未扩张。
文件 规则/缺口与最小输入、观察结果(tier 均为 unit) 单文件实测
chatInputAnnotationAbort.test.tsx 真实 useAttachments 队列目录、voice各阶段锁、顶层Escape保护均保留;#1663真实录音停止按钮enabled→click→stop精确一次;9bc20cf894真实ModelSelector选模型后确认变更并回焦真实editor。空草稿订阅/首次hydration既有两项也保留;#374在真实按钮DOM上覆盖listening→submitting→refining→idle时语音与主发送槽相邻,Stop位于其左侧。复用同一harness,旧错误内存变体均准确失败,unit。 13/13,单文件7.79s,执行0.902s;既有重型编辑器依赖,未放宽超时
GhostPluginPage.navigation.test.tsx #2871真实市场详情点更新/冲突替换,经实际安装flow,刷新后同一详情节点保留、新内容可见、按钮变已安装;只模拟IPC。旧helper未覆盖父页面接线;清空详情的内存变体使两状态均失败,unit。 20/20,Vitest5.29s/完整6.117s
fileBodySelectionQuote.test.ts 旧文件正文源码守护缺少 CodeMirror 调用链:真实 FileBodyView 表格 widget 的 DOM 文本与源码不同,选中真实文档范围后点引用,验证草稿源码、notes.md、3–5行和清选区。独有编辑器生命周期,恢复原模块文件。 1/1,3.72s
thumbnailClickPreview.test.ts attachment-thumb-click 历史回归;真实 ThumbnailStrip 点击图片/文本,验证所打开预览的URL或path/name,关闭后恢复;移除两类附件只回调准确ID且不冒泡、不打开预览。原file-card/lightbox测试不经托盘。恢复原模块文件。 3/3,2.039s
chatMediaLightboxFocus.test.ts 2026-06 模型scheme历史回归;真实 model-viewer error应toast,推进300ms假时钟后保持预览且不close;旧focus测试不发error。 3/3,3.996s
SidebarFilterPopover.test.tsx 毛玻璃父菜单裁切历史bug;在既有真实打开子菜单用例中确认submenu位于body且脱离父menu,原点击回调仍通过。 4/4,4.60s
botGroupLampRendering.test.tsx 手动项目头同时命中handle/filter导致无法拖动;两项目custom排序挂真实 ProjectsSection/ProjectNode/SortableJS,真实selector允许拖动,DOM移动后真实onEnd持久化反转顺序。原lamp用例走activity,Sortable曾为空mock。 39/39,5.79s,已有harness初始化占主导
modelSelectorCustomProviderCodexGate.test.tsx HashRouter计费页历史回归;真实ModelSelector和ConfirmDialogProvider,付费行先取消不跳转,再确认后hash为#/settings?tab=billing且未误选模型。统一面板原只测callback。 3/3,5.93s,collect3.64s
SessionCard.visual.test.ts 旧sidebarActiveSessionAutoVisible缺口:真实SessionItem由inactive变active,经实际effect/helper滚动正确任务行,nearest/smooth;无关更新不重复。原69项保留,移除effect依赖的内存变体准确失败。复用既有fixture,unit。 70/70,Vitest7.39s/完整9.44s,collect4.91s
VoiceInputSection.overrideReset.test.tsx configuration-and-overrides §4:真实页面、Switch、DefaultOverrideControls及settings hook,点恢复发送精确null补丁、返回默认并移除badge/入口,另一override不变。hook-only未覆盖入口;独有jsdom环境恢复同模块文件,unit。两种断线/隐藏入口内存变体均失败。 2/2,Vitest1.90s/完整2.851s
HookTaskCard.test.tsx #4367历史clean IM回归:真实UserMessage操作条点编辑后,真实编辑框预填正文;子卡/独立编辑框未覆盖此分支。仅mock宿主预检与未打开的预览;恢复旧hook分支的内存变体准确失败,unit。 47/47,Vitest6.69s/完整7.635s;重型真实消息依赖,未扩大timeout
文件/同模块组 规则/最小失败输入与观察结果 实测
sessionMainLayerDesktopFirst 旧reset scope、分组删除fallback、连接恢复、shared撤销/peer权限;真实callback/JSX效果与路由 12项,1.17秒
messageActionDesktopFirst / messageActionMenu / messageSourceLabelsRender 收起→展开详情、快速重开菜单、streaming→done;详情订阅/清理、native关闭后仅一次dispatch、fork完整composer payload 连同既有阅读恢复/进入定位,6文件48项4.49秒
homeDisplaySettings / homeListFreshness / homeProjectChildWindow / homeDesktopFirst 隐藏/重排、分页候选、到期/poll/resume、首次布局null与late scroll;真实tracker/窗口及effect清理 90项,1.99秒
swipeableSessionRowLifecycle / deviceDetailProjectHeaderLayout 真实Classic Swipeable取消/完成、卸载清理与项目header native props swipe 7项2.54秒;Fabric边界见guard
subagentRender / orcaCollab / userMessageCollapse 生产组件展开/重挂、账户设备隔离、iOS选择与测宽边界 连同相关文件6份50项2.83秒;逐文件1.88/3.55/3.16秒
composerRichInputHtml / conversationShareWebViewHtml / messageWebViewGovernance 生产HTML/JS回调,内容显隐与metrics清理、分享PNG数量上界与异步释放 Composer/share32项2.33秒;最终3文件42项2.96秒
mobileVoiceScriptRedaction 无--run执行真实preflight不得连接网络或输出key;内存移除gate后网络计数0→1且exit0→1 2项390ms
mobileAndroidSimulator / mobileXcode / simRebuildScript / nativeE2eEnvironment 真实脚本main与VM/CLI,地区/argv/Metro归属、构建缓存/指纹、Java/SQLite范围;资源依赖注入 Android/Xcode相关4文件87项928ms;rebuild7项220ms
env / splashPreview / devCacheMenu / mobileSimSource 实际生产env与路由/调试回调;cn/global/dev/prod端点及真实Metro所有权 连同已有模型/Metro覆盖58项1.61秒
AboutSection.legalLinks / myDevicesPanel 真实点击openExternal/失败toast、设备rename提交;保留结果而非接线文字 About10项2.54秒;Desktop整顿35文件384项5.06秒
composerSummaryLocaleRefresh / chatActivityLocaleRefresh / scheduleNoticeWiring 实际locale与schedule回调结果,不复制源码常量 3文件10项2.10秒

这些行为回归复用原模块文件/harness,避免重复加载重型编辑器;超过5秒或10秒的既有文件如实列明,不放宽timeout。4项实际故障回放移除目标生产保护后,对应结果断言确实失败,随后生产代码逐字恢复,无实验改动入库。

新Desktop contract guard保留原跨运行时合同,原模块行为仍留unit;独立冷启动命令node node_modules/vitest/vitest.mjs run --maxWorkers=1均通过:

新guard文件(basename) 单独命令墙钟
authCredentialStoreHealth.contract.test.ts 0.89秒
authHostedCallback.contract.test.ts 0.86秒
authLoginFlowReset.contract.test.ts 0.95秒
loginScenarioHarness.contract.test.ts 0.87秒
mobileClientPromptNote.contract.test.ts 0.89秒
officialProfileMigrationPolicy.contract.test.ts 0.91秒
codexImageAuthBinding.contract.test.ts 0.86秒
legacyGhostRecoveryOrchestration.contract.test.ts 0.88秒
messageDeleteHandler.contract.test.ts 0.88秒
authContextRace.contract.test.ts 0.90秒
sessionAgentSwitchRemoteRouting.contract.test.ts 0.96秒
mobileNativeBoundaryContracts.test.ts 原10项1.28秒;本轮新增1项,三文件合跑16项12.46秒
messageNativeLifecycleContracts.test.ts 1.00秒(5项)
nativeE2eContracts.test.ts 0.88秒(3项)

Mobile三份native guard分别守JS/native权限凭证及宿主生命周期、Fabric/MVCP/手势/UITextView、native E2E凭证/工作流边界;JS行为由unit覆盖。其余mixed文件逐项保留登录/consent、账号所有权、host-managed权限、pending发送与namespace/native边界;最终完整CI承担全量覆盖。

手工验证

不涉及产品UI;没有将复用测试样式等同于实机目检。

未执行的验证

本机未重跑最终完整Linux/Windows四分片,由上述当前head CI执行。独立 worktree 的 Desktop guard 因 Electron 二进制前置检查 version-missing 未启动,CI 将提供该项最终证据;maker-core guard 已通过。Semgrep未安装,未执行,未计作通过;未做产品UI实机目检,本次无界面变化。

风险

风险分类

  • 其他:CI编排、测试分层、工程规则。
  • 跨平台差异

影响与回滚

  • 影响:CI与测试清理;运行期仅增加测试调用的quota/usage reset API,正常运行路径不变。无数据库migration、system prompt、wire协议、权限、存量插件批准状态或原生fingerprint改动。
  • Windows/macOS pool差异保留;未采用会污染全局状态的no-isolate/vmForks。Windows长argv由真实runner验证,全部平台门禁仍必跑。
  • 回滚:revert本PR,恢复两片unit gate及原测试编排。

提交前检查

  • 已review完整diff、独立重审并核对初始实现e2f05349d4与最终目标一致。
  • 所有提交符合DCO。
  • 已注明不涉及UI的依据。
  • 未提交凭证、令牌或授权文件。
  • 已同步工程规则、PR模板与性能审计。
  • 已如实记录验证与未执行项。

当前 head 收尾验证

  • d267 Promise timer wrapper 修复及 65d8 alias/wait 收尾已由独立 review 复核并绑定最终 head;此前 1a59 的本地类型检查、runner、UI 回归和 client-ci 证据仍适用于未变更字节,当前 head 的完整 CI 正在重新执行。

  • 27ab96c 收尾:block-bodied async helper中的await计时器现在映射外层时长参数,短等待与内层常量去重保留。scanner/manifest 93/93、全仓卫生门373文件、Desktop typecheck、docs10/10及diff检查通过。独立review执行旧scanner漏检对照与10项probe,且把真实secondary Stop移到voice后方的内存变体使新回归准确失败。同步main1604e09e,两处冲突保持主干产品布局,既有teammatesSectionSpacing10项逐字保留并进入required guard;四份相关测试94/94通过16.07s。独立最终复核没有P0/P1,原意一致。当前head完整CI仍在执行。

  • 9a0f603:路径别名的声明边界改用现有TypeScript AST,格式化多行resolve/join/URL与无分号声明完整读取;其余有限路径传播不变。实际旧scanner对多行例子sourceReads:0,修复后1;新增无分号fixture隔离反例。完整scanner自测4/4(2.48秒)、全仓卫生门373文件、独立6项probe与diff检查均通过,未改基线、运行期或测试超时。独立复核无P0/P1、原意一致;本轮只修改两个脚本文件,前一组合树的双端类型检查证据仍适用于未改字节,当前完整CI会重新验证。

Namespace paths and final contract routing

3c69d74:现有AST识别path.resolve、path['join']等namespace路径工厂及其格式化多行别名链。旧scanner对真实分行输入sourceReads:0,当前为1;fixture保持0,真实源码执行豁免保留。新增两条最小输入加入原有表,不增加文件。

新增识别的存量7文件逐项处理:resourceUsageEntryIsolation与markdownTargetRendererContract进入required guard;缓存6条结构断言和SubagentsBody的1条privileged-link传播断言完整搬入已有guard,运行期行为仍在unit。3份根脚本契约精确登记;migrationCompatibility原文件未改,原本属于manual DB,用冻结companion字节验证真实hash/manifest修复,按单文件输入用途登记。自测确认邻居DB文件仍受源码门禁,所有登记文件仍受reset/wait门禁。基线只删markdown的3条源码额度,373→372。

验证:scanner/manifest93/93(9.11秒)、相关5文件96/96(26.08秒;SubagentsBody原有慢poll行为约8秒,未改超时)、Desktop typecheck、完整卫生门372文件、docs10/10、diff检查与DCO均通过。独立review执行5项实际旧新probe、source/DB分类反例和基线逐项比较,No P0/P1、原意一致。当前完整CI重新覆盖两平台全部分片。

Final filename and composer behavior regressions

6c110ac:源码读取路径中的不可变const文件名及别名链现在沿用词法绑定识别;仅展开真实read路径参数中的字符串,fixture、shadow、动态/重赋值和源码执行豁免保持。scanner/manifest93/93(10.00秒),独立14项旧新对照通过。全仓卫生门仍372文件,基线未改。

既有ChatInput harness新增真实hardware dispatcher三种动作(submit/skill/composer-text):首次只撤预览,隐藏草稿不变且不发送,第二次确实执行动作。语音用真实effect、decoration和scroller验证saved range而非当前selection;range单独变化后锚点与scrollTop也更新。17/17通过(9.34秒,其中执行1.43秒;独立复跑17/17)。五项内存坏变体全部被断言拒绝(hardware gate、无滚动、忽略range、漏range依赖、强制滚底),独立第六项anchorLocked坏变体同样失败;生产磁盘字节未变。Desktop typecheck、docs10/10、diff与DCO通过。独立复核No P0/P1、原意一致。上一head3c69的client-ci38917865587完整13项全绿,Windows最慢17分17秒;本head重新跑完整CI,不复用历史绿灯。

Lightbox behavior retained after deletion audit

5a3b022:复用既有ImageLightbox组件harness新增一条正常模式回归:真实加载后有明确拟合尺寸;单击图片保持打开;连续两次点真实背景只关闭一次。原标注误点保笔迹用例保留。完整13/13通过(Vitest3.74秒,执行734ms),独立复核通过。四种内存坏变体(移除背景关闭、图片误关闭、重复关闭、移除拟合尺寸)均准确被断言拒绝,产品磁盘字节未改。Desktop typecheck、全仓卫生门372文件和diff通过;基线不变。最终49个整文件删除项逐项复核了旧断言与保留覆盖,没有继续增加冗余harness或源码接线断言。最终head全量CI仍以本次run为准。

@MagicLizi
MagicLizi requested a review from a team as a code owner October 16, 2026 05:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T15:26:52.219508Z 5a3b022 New commits
🔒 Security Review ✅ Completed 2026-10-16T15:27:45.976317Z 5a3b022 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>
@MagicLizi
MagicLizi force-pushed the perf/ci-unit-test-throughput branch from f4fdb6e to 3441f52 Compare October 16, 2026 05:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4fdb6e19b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs Outdated
Comment thread scripts/check-test-hygiene.mjs Outdated
@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[High impact] Adds test hygiene checks and restructures CI test execution.

整体可以合并;建议补齐源码读取门禁对现有 helper 写法的识别。

Findings

  1. P2 源码读取门禁漏检 ▶
Fix with agent prompt
### Issue 1
scripts/check-test-hygiene.mjs:132-134
这里漏掉了仓库已有的 `read(relative)` 写法。`remoteAgentRelocationWiring.test.ts` 在 helper 中调用 `readFileSync(resolve(__dirname, relative))`,却在另一行传入生产源码路径。检查只看字符串所在的单行,无法关联这两处,因此 `sourceReads` 为零,该文件也未进入基线。

后续沿用这种写法新增源码断言时,CI 仍会通过。建议识别这类 helper 读取路径,或要求无法判断的源码读取明确分类,并补上回归用例。

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

本 PR 调整 CI 编排并减少测试准备开销。

  • Linux and Windows unit tests run in four parallel shards.
  • A CI check tracks test habits that can add time or blur test coverage.
  • Tests reuse loaded modules and give maker-core more workers.
  • The test set drops cases that only checked copied source or repeated assertions.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[PR CI] --> B[Linux 检查]
  A --> C[Linux unit 四分片]
  A --> D[Windows unit 四分片]
  A --> E[Windows runner 与数据库检查]
  B --> F[verify]
  C --> F
  D --> G[Windows unit tests]
  E --> G
Loading

Reviews (1) · Last reviewed commit: f4fdb6e · Reviewed by Greptile

Comment thread scripts/check-test-hygiene.mjs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3441f520b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs Outdated
Comment thread scripts/check-test-hygiene.mjs Outdated
Signed-off-by: MagicLizi <jiali@magiclizi.com>
@MagicLizi MagicLizi added status:ci-failed CI 失败(review-pr 自动维护,仅展示) touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) touches:plugin-base 改动碰到插件基座(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示) labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d464d65e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs Outdated
Comment thread scripts/check-test-hygiene.mjs Outdated
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 433248f7ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/main/model-access/__tests__/quotaCredentialState.test.ts Outdated
Comment thread scripts/check-test-hygiene.mjs Outdated
@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Oct 16, 2026
@MagicLizi MagicLizi added status:conflict 与目标分支有冲突(review-pr 自动维护,仅展示) and removed status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) labels Oct 16, 2026
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>
@MagicLizi MagicLizi added the status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) label Oct 16, 2026
@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) and removed status:ci-failed CI 失败(review-pr 自动维护,仅展示) labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1bb1fb225

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a7fe95729

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a59e4040e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs Outdated
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d267f2de52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs
Comment thread scripts/check-test-hygiene.mjs Outdated
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65d8f489ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs Outdated
Comment thread apps/desktop/src/renderer/__tests__/voiceInputButtonAnchor.test.ts
Signed-off-by: MagicLizi <jiali@magiclizi.com>
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27ab96cb14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs Outdated
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a0f60371a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs Outdated
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c69d742bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-test-hygiene.mjs
Comment thread apps/desktop/src/renderer/__tests__/chatInputPromptPreview.test.ts
Comment thread apps/desktop/src/renderer/__tests__/voiceInputDraftScroll.test.ts
Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c110ac265

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: MagicLizi <jiali@magiclizi.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a3b0226d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@MagicLizi MagicLizi added status:ci-running CI 还在跑(review-pr 自动维护,仅展示) and removed status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) status:ci-running CI 还在跑(review-pr 自动维护,仅展示) labels Oct 16, 2026
@MagicLizi
MagicLizi merged commit c90281e into main Oct 16, 2026
26 checks passed
fmfsaisai added a commit that referenced this pull request Oct 16, 2026
上游 #6196 新增的回归断言分离窗可见时 clearAttentionWhenVisible 为 true;本 PR 起
分离窗只显示占位、不显示 Worker 对话,可见时也不应清提醒。同步该断言,保留
「隐藏时持续监听、可见才刷新投影」的其余检查。

Signed-off-by: fmfsaisai <fmfsaisai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

touches:core 改动碰到架构核心路径(review-pr 自动维护,仅展示) touches:large-diff 改动量较大(review-pr 自动维护,仅展示) touches:plugin-base 改动碰到插件基座(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示) touches:security 改动碰到安全边界(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants