Repository navigation
Conversation
Monitor owned cloudflared readiness and network changes, refresh DNS on recovery, and serialize retries with stop cancellation and rate limits. Share fresh connection health with CLI, control panel, and tray. Add regression coverage and document recovery behavior.
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.
背景
修复 Windows 控制面板/托盘在长时间运行后状态查询或启停卡住、旧版本 Core 占用端口,以及 VPN 切换后 cloudflared 进程仍存活但隧道连接全部失效的问题。最后一种情况可能表现为固定域名返回 HTTP 530 / Cloudflare 1033。
改动
Windows 启动、停止与桌面控制
固定域名 Cloudflare Tunnel 的网络恢复
/ready,并发布带 owner 和有效期的健康快照;CLI、面板和托盘共享状态。/healthz和公网/healthz。进程存在或历史注册日志不再作为 Named Tunnel 当前就绪的证据。auto协议,保留显式协议/解析器覆盖;增加退避、抖动及滚动窗口限流。主动停止取消健康请求、子进程及重试等待。连接恢复与相关安全边界
同步 README 和
docs/runtime-access-and-recovery.md,并增加相应回归测试。本 PR 包含四个修复提交;个人 Fork 的测试发布工作流未纳入本 PR。验证
在此 PR 分支上重新执行并通过:
go test -race ./... -count=1 -timeout=3m。internal/desktopruntime的TestCoreRecovery|TestNamedTunnel|TestTunnelReady|TestTunnelHealth|TestTunnelRecovery|TestTunnelNetwork|TestTunnelMetrics|TestTunnelStatus专项。internal/desktopcontrol、internal/nexusbridge、internal/mcp/client、internal/mcp/oauthclient、internal/acp、internal/tool/file、internal/httpx、internal/tool/contract、internal/publicartifacts、scripts/test测试。go vet,以及git diff --check。Windows 测试使用 Go 1.26.5 和指向本机缓存的临时
-modfile,仓库的 go.mod/go.sum 未改动。Windows 专项使用真实隔离辅助进程,覆盖活进程断线、旧进程回收顺序、DNS 更新、主动停止、指标端口归属及陈旧快照拒绝。实现阶段另外验证了共享 C# 服务/模型编译、状态 JSON 的新旧兼容、资源读取和 fake-cloudflared fixture 编译;真实 cloudflared 2026.9.1 / 2026.9.3 使用隔离无效 Token 验证新增参数可被解析,未启动真实隧道。
已知验证边界
TestStopBinaryProcessesTerminatesProcessThatReappearsDuringStop间歇失败:启动 replacement helper 报Access is denied。VPN 恢复改动前的本地基线对照也复现过此错误;这里不将 Windows 全量记为通过。