fix(vz): helper self-terminates on stdin EOF; surface clipboard .waiting#124
Merged
Conversation
實機發現的兩個問題(詳見 DESIGN §6): 1. 對 chefer-runtime 單發 SIGINT/SIGTERM(非終端 Ctrl+C 的整組訊號)時 helper/VM 殘留繼續吃 CPU。修法:vz.rs 以 piped stdin spawn helper 並讓 寫端 fd 隨行程存亡;helper 專屬執行緒代讀 stdin 轉發進 VZ serial (hvc0 輸入路徑不變),EOF 即自我了結。stdin 泵送只在有 terminal/both 服務時才做(vz_util::needs_console_stdin_pump,含單元測試)。 實機 E2E:kill -INT 後 ~6s helper 收攤、無殘留;exit code 傳播不變。 2. ClipboardHost 連 guest:55381 偶發卡在 NWConnection .waiting(原本落在 default 分支完全靜默)。現在印一次性 stderr 提示(引導區域網路隱私權 放行)、3 秒未 ready 棄連重連;build-vz-helper.sh 支援 CHEFER_CODESIGN_IDENTITY 取得穩定簽章身分讓 TCC 記住授權。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dth char into var name CI 的 swiftc compile-check 以 C locale 跑 bash 3.2,`$identity)` 的全形括號 位元組被吃進變數名 → set -u 報 unbound variable(UTF-8 locale 下不會踩到)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
實機(Apple Silicon)發現的兩個 vz 問題的修復,均已於同一台實機驗證:
vz-smoke.sh的kill -INT即觸發)。vz.rs改以Stdio::piped()spawn helper,stdin 寫端 fd 隨 runtime 行程存亡(mem::forget);main.swift)由專屬執行緒代讀 stdin、轉發進 VZ serial(hvc0 輸入路徑不變),讀到 EOF 即自我了結(VM 在行程內,exit 即拆 VM);vz_util::needs_console_stdin_pump,含單元測試),其他 app 不讀使用者終端輸入。.waiting完全靜默:NWConnection 連 guest:55381 偶發卡.waiting數十秒或永不成功(同時nc可秒連;疑為 macOS 區域網路隱私權對 ad-hoc 簽章 helper 的閘門)。.waiting現在有 tracef + 一次性 stderr 提示(引導到 系統設定 → 隱私權與安全性 → 區域網路 放行);reconnect()加去重 guard);build-vz-helper.sh支援CHEFER_CODESIGN_IDENTITY(預設仍 ad-hoc),穩定簽章身分讓 TCC 記得授權。DESIGN.md §6 已補「Helper 生命週期(stdin liveness 契約)」與剪貼簿
.waiting可見性兩段。Verification
cargo test(21 suites, 0 failed)、cargo fmt --check、cargo clippy乾淨;helper 以 swiftc 編譯 + entitlement 簽章成功。kill -INT <runtime pid>→ runtime 5 秒寬限後 exit 130 → helper 立即印stdin closed收攤,+10s 無殘留(修前永久殘留);guest exit 7 → 單檔 exit 7 傳播不變;runtime</dev/null執行不會誤殺 app。Notes
.waiting提示/重連路徑為編譯級 + 邏輯驗證;TCC 閘門情境需下次實機 GUI run 觀察(CHEFER_CLIP_TRACE=1)。< /dev/null會立即結束(檔頭已註明)。vz-smoke.sh收尾的pkill治標改成「斷言無 helper 殘留」(AGENTS.md Follow-ups)。🤖 Generated with Claude Code