Skip to content

Migrate Posit AI auth from Assistant to Authentication#12681

Draft
melissa-barca wants to merge 8 commits intomainfrom
feature/posit-ai
Draft

Migrate Posit AI auth from Assistant to Authentication#12681
melissa-barca wants to merge 8 commits intomainfrom
feature/posit-ai

Conversation

@melissa-barca
Copy link
Contributor

Next piece of #12374

This PR will be moved out of draft only after #12659 is merged. Then I will pull main into this branch and clean up any conflicts. #12659 has some architectural changes this PR relies on.

Migrates Posit AI oauth from Positron Assistant to the Authentication extension. The settings changed from positron.assistant.positai to authentication.positai, but since they have not been formally declared they cannot be migrated.

QA Notes

@:assistant

…nsion

Move the OAuth 2.0 Device Authorization Grant flow for Posit AI from
the positron-assistant extension into the centralized authentication
extension, following the same pattern used for API key providers.

- Add PositOAuthProvider implementing vscode.AuthenticationProvider
  with device code flow, atomic token storage, sequenced refresh,
  and cancellation support
- Route oauth-signin/oauth-signout through createSession/removeSession
  instead of a separate OAuthService interface
- Register posit-ai in product.json trustedExtensionAuthAccess
- Update positron-assistant to consume tokens via vscode.authentication
  API and read baseUrl from workspace config
- Use provider id as config id for OAuth so sessions match on reload
- Add tests for getSessions, removeSession, getAccessToken, token
  validation, and refresh serialization
When a refresh token is rejected with invalid_grant, fire the
removed event so session change listeners are notified.
The auth extension now returns 'save'/'delete' actions instead of
'oauth-signin'/'oauth-signout', so the assistant handles OAuth
providers through the same code path as API key providers.
Drop 5 tests that duplicate getAccessToken coverage through the
getSessions wrapper, test trivial empty-array behavior, or just
verify optional chaining doesn't throw.
The settings were never declared in package.json on either extension,
so VS Code rejects the write with "not a registered configuration."
Since users never had these values set, there is nothing to migrate.
@github-actions
Copy link

github-actions bot commented Mar 24, 2026

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:assistant

readme  valid tags

@melissa-barca melissa-barca changed the title Feature/posit ai Migrate Posit AI auth from Assistant to Authentication Mar 24, 2026
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