03d9782f22
leo 問「寫以前為什麼不查」——沒有藉口,我假設了兩件事都沒查,兩件都是錯的。 ① setup script 讀不到 Environment variables 官方原文:Each session copies the environment's values once, at startup, into ordinary environment variables 而 setup script 是 before Claude Code launches 跑的 ⇒ 注入在它之後。 ⇒ 把 token 放進 Environment variables 再要 setup script 讀,永遠讀不到。 證據吻合:leo 的變數設對了、值也跟本機同一把(長度 40、頭尾一致), 而腳本回報找不到。 ② exit 非零會讓整個 session 開不起來 官方原文:Exit zero: if the script exits non-zero, the session fails to start. 前一版為了大聲失敗用 exit 1 ⇒ 直接造成 Session initialization failed。 ⇒ 現在一律 exit 0,失敗寫進 /tmp/.isep-setup-report。 本機三向實測: 無變數(雲端真實情況)→ exit 0,印出說明,不擋 session 有變數(未來平台若改行為)→ 設 git 認證並驗證 ls-remote 加 timeout 45(本機曾掛住近 4 分鐘) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>