fix: backport desktop Gateway UTF-8 restarts to 0.4.0 - #5950
Conversation
Co-authored-by: Bolin_Chen <17506219+bobbyfine@users.noreply.github.com> (cherry picked from commit 7828513)
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The identical commit already sits on Watch
On the substance (judged from [DESIGN-REVIEWED] 4070e32 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsThe discovery pass produced no candidates, and my independent verification confirms the analysis. I checked the one genuine risk — the global No findings. [OPUS-REVIEWED] 4070e32 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Problem / Motivation
Backport the merged UTF-8 Gateway restart hardening from #5919 to the 0.4.0 Insider release line.
A hostile or incorrectly inherited Python stream encoding can make an Electron-managed Gateway crash when it emits Unicode during an in-app restart. This affects restart paths shared by Tailnet, MCP, updates, and liveness recovery.
What changed
This is a minimal cherry-pick of merge commit 7828513. The only conflict was resolved by excluding unrelated main-only count_open_fds code so release-specific behavior remains unchanged.
Testing
Related
Backport of #5919.
Checklist