Skip to content

feat: migrate to autopilot for repository fetching#62

Merged
sirily11 merged 1 commit into
mainfrom
autopilot-intergration
May 27, 2026
Merged

feat: migrate to autopilot for repository fetching#62
sirily11 merged 1 commit into
mainfrom
autopilot-intergration

Conversation

@sirily11

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 15:06
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxcode Ready Ready Preview, Comment May 27, 2026 3:07pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RxAuthService and AutopilotService and updates AppState to 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) {
@sirily11 sirily11 merged commit 6f99f63 into main May 27, 2026
12 checks passed
@sirily11 sirily11 deleted the autopilot-intergration branch May 27, 2026 15:54
@sirily11

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants