Fixes three OpenCode reliability issues: invalid shared TUI preferences are now preserved instead of overwritten, edited and legacy project configs are re-read correctly, and concurrent update checks no longer race for the orphan lock.
Preference writes now only initialize missing files; invalid existing shared preferences are rejected and left untouched.
Project acceptance revalidates when config files change, and unchanged rejected configs — including legacy project files — are cached by file identity so a repaired file is reloaded once.
Orphan reclamation now claims lock generations: observed locks are renamed to unique claim paths, verified by descriptor-derived inode and exact bytes, and restored without clobbering if they changed; reclaim guards abandoned by crashes are recovered while live owners are preserved, and a newly acquired primary lock survives when the orphan disappears mid-check.
The preference watcher now handles watcher errors and suppresses in-flight reads after stop.
Confidence Score: 5/5
No new blocking findings were added; the remaining lock race belongs to an existing review thread.
Summary
This PR protects shared preferences, reloads edited project configs, and revises how auto-updaters recover abandoned locks.
Only one OpenCode window can take over an abandoned update lock.
Project config checks refresh when either config file changes.