Primary finding
upsertAuthProfile performs unlocked read-modify-write on the auth store
- src/agents/auth-profiles/profiles.ts:50-67
`upsertAuthProfile` (sync) reads the store from disk and writes it back without any file lock, while `upsertAuthProfileWithLock` exists as the locked variant. If both variants are reachable from runtime code paths (and given oauth.ts and other files use the locked variant heavily), the sync `upsertAuthProfile` is a footgun: concurrent invocations or concurrent locked writers can lose data. At minimum it should be documented as test-only or removed.
Recommendation
Either deprecate `upsertAuthProfile` and route all callers through `upsertAuthProfileWithLock`, or document that the sync version is unsafe outside of single-process startup code.