Repository navigation
bug(desktop): enabling models one by one can stall Windows Settings → Models #5549
Description
What happened
On Windows Desktop, editing a provider under Settings → Models can become unresponsive when the user enables or disables models one by one. The reported symptom is an intermittent page hang and, in some cases, an apparent application crash while the model selection is being edited.
The current implementation saves every switch immediately through Runtime Host. This creates a potentially expensive and duplicated read/write path:
use-connection-detail.tscallsconnections:updatefor every individual model toggle and blocks later actions while the request is pending.runtime-host-connections-ipc-main.tsreads the complete Connection Catalog before the mutation and again after it, then emitsconnection_list_changed.- The Settings surface, Providers panel, and App Shell each respond to that event with another catalog read; the detail hook also reloads after its update resolves.
connection.catalog.updateis a Host command. It is not automatically retried, and the direct request has no explicit operation timeout when the Host/storage lane remains responsive enough to pass liveness checks.
This issue tracks the provider-editor liveness/performance path. A Windows process crash still needs a native reproduction and crash/log evidence; the source investigation currently proves the conditions for a UI stall, not a confirmed Electron process crash.
How to reproduce
- Use a Windows 11 x64 Desktop build from source or a current Windows preview.
- Configure a provider with multiple chat-capable models, preferably a larger discovered catalog.
- Open Settings → Models.
- Open the provider detail editor.
- Enable or disable several models individually in quick succession.
- Observe whether each switch waits for a Runtime Host round trip, whether the page becomes disabled, and whether the app remains responsive while the catalog refreshes.
- If the app becomes unresponsive or exits, capture the Desktop and Runtime Host logs from the same timestamp.
Environment
- Maka version or commit:
8dfc68d23(source investigation; reproduce on the affected Windows build) - OS and version: Windows 11 x64
- Surface: Desktop → Settings → Models → provider editor
- Runtime Host: local Host selected by Desktop
- Node.js:
v26.3.0when checked from the source workspace - npm:
11.19.0when checked from the source workspace
Logs, screenshots, or additional context
Relevant source paths:
use-connection-detail.tssaves each enabled-model list independently and disables the detail actions while it is pending.runtime-host-connections-ipc-main.tsperforms the Host update, emits the change event, and reads the projected connection again.catalog-reader.tsreconstructs the catalog through revision-consistent pages.reconnecting-connection.tsretries query operations but sends command operations through the current connection.connection.tsinstalls no per-request timer when a command caller does not providetimeoutMs.providers-panel.tsx,settings-surface.tsx, anduse-shell-connections.tsall refresh on the connection-list event.
A Linux /tmp synthetic storage check with 300 discovered models did not show inherently slow local JSON writes, so model count alone is not established as the root cause. Windows-specific file commit/rename timing and Host process behavior still need to be measured.
Related but distinct:
- bug(desktop): Enable all fails when a model catalog exceeds 64 entries #3991 / bug(desktop): eanble all fails when a model catalog exceeds 64 entries. #3993 —
Enable allfails above the enabled-model protocol limit; this report concerns repeated individual saves and liveness. - bug(desktop): composer flashes "还没有可用的模型连接,无法发送" and blocks send during every connection snapshot refresh #4611 — Composer briefly loses its connection snapshot during refresh; this report concerns the provider editor and the refresh amplification behind it.
- fix(desktop): keep the model picker anchored during rapid pointer movement #5367 — Windows model picker anchoring race; this is a separate positioning issue.
Acceptance criteria
- Enabling several models individually does not cause the provider editor or Desktop to become unresponsive.
- Model selection writes are coalesced/batched, or equivalent bounded behavior prevents one Host round trip per click from amplifying into multiple full catalog reloads.
- Host mutation failure or timeout leaves the user’s draft selection visible and provides an actionable error.
- Connection-list refreshes are deduplicated by Host/catalog revision.
- Add a focused Desktop regression test with a delayed Host response and multiple model-toggle actions.
- Verify the final behavior on Windows 11 x64 with a provider having a larger model catalog.
Activity
me2seeks commentedon Sep 21, 2026
take
sunrioa commentedon Oct 19, 2026
I can reproduce stuttering and dropped model-toggle inputs on macOS too, using the installed desktop app rather than a local source build.
0.2.1-dev.91.2026101826.5.2(25F84), Apple SiliconWhen I quickly enable or disable several different models, only the first change takes effect, and the page visibly stutters. After the save/refresh finishes, I can operate the other switches again. The clicks made while the page was busy are not replayed.
I also checked
mainat109cb74b82061810d67929bf7b312593c4701d27. The save guard remains active through both the update and the subsequent refresh. An isolated check using the actual settings controller with delayed save/refresh responses passed four cases covering rapid enables, rapid disables, the refresh-phase lock, and recovery after completion. This confirms the dropped-input mechanism, not the cause of the stutter.Some measurements from the affected installation:
The samples suggest that foreground processing during the interaction deserves further profiling, alongside the repeated catalog refreshes already described here. They do not yet identify the expensive JavaScript function or establish that the reported Windows crash has the same cause. I observed stuttering and ignored inputs in this reproduction, not a process crash.
简体中文
我在 macOS 上也复现了页面卡顿和模型开关操作被忽略的问题,使用的是已安装的桌面应用,而不是本地源码构建。
0.2.1-dev.91.2026101826.5.2(25F84),Apple Silicon快速连续启用或禁用几个不同的模型时,只有第一个修改生效,页面同时出现明显卡顿。等待保存和刷新完成后,其他开关可以继续操作;页面繁忙期间被忽略的点击不会自动补执行。
我还检查了
main的109cb74b82061810d67929bf7b312593c4701d27。保存锁会一直持续到更新及后续刷新完成。使用实际设置页控制逻辑、模拟保存和刷新延迟的隔离验证中,快速启用、快速禁用、刷新期间保持锁定、完成后恢复操作这四项检查均通过。这个验证确认的是点击被忽略的机制,不是卡顿的原因。受影响安装环境中的一些测量结果:
除了本 issue 已描述的重复目录刷新,交互期间的前台处理开销也值得进一步分析。目前采样还没有定位到具体耗时的 JavaScript 函数,也不能证明 Windows 上报告的崩溃与此同因。这次复现观察到的是卡顿和操作被忽略,没有观察到进程崩溃。
fix(desktop): save model selection as a local draft (#6162)
sunrioa commentedon Oct 19, 2026
Adding some Windows test feedback for #6162. I hope these observations help with further investigation and fixes for this issue.
The local-draft and explicit Save behavior works in my testing: changes to multiple model switches are retained and saved together, and reopening the connection confirms that the saved selection persists. I did not reproduce the previous first-operation-only behavior.
Test environment:
10.0.26300.2289ea2b7f1378a0667bc96051a3c682603324cd.43.5.0.24.18.1, npm11.19.0.The build and typecheck passed. All 63 targeted tests passed: 37 connection-settings tests and 26 overlay tests, with no failures or skips.
During manual testing with the full model catalog visible, model switches and the unsaved-changes confirmation felt somewhat slow. After entering a search keyword to reduce the visible list, switching became noticeably smoother; the keyword used in this test was
deep.Entering the model detail page from the OpenRouter connection card also repeatedly showed an approximately 1–2 second delay. During the latest Windows manual checks, Save caused no obvious UI freeze, and no process crash was observed. Cancelling the unsaved-changes confirmation preserved the draft.
With Codex-assisted read-only profiling, I captured the interaction from the connection card to the model detail page:
readPortalWritingContextin Astryx’suseLayercode.These measurements identify a renderer performance hotspot, but do not establish the complete root cause. The captures came from a development build with diagnostic probes, including a previously installed probe that remained active. Timeline recording and React development-mode checks can also add overhead. A clean baseline without those probes, and verification in a packaged production build, are still outstanding.
I have not isolated a specific CSS selector or mapped these layout events to individual floating-layer instances. These results do not establish that the delay is a regression introduced by #6162, that it is Windows-specific, or that the originally reported crash has been fixed.
I also reviewed the scope of #6164/#6165: they address the model list’s height limit and scrolling behavior. This Windows test did not include #6165, so its actual effect on the remaining delays still needs verification.
简体中文
补充一个针对 #6162 的 Windows 测试反馈,希望这些观察能为这个问题的后续排查和修复提供参考。
本次测试中,本地草稿和显式保存的行为正常:连续修改多个模型开关后,选择能够保留并一起保存,重新进入连接详情也能确认保存结果仍然存在。没有再次复现此前只有第一个操作生效的问题。
测试环境:
10.0.26300。2289ea2b7f1378a0667bc96051a3c682603324cd。43.5.0。24.18.1、npm11.19.0。构建和类型检查通过。63 项定向测试全部通过,包括 37 项连接设置测试和 26 项 overlay 测试,无失败、无跳过。
我在 Windows 上人工测试时,完整显示模型目录的情况下,开关按钮和未保存离开提示的响应稍慢。在模型搜索框输入关键词、缩小显示范围后,切换明显更加流畅;本次使用的关键词为
deep。从 OpenRouter 连接卡片进入模型详情页时,也重复观察到约 1–2 秒的响应延迟。最近一轮 Windows 人工检查中,保存没有出现明显的界面卡死,也没有观察到进程崩溃。在未保存离开提示中取消离开后,草稿仍然保留。
借助 Codex,对“从连接卡片进入模型详情页”这段交互做了只读性能采样:
useLayer中的readPortalWritingContext。这些数据定位到了一个渲染性能热点,不代表已经确认完整根因。采样来自带诊断探针的开发构建,其中先前安装的探针仍在运行。时间线记录和 React 开发模式检查也会增加额外开销。无上述探针的干净基线对照,以及 production 打包版验证仍未完成。
目前还没有隔离出具体 CSS 选择器,也没有将这些布局事件对应到具体浮层实例。这些结果不能证明它们是 #6162 引入的回归、Windows 独有的问题,或最初报告的崩溃已经修复。
我也查看了 #6164/#6165 的范围:它们处理模型列表的高度限制和滚动体验。本轮 Windows 测试没有包含 #6165,因此它对上述延迟的实际影响仍需验证。