Description
When removing an auth provider via DELETE /auth/:providerID, the Provider.state() cache is not being invalidated. This causes the provider to still appear as "connected" even after successful removal.
Steps to reproduce
- Add a provider auth (e.g.,
POST /auth/opencode)
- Verify provider shows as connected in
GET /provider
- Remove the auth via
DELETE /auth/opencode
- Check
GET /provider - provider still shows as connected (BUG)
Expected behavior
After DELETE /auth/:providerID, the provider should no longer appear as connected in subsequent /provider requests.
Root cause
In packages/opencode/src/server/server.ts, the DELETE handler calls Auth.remove(providerID) but does not invalidate the Provider state cache. The Provider.state() function caches provider data, and this cache is not cleared after removing auth.
Fix
Add await Instance.disposeAll() after await Auth.remove(providerID) to invalidate the state cache.
Description
When removing an auth provider via
DELETE /auth/:providerID, theProvider.state()cache is not being invalidated. This causes the provider to still appear as "connected" even after successful removal.Steps to reproduce
POST /auth/opencode)GET /providerDELETE /auth/opencodeGET /provider- provider still shows as connected (BUG)Expected behavior
After
DELETE /auth/:providerID, the provider should no longer appear as connected in subsequent/providerrequests.Root cause
In
packages/opencode/src/server/server.ts, the DELETE handler callsAuth.remove(providerID)but does not invalidate the Provider state cache. TheProvider.state()function caches provider data, and this cache is not cleared after removing auth.Fix
Add
await Instance.disposeAll()afterawait Auth.remove(providerID)to invalidate the state cache.