fix(web): 桌面载体排空请求体并修复模型测试崩溃 + #19 macOS 验收 / harden desktop fetch carrier and record issue19 macOS acceptance - #34
Merged
Conversation
… desktop carrier
官方桌面验收复现:模型设置「测试连接」POST '{}' 经共享 Fetch 通道必崩 Host
(Electron sent body data for inactive stream → 启动失败恢复页,3/3 复现)。
desktopJson 在提前返回或 finally destroy 时留下未消费 body,
取消帧与 Electron main 在途数据帧竞态触发官方 desktop-host 传输 fatal。
注册即 buffered,改为进校验前整读 body(Buffer 保持 handler 隐式 toString 语义)。
上游 cancel 分支不标 discarded 的协议洞在 Qiuner#19 记录,不代改上游。
回归测试钉死两条路径 bodyUsed 与不触发 cancel;67/67 通过。
… test Cordis 上下文对未注入属性访问即抛,可选链救不了 getter: 桌面入口 inject 无 webServer,测试连接必抛 cannot get property webServer without inject, fetch 层表现为 Failed to fetch;与载体未排空 body 叠加时拖死 Host。 桌面身份由 WeakSet 承担,loopback/origin 检查仅 Web 分支执行。 回归测试模拟抛错 getter 钉死桌面路径;11/11 通过。
…model acceptance and fixes
7 tasks
Qiuner
marked this pull request as ready for review
September 23, 2026 02:44
Qiuner
approved these changes
Sep 23, 2026
Qiuner
left a comment
Owner
There was a problem hiding this comment.
已复核 desktop transport 请求体排空、桌面模型测试注入边界和回归测试;CI 全绿,批准合并。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#19 macOS 侧真实模型验收(维护者 2026-09-17 指定:macOS 归 @ruijayfeng,Windows 归维护者)。验收在 M5 Pro / macOS 26.5.1 / arm64 / 上游
dsh-v0.1.6-alpha.1(0a15e36e7f82)/ DeepSeek 官方deepseek-v4-flash上完成,Key 由使用者在应用内输入,未进入仓库与评论。验收中发现并修复的两个缺陷(叠加必崩)
在模型设置点「测试连接」100% 拖死官方 Host 并落入启动失败恢复页(3/3 复现,最小复现:
fetch POST /api/qcode/model-testbody'{}'):b132323载体未排空请求体:desktopJson提前返回或finally destroy留下未消费 body 时,取消帧与 Electron main 在途数据帧竞态,触发官方desktop-host传输 fatal。注册即 buffered,改为进校验前整读(Buffer 保持既有 handler 隐式 toString 语义)。43daa32模型测试读取未注入服务:桌面 inject 无webServer,Cordis 上下文属性访问即抛(可选链救不了 getter),「测试连接」必抛cannot get property "webServer" without inject;与 1 叠加表现为 Host 崩溃。桌面身份由 WeakSet 承担,loopback 检查仅 Web 分支执行。回归测试各钉一条(bodyUsed 双路径 / 抛错 getter 模拟),qcode-web 67/67、typecheck 通过。
上游协议洞(未改上游,移交维护者)
apps/desktop-host/src/index.tsbeginRequest的 bodycancel()分支删除requestBodies却不登记discardedRequestBodies:任何请求体取消后迟到的数据帧都会从"忽略"升级为 fatal,拖垮整个 Host。建议 cancel 分支同样登记 discarded,使迟到帧走既有忽略路径。本 PR 的修复消除了我方触发面,但任何第三方插件取消 body 仍会命中该洞。#19 完成标准走查(macOS)
issue19-demo+ 官方会话「Coder · issue19-demo」hello.txt(内容含任务时间戳),工具调用/文件链接/用量正常tool call aborted+ 「这一步还没完成」,无残留进程未覆盖(如实):Windows 真实模型侧(维护者)、断网/连接恢复注入、macOS Intel、鼠标锁定纯人工走查、安装包签名公证。
Refs #19(不关闭:Windows 侧与上游协议洞待维护者)