Files
Igor Šćekić 02379afa48 fix(account): store the console server with each account (#16477)
* fix(account): store the console server with each account

Each stored console account now carries the server address it was created
for, together with the user id that server issues, and is addressed by
both. A token refresh updates the account it was issued for.

- Derive the stored key in @opencode-ai/core/account/key, next to the
  server address normalizer, so runtime writes and the data migration
  share one definition.
- Rename the persistAccount input field to remoteID and keep the stored
  address out of the conflict update.
- Migrate stored rows by deriving the key and normalizing the stored
  address, keeping every row and the active selection.
- Extend the repo, service and migration tests.

* chore(account): wrap the migration registry marker helper

Keep the marker predicate for the new account migration readable.

* fix(account): normalize the server address once before deriving the key

accountKey now takes an address the caller already normalized, so a stored
address that cannot be normalized keeps its raw value and still receives a key
instead of failing the upgrade. The migration test pins the literal key format
and covers a stored address that cannot be normalized.

* test(account): restore the marker around the token refresh test
2026-11-22 08:10:02 +01:00
..