feat: migrate to autopilot for repository fetching#62
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR migrates RxCode’s repository import flow from a direct GitHub device-OAuth implementation to an rxlab sign-in (RxAuthSwift) + autopilot-backed repository listing, so the app no longer talks to api.github.com or handles GitHub OAuth tokens directly.
Changes:
- Replaces GitHub device-flow login + repo fetching UI with rxlab sign-in surfaces and an autopilot-powered “Import Repository” sheet (with install-precheck, pagination, and search).
- Adds
RxAuthServiceandAutopilotServiceand updatesAppStateto use rxauth state as the single source of truth for authentication + repo loading. - Improves chat UX by stripping “No response requested.” noise and adds a rolling-window fallback for Apple Foundation Models summarization when the context window is exceeded.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| RxCodeTests/AppStateTests.swift | Updates persistence test mock to match removed GitHub/custom-repo persistence API. |
| RxCode/Views/Sidebar/AutopilotRepoListView.swift | Renames/retargets sidebar repo list UI to rxauth/autopilot repo model. |
| RxCode/Views/SettingsView.swift | Adds a new Settings tab entry for Autopilot. |
| RxCode/Views/Settings/AutopilotSettingsTab.swift | New settings UI for rxlab sign-in/out and user display. |
| RxCode/Views/Onboarding/RxAuthSignInView.swift | New rxlab sign-in sheet wrapper around RxAuthSwiftUI. |
| RxCode/Views/Onboarding/OnboardingView.swift | Removes legacy “skip GitHub login” call; directly marks onboarding complete. |
| RxCode/Views/Onboarding/GitHubLoginView.swift | Removes GitHub device-flow login UI. |
| RxCode/Views/MainView.swift | Replaces GitHub sheet entrypoint with the autopilot repo import sheet. |
| RxCode/Views/Chat/GitHubSheet.swift | Removes legacy GitHub/custom repo import sheet. |
| RxCode/Views/Chat/AutopilotRepoSheet.swift | New repo import sheet with install-precheck CTA, pagination, and server-side search. |
| RxCode/Utilities/KeychainHelper.swift | Switches keychain reads to SecItemCopyMatching and removes security CLI helper. |
| RxCode/Services/RxAuthService.swift | Adds a shared rxauth manager wrapper and a keychain-backed token reader. |
| RxCode/Services/PersistenceService.swift | Removes persistence APIs for custom repos and cached GitHub user. |
| RxCode/Services/GitHubService.swift | Removes direct GitHub OAuth + API + clone logic. |
| RxCode/Services/FoundationModelSummarizationService.swift | Adds rolling-window compression retry when context window is exceeded. |
| RxCode/Services/AutopilotService.swift | Adds autopilot API client for repos/installations and install-url flows. |
| RxCode/RxCode.entitlements | Adds associated domains entitlement for passkeys/webcredentials. |
| RxCode/Resources/Localizable.xcstrings | Updates extracted strings for the new/removed UI text. |
| RxCode/Info.plist | Adds URL scheme for OAuth redirect and an autopilot base URL key. |
| RxCode/App/AppState+Stream.swift | Strips “no response requested” blocks when finalizing streaming messages. |
| RxCode/App/AppState+Project.swift | Replaces GitHub logic with rxauth/autopilot repo loading and clone flow updates. |
| RxCode/App/AppState+Messaging.swift | Strips “no response requested” blocks when ending messaging streams. |
| RxCode/App/AppState+Lifecycle.swift | Restores rxauth on startup, clears legacy GitHub token, observes session expiry. |
| RxCode/App/AppState+CrossProject.swift | Adds helper to strip no-op assistant text blocks from message arrays. |
| RxCode/App/AppState.swift | Replaces GitHub state with rxauth/autopilot state + adds new services. |
| RxCode.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | Adds RxAuthSwift dependency pins (and transitive updates). |
| RxCode.xcodeproj/project.pbxproj | Wires SPM products and entitlements into the Xcode project. |
| Packages/Sources/RxCodeCore/Models/GitHubModels.swift | Removes GitHub DTOs and device-flow models. |
| Packages/Sources/RxCodeCore/Models/AutopilotModels.swift | Adds autopilot DTOs for repos/installations and pagination. |
| Packages/Sources/RxCodeCore/CLISession/CLILineToBlocksMapper.swift | Filters the “No response requested.” marker out of CLI-to-block parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // A newer search may have replaced `repoCurrentSearch` while this | ||
| // request was in flight — drop the stale result so the UI doesn't | ||
| // briefly show repos for the previous query. | ||
| guard requestedSearch == repoCurrentSearch else { return } |
Comment on lines
+171
to
182
| // React to RxAuthSwift session expiry by clearing autopilot repos. | ||
| // `isSignedIn`/`rxUser` are computed from the manager, so they update | ||
| // automatically when `OAuthManager` flips to `.unauthenticated`. | ||
| NotificationCenter.default.addObserver( | ||
| forName: .rxAuthSessionExpired, | ||
| object: nil, | ||
| queue: .main | ||
| ) { [weak self] _ in | ||
| Task { @MainActor [weak self] in | ||
| self?.repos = [] | ||
| } | ||
| } |
| perPage: Int? = nil, | ||
| refresh: Bool = false | ||
| ) async throws -> AutopilotRepoListResponse { | ||
| var components = URLComponents(url: baseURL.appendingPathComponent("/api/v1/repos"), resolvingAgainstBaseURL: false) |
Comment on lines
+512
to
+522
| private func relativeUpdated(_ raw: String?) -> String? { | ||
| guard let raw, !raw.isEmpty else { return nil } | ||
| let isoFractional = ISO8601DateFormatter() | ||
| isoFractional.formatOptions = [.withInternetDateTime, .withFractionalSeconds] | ||
| let isoPlain = ISO8601DateFormatter() | ||
| isoPlain.formatOptions = [.withInternetDateTime] | ||
| let date = isoFractional.date(from: raw) ?? isoPlain.date(from: raw) | ||
| guard let date else { return nil } | ||
| let formatter = RelativeDateTimeFormatter() | ||
| formatter.unitsStyle = .short | ||
| return formatter.localizedString(for: date, relativeTo: Date()) |
Comment on lines
+448
to
+455
| private func ownerAvatar(for repo: AutopilotRepo) -> some View { | ||
| let installation = appState.installations.first { $0.accountLogin.caseInsensitiveCompare(repo.owner) == .orderedSame } | ||
| ZStack { | ||
| RoundedRectangle(cornerRadius: 6, style: .continuous) | ||
| .fill(ClaudeTheme.surfaceSecondary) | ||
| .frame(width: 28, height: 28) | ||
|
|
||
| if let urlString = installation?.accountAvatarUrl, let url = URL(string: urlString) { |
Contributor
Author
|
🎉 This PR is included in version 1.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.