Skip to content

Remove the obsolete OAuth fallback - #107

Merged
wch merged 2 commits into
mainfrom
remove-legacy-oauth-engine
Sep 4, 2026
Merged

wch merged 2 commits into
mainfrom
remove-legacy-oauth-engine

Conversation

@wch

@wch wch commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Applications that authenticate through ai-lib now use one OAuth sign-in and refresh path. The removed fallback was unreachable in current applications, but it retained older error handling that could clear stored tokens after any refresh failure.

Store-backed backends continue to acquire and refresh OAuth credentials through the current flow. Host-owned credential backends still resolve their own credentials; when a backend has no OAuth acquisition support, direct token and sign-in compatibility calls return no token or report that OAuth sign-in is unsupported instead of starting a second controller.

Breaking changes

The library no longer exposes the legacy OAuth backend extension. Any external consumer that provided it must migrate to the current OAuth acquisition hooks; in-repository consumers already use those hooks.

wch added 2 commits September 4, 2026 15:12
The device-auth.ts engine has been unreachable since #15 introduced the
acquisition engine: StoreBackend supplies acquisition hooks whenever it
supplies OAuth config, PositronBackend forbids the legacy path, and
createCredentialProvider always prefers acquisition. No consumer outside
ai-lib references the removed symbols.

This deletes the last tombstone-on-any-error refresh path instead of
documenting around it. Breaking change to the ai-credentials API surface:
the OAuthBackendHooks type export and the Backend.oauth field are gone;
backends without acquisition hooks simply have no OAuth support.
@wch
wch merged commit a341a7f into main Sep 4, 2026
4 checks passed
@wch
wch deleted the remove-legacy-oauth-engine branch September 4, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant