Repository navigation
fix(connect): 修正网关错误诊断并减少会话重连开销 - #206
Merged
Merged
Conversation
公网探测返回 502 时检查隧道配置的本机端口,保留无法确定原因的诊断。已有会话获取 WebSocket 票据遇到短暂网关故障时,用缓存凭据重试一次,持续失败再重新发现端点。
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Problem
同一次公网探测中,主机已经返回 HTTP 200,随后 cloudflared 到边缘节点的连接断开,公网拿到 502。主机和 relay 都把网关错误归因为本机服务不可达。已有会话重连时,如果申请 WebSocket 票据碰巧收到一次 502,客户端还会丢弃可用凭据并重新授权。
Change
主机收到 502 后,探测隧道配置的本机回环端口。端口确实无法连接时提示检查监听地址与端口,其余情况提示稍后重试并查看隧道日志。Relay 保留裸 502/503 的原因不确定性。设置与 MCP 入口支持对应的简体中文提示。
Web、桌面和移动端共用的授权流程在已有 T3 Connect 凭据且票据请求返回 502、503 或 504 时,使用新的 DPoP 证明重试一次。连续失败仍会重新发现端点,401 仍会刷新凭据。重试只涉及连接票据。
Scope
修复可由主机请求记录、边缘连接日志和公网响应对齐复现的误诊,以及同类瞬时故障导致的多余授权请求。这个修复可按请求结果及授权请求次数独立验证。
Verification
vp run check:changed通过,覆盖 35 个包的类型检查、6 个测试文件的 130 项用例,以及两个有改动的 React 组件的编译器检查。unexpected_response,关闭同一端口后得到origin_unreachable。vp run i18n:check通过。内置浏览器截图超时。未进行移动端真机或公网 VPN 开关对照验收。模型与执行环境为 GPT-6.2-astra,Codex(T3 Code)。