Skip to content

Bug: DELETE /auth/:providerID does not invalidate Provider state cache #14010

@digi4care

Description

@digi4care

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

  1. Add a provider auth (e.g., POST /auth/opencode)
  2. Verify provider shows as connected in GET /provider
  3. Remove the auth via DELETE /auth/opencode
  4. 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.


Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions