fix(mcp): isolate local scan source failures - #646
Conversation
…omplete scan xintaofei#632's file is a 0-byte `~/.gemini/config/mcp_config.json` — Antigravity touches it into existence before it ever writes a server. serde reports `EOF while parsing a value at line 1 column 0`, so isolating the source leaves that agent permanently invisible AND unwritable: every writer starts by reading the file it is about to change, so nothing can put content into it again. Treat empty and whitespace-only as "nothing configured", the rule the Hermes reader already applied to its own config. Two sources could still fail without the scan noticing, which would make the fail-closed half of the isolation a no-op: - `read_hermes_servers` swallowed I/O errors and invalid YAML into an empty map, so Hermes went silently absent instead of reporting a failure. - Every JSON reader plus the Codex and Grok TOML readers gated on `Path::exists()`, which is false for ANY failed stat — a permission wall or a symlink loop read as "not configured". `read_config_to_string` makes the read itself the test and carries the path into the error detail. Replace the scan-mode flag with an explicit write guard. `scan_local_servers` returns `LocalMcpScan { servers, warnings }` and no longer fails, while `mcp_upsert_local_server` and `mcp_set_server_apps` call `require_complete_scan` before their first write — the strict `find_local_server` on the upsert path ran after the writes, reporting failure on a save that had already landed in fourteen configs. Surface the warnings instead of only logging them: the settings page names the agent whose config could not be read and why, and disables Save and Create while any source is degraded, so a draft seeded from a partial scan cannot be submitted after an out-of-band repair. Closes xintaofei#632
|
Thanks for this — the reader table is a real improvement over the 15 copy-pasted loops, and I kept it as-is. I'd independently worked on #632 before seeing this PR, so rather than open a competing one I've pushed my work on top of your commit ( What I kept from your commit: What changed, and why.
Verification (all green on
Plus an end-to-end check against a real One assertion of yours is inverted: |
Conversation forks are now more reliable, staying on the reply and session you chose while carrying their settings into the next prompt. Pi questions, MCP settings, and Windows network-share launches are more dependable too. ## New - **DeepSeek can now fork a conversation at the exact reply you picked** (deepseek-acp 0.8.0), instead of falling back to the end of the session. ## Improved - **“Fork from here” is now the single, clearer way to branch a conversation** — the redundant composer shortcut is gone, and the reply action stays visible with an explanation while a response is still running. ## Fixed - **Conversation forks now reliably open on the intended new session and are ready for the very next prompt**, preserving the selected turn plus supported model, effort, and mode settings without jumping back, hanging, or losing a fast follow-up. - **Pi’s multiple-choice prompts now use the same interactive question card as other agents**, and the choice you make remains visible in the transcript. (#644) - **One unreadable agent config no longer takes down the MCP settings page** — healthy configs still load, empty files are handled normally, and codeg identifies the problem and pauses writes until every existing setting can be preserved safely. (#646, @dawNotPoi) - **Windows agents launched from UNC workspaces now start in the correct project directory**, including `.cmd` and `.bat` launchers used by npm-installed agents in WSL or network-share projects. (#638, @damiandelmas) Thanks to @dawNotPoi and @damiandelmas for contributing to this release. ----------------------------- # 发布版本 0.30.2 会话分叉现在更可靠了:它会稳稳留在你选中的回复和新会话上,并带着原有设置继续接收下一条消息。 Pi 问答、MCP 设置,以及 Windows 网络路径下的智能体启动也变得更加稳定。 ## 新增 - **DeepSeek 现在能从你选中的那条回复精确分叉**(随 deepseek-acp 0.8.0 到位),不再悄悄退回到会话末尾。 ## 改进 - **「从这里分叉」成为统一而清楚的会话分叉入口**——输入框旁重复的快捷入口已移除,回复生成期间按钮也会留在原位并说明暂时不可用,不再忽隐忽现。 ## 修复 - **会话分叉现在会可靠地打开并留在预期的新会话中,紧接着发出的下一条消息也能正常发送**,选中的分叉点和原会话支持的模型、思考强度及模式都会保留,不再跳回旧会话、卡住或让快速跟进的回复消失。 - **Pi 发起的多选提问现在会显示为统一的可交互问答卡片**,选项可以直接点击,回答结果也会保留在会话记录中。(#644) - **某个智能体的配置文件不可读时,MCP 设置页不再整页失效**——其余配置仍会正常显示,空白配置文件也能正常处理,同时 codeg 会指出问题来源,并在无法安全保留全部设置时暂停写入。(#646,@dawNotPoi) - **Windows 现在能从 UNC 工作区的正确项目目录启动智能体**,包括 WSL 或网络共享项目中由 npm 安装的 `.cmd`、`.bat` 启动器。(#638,@damiandelmas) 感谢 @dawNotPoi 与 @damiandelmas 为本次发布做出的贡献。
Summary
Testing
Closes #632