State files leave the OpenCode folder: switch the move on (#477), CI only

Merged
AN
2d ago
+462-43

Switch-on for the state relocation (#477), rebased on 2.8.0, plus the gzip latch path fix. Held: merge only after Ufuk decides the release timing.


Summary by cubic

Turns on the state relocation (#477): OpenCode moves its machine-written account, vault, usage, and session state out of the config folder into the state-home folder (~/.local/state/cortexkit/anthropic-auth/opencode/, with XDG_STATE_HOME overriding ~/.local/state and a hashed name for custom config folders). CLI and Pi commands now run a read-only migration preflight that reads custody authority without touching plugin logs or vault state and refuses an unmigrated local dataset before any locks, registration, or file writes; setup and already-migrated hosts proceed normally. The advisory gzip rejection latch follows the chosen layout: a moved install starts with an empty latch in state-home (including OpenCode 2's first use), while legacy and Pi keep the latch next to the account file, with nothing copied or deleted.

Migration

  • Update every OpenCode and Pi on the machine and restart the running hosts first; before downgrading, quit everything and run npx @cortexkit/opencode-anthropic-auth setup --restore-legacy.
  • The config folder keeps settings, legacy sign-in inputs, and local routing; the prompt-cache keep-warm session registry stays in the CortexKit data folder.