jim800121chen a6c94e21c5 fix(local-agent): 重啟自動從 token.bin 讀 token,免每次重配對
app.go 只在 env VISIONA_SESSION_TOKEN 有值時才啟動 tunnel、env 空就等 UI Pair,
從沒觸發 token.bin 的載入 → 每次重啟都要重配對。(Manager.startLocked 本來就會
從 config.TokenStore.Load,只是沒被呼叫。)

修法:抽 shouldAutoStartTunnel — env 有 token 用 env(優先序不變);env 空則
tokenStore.Load(),有值就自動 Start(免重配對)、空/err/nil store 等 UI Pair 不擋啟動。
Unpair→Delete token.bin→重啟 Load 回空→不自動連(round-trip test 覆蓋)。

reviewer 通過(0C/0M/1m 雙Load技術債)。build/vet/test 全過 + 5 分支 + Unpair round-trip 測試。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-02 18:54:09 +08:00
..