Repository navigation
fix(debug): preserve hosted stream for disconnect after cancellation - #2445
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
requested review from
1lck,
Mucheen and
xiaoyumuxi
as code owners
November 26, 2026 12:46
2 tasks done
Contributor
Author
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
…-announced-disconnect
1lck
approved these changes
Nov 27, 2026
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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
停止托管 TCP 调试会话时,会话取消可能先触发迟到写入登记的关闭回调,使清理任务无法把 DAP disconnect 放入队列,适配器随即退出而没有报告断连。
改动 / Changes
*os.File标准输入管道,保留阻塞写入的超时与取消中断。net.Pipe和testing/synctest的回归,固定“连接就绪 → 取消会话 → 迟到写入 → 发送断连 → 排空”的顺序,并检查对端收到完整断连内容。debug-tcp-transport功能矩阵的验证说明、行为约束及证据路径。不在本 PR 范围内 / Out of scope
无。
类型专属:fix
复现与根因
5bdb7d36e上运行原始TestDebugAnnouncedAdapterBreakpointPauseContinueStop,Linux 连续 100 次通过。该 issue 的自然失败来自 macOS。queuing disconnect after cancellation: the debug adapter stream is not running。期望适配器在停止时收到断连帧。writeFrames原先为每种传输登记context.AfterFunc(... transport.Close)。会话已经取消时,该回调会先关闭托管 TCP 连接,随后清理任务的 disconnect 入队失败。git blame定位到0faecba49(Epic(0.7.0): 基于 Viva 框架的跨平台方案的迁移(#1794) #1799)引入这段写入关闭逻辑。feat(desktop): 托管 tcpAnnounced 调试适配器 #1954 接入 tcpAnnounced 托管进程后也使用它。c269c41153c8da2f2e8d064c68550a8f23260e2c。检查项
desktop/internal/workbench/debug_transport_test.go,修复前 5/5 失败,修复后与原始完整调试流程、stdio 阻塞取消测试各通过 100 次。writeFrames全部调用方、setTransport的全部写入端安装点,以及会话取消、清理排空和进程退出路径。.agents/notes/implemented/bug-fix/2026-11-09-viva-debug-session-cleanup.md。范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/debug-tcp-transport.json,两端原生验证状态如实保持 pending。origin/main HEAD的实质变更门禁。.artifacts/platform-feature-matrix/,提交清单仅含四个源码和决策记录文件。插件归属 / Plugin ownership
UI 验证 / UI evidence
N/A。本次修改位于调试字节流和清理路径。完整断点、暂停、继续和停止通过既有无头工作台回归验证。
统一日志系统 / Structured logging
取消通过
context.Canceled返回,失败仍由调用方的debugWriteFailed等边界处理。仓库旧scripts/logging/校验脚本已移除,等价日志静态门禁未完成。界面文案 / i18n
逻辑归属 / Logic placement
*os.File并用关闭文件句柄中断 OS 写入。性能与内存 / Performance and memory
N/A。本次移除托管写入上的临时 context、定时器和关闭回调分配,stdio 仍按原生阻塞写入需要创建它们。
设置 / Settings
N/A。
插件契约 / Plugin contract
N/A。
发行包与资源 / Bundle and resources
无用代码与重构 / Dead code and refactoring
验证 / Verification
-count=5TestDebugAnnouncedAdapterBreakpointPauseContinueStop、TestDebugBlockedWriteEndsOnCancellation,-count=100-run '^(TestDebug|TestHosted)',串行执行scripts/desktop/desktop-go.sh test -race ./internal/workbench -run '^(TestDebug|TestHosted)' -count=1 -timeout=300sscripts/desktop/desktop-go.sh test ./... -count=1 -timeout=900sscripts/desktop/desktop-go.sh vet ./..../.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/mainnode scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check./scripts/agent-notes/verify-agent-notes.shnode scripts/platform-feature-matrix/generate-platform-feature-matrix.mjs、矩阵 verify、change gate./scripts/desktop/verify/verify-runtime-bundle-immutability.sh、插件归属自查、git diff --check本地 timing HTML/JUnit 报告已生成于
.artifacts/test-stability/,包含新增回归的逐项耗时。Ready 后的 GitHub Actions 已完成。macOS、Windows 和 Linux 的
Vet and test均通过。Format and script tests的发行包只读校验脚本自测失败,汇总门禁因此为红。校验脚本需要 Dev Container 工作流,但自测夹具少了对应的样例。在本地运行node --test scripts/desktop/verify/test-runtime-bundle-immutability.mjs得到相同失败,基线5bdb7d36e的 CI 也有同一报错。#2444 已补齐该夹具。本 PR 的检查 · 基线失败 · 夹具修复未能执行的检查和原因
提交前确认 / Final checks
Written by Devin