feat(mobile): select exact provider repositories and branches - #5729
Closed
iscekic wants to merge 9 commits into
Closed
feat(mobile): select exact provider repositories and branches#5729iscekic wants to merge 9 commits into
iscekic wants to merge 9 commits into
Conversation
This was referenced Aug 29, 2026
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (33 files)
Reviewed by grok-4.6 · Input: 449.4K · Output: 25.2K · Cached: 797.2K Review guidance: REVIEW.md from base branch |
This was referenced Aug 30, 2026
This was referenced Aug 30, 2026
Contributor
Author
|
Closing: the owner stopped this workflow section. The branch is retained. |
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.
Summary
RepositoryPlatformusesCodeReviewPlatform;ResolvedNewSessionRepositoryrequires aLaunchRepositoryReference,accountId, andkey, whileNewSessionRepositoryretains optional identity fields for old callers.Normalization rejects missing identity, mismatched owners, and personal Bitbucket while retaining the provider, integration, instance, repository identifiers, and default branch.
dedupeRepositoriesByPlatformAndFullNamekeeps its export name but compares exact resource keys, so same-name repositories and separate connections remain distinct.Files
apps/mobile/src/components/agents/new-session-repository-state.ts— derives discovery fields from shared types, validates ownership, preserves identity, and builds disambiguating labels and provider states. (Source; M; 188 changed lines.)apps/mobile/src/components/agents/new-session-repository-state.test.ts— updates repository identity and provider-state tests. (Test; M; 328 changed lines.)NewSessionScreenBodypasses the sameProviderLaunchSelectionto ordinary creation and Continue; both require a currently listed branch.getProviderLaunchFingerprintincludes the account, exact repository identity, andupstreamBranch, so repository, connection, instance, or branch changes retire pending completions.Stale completions cannot clear the replacement form, draft, busy state, or retry rows; remote launches retain their existing behavior.
Files
apps/mobile/src/components/agents/new-session-screen-body.tsx— resolves current account/owner keys, owns branch state, blocks incomplete cloud launches, and supplies legacy consent. Fences Continue completion and limits prefill to the original organization. (Source; M; 242 changed lines.)apps/mobile/src/components/agents/new-session-screen-body.mounted.test.tsx— extends mounted coverage for both creators, non-default branches, saved retries, resource recovery, and stale completion. (Test; M; 813 changed lines.)UseNewSessionCreatorInputanduseContinueCloudCreateaddconfirmLegacyRetry, so both launch flows require consent before replaying a matching legacy request.NewSessionPrepareInputcentralizes ordinary requests; strictlegacyLaunchInputSchema,legacyAttachmentsSchema, andlegacyBitbucketRepositorySchemavalidate admitted input fromgetStoredSafeRetry.Unsafe or competing records block replacement; retries preserve
operationKey, any originalinitialMessageId, and saved settings instead of current pins.Files
apps/mobile/src/components/agents/provider-launch-input.ts— adds strict saved-input validation, shared fingerprints, and the ordinary prepare type. Compatibility remains until old clients, records, and the 30-day ledger window expire. (Source; M; 85 changed lines.)apps/mobile/src/components/agents/provider-launch-input.test.ts— updates launch input and compatibility tests. (Test; M; 45 changed lines.)apps/mobile/src/components/agents/use-new-session-creator.ts— checks both deployed legacy fingerprint formats and restores only one matching request. Preserves rows on cancellation or rejection; old unnormalized callers retain ordered migration. (Source; M; 109 changed lines.)apps/mobile/src/components/agents/use-new-session-creator.test.ts— updates ordinary creation tests. (Test; M; 1 changed line.)apps/mobile/src/components/agents/use-continue-cloud-create.ts— tracks the selected fingerprint across awaits and replays the original clone request after consent. Keeps failed recovery rows and sends no synthetic prompt. (Source; M; 84 changed lines.)apps/mobile/src/components/agents/use-continue-cloud-create.test.ts— updates Continue creation tests. (Test; M; 1 changed line.)apps/mobile/src/lib/persist/use-mutation-outbox.ts— exposes the full safe-retry row and delegates key lookup to it; reconcile-first rows remain excluded. (Source; M; 20 changed lines.)apps/mobile/src/lib/persist/use-mutation-outbox.test.ts— extends mutation outbox tests. (Test; M; 20 changed lines.)UseNewSessionReposResult,RepositoryGroup, andRepositoryGroupsexpose authorized rows, whilewithRepositoryAccountisolates normal and forced discovery caches without changing tRPC inputs.RepositoryProviderStatuslets groups keep loaded rows during transient refresh failures but clear revoked choices; unresolved recents remain in history, outside the picker.FORBIDDENandUNAUTHORIZEDstop automatic rediscovery; scoped refreshes and browser returns retain recovery, reject stale writes, and invalidate branch queries after success.Files
apps/mobile/src/lib/use-new-session-repos.ts— scopes all three providers and browser returns; matches recents only by authorized keys. Cancels replaced queries, tracks overlapping refreshes, and refreshes branch caches. (Source; M; 581 changed lines.)apps/mobile/src/lib/use-new-session-repos.test.ts— extends discovery, identity, provider-state, and refresh-isolation tests. (Test; M; 993 changed lines.)apps/mobile/src/lib/use-github-repos-refresh.ts— preserves the public query tuple and cancels normal requests before cache replacement. Records permission errors and fences browser, error, and busy-state completion. (Source; M; 183 changed lines.)apps/mobile/src/lib/use-github-repos-refresh.test.ts— extends GitHub refresh and account/owner isolation tests. (Test; M; 350 changed lines.)apps/mobile/src/lib/use-github-repos-refresh-cache.test.ts— adds production permission-cache regressions for revoked rows, explicit retries, and authorization returns. (Test; A; 297 changed lines.)RepositoryBranchContextconsumescloudAgentNext.listRepositoryBranchesandorganizations.cloudAgentNext.listRepositoryBranches; only a listed default or chosen branch producesProviderLaunchSelection.FORBIDDEN,UNAUTHORIZED, andPRECONDITION_FAILEDoffer reconnection;NOT_FOUNDandBAD_REQUESTrequire repository reselection instead of retry.Transient failures preserve usable branches and retry the failed page; account, owner, or repository changes reset choices and reject stale callbacks.
Files
apps/mobile/src/components/agents/repository-branch-selector.tsx— adds exact query keys, cursor pagination, native selection, accessible status messages, and empty/missing-branch recovery without clearing the prompt. (Source; A; 212 changed lines.)apps/mobile/src/components/agents/repository-branch-selector.mounted.test.tsx— adds mounted branch-selection and recovery tests. (Test; A; 309 changed lines.)UseNewSessionPrefillTargetsInputnow requires resolved rows;prefillReposelects only an exact authorized key, even before other providers finish.Legacy names and clone URLs require explicit selection; Continue preserves non-GitHub URLs without treating them as identity evidence.
reposSettledno longer proves absence, and unresolved repositories cannot suppress an independently confirmed model fallback notice.Files
apps/mobile/src/components/agents/new-session-prefill.ts— preserves full non-GitHub clone URLs, requires exact keys for selection, and separates model fallback from repository resolution. (Source; M; 50 changed lines.)apps/mobile/src/components/agents/new-session-prefill.test.ts— updates repository-prefill and model-fallback tests. (Test; M; 191 changed lines.)apps/mobile/src/components/agents/use-new-session-prefill.ts— applies a matching prefill once without replacing manual selection; keeps the model fallback notice once per mount. (Source; M; 28 changed lines.)apps/mobile/src/components/agents/use-new-session-prefill.test.ts— adds model-notice, once-only delivery, explicit-selection, and valid-model tests. (Test; A; 134 changed lines.)RepoPickerBridgeandRepoPickerSectionnow carry only resolved rows;RepoOptionaliasesNewSessionRepository, andRepoPlatformsharesRepositoryPlatform.The picker and search use full identity labels with wrapping, larger targets, and announced selection rather than name-only labels.
RepoSelectorPropsno longer defaults unqualified rows to GitHub, and selection callbacks reject disabled, removed, or unmounted choices.Files
apps/mobile/src/lib/picker-bridge.ts— shares repository types and requires resolved identities in picker rows and sections while retaining legacy search inputs. (Source; M; 21 changed lines.)apps/mobile/src/components/agents/repo-selector.tsx— filters unresolved rows, groups by exact keys, and validates callbacks against current rows. Loaded choices stay enabled during other loading. (Source; M; 135 changed lines.)apps/mobile/src/app/(app)/agent-chat/repo-picker.tsx— uses exact row keys, wrapped identity labels, larger touch targets, and accessible selected state. (Source; M; 22 changed lines.)apps/mobile/src/lib/repo-picker-filter.ts— searches the complete identity label and preserves each result's resolved type and metadata. (Source; M; 7 changed lines.)apps/mobile/src/lib/repo-picker-filter.test.ts— updates repository search tests. (Test; M; 70 changed lines.)NewSessionRepositorySectionProps.onChangenow carries an exact key; provider cards retain separate loading, empty, denial, and identity-recovery messages.The account-scoped
organizations.listsheet lets Personal users setorganizationIdfor Bitbucket without erasing the prompt.The
agentChat.newSessioncatalog adds 19 English messages; the later level 8 translation pass owns their translations.Files
apps/mobile/src/components/agents/new-session-repository-section.tsx— shows unavailable selections, provider states, branch controls, and an account-fenced organization switch. Denied access keeps connection setup instead of refresh-only recovery. (Source; M; 242 changed lines.)apps/mobile/src/components/agents/new-session-repository-section.mounted.test.tsx— adds mounted repository-section tests. (Test; A; 307 changed lines.)apps/mobile/src/i18n/locales/en.json— adds branch, discovery, permission, legacy retry, and Personal Bitbucket messages; preserves existing text. (Source; M; 19 changed lines.)getBitbucketIntegrationUrlnow targets/organizations/{organizationId}/integrations/bitbucketinstead of Code Reviewer settings, so connection recovery opens the actual Bitbucket setup.Personal Bitbucket remains unavailable, organization identifiers remain encoded, and GitLab setup destinations stay unchanged.
Files
apps/mobile/src/lib/integration-urls.ts— replaces the Code Reviewer destination with the organization Bitbucket integration route. (Source; M; 7 changed lines.)apps/mobile/src/lib/integration-urls.test.ts— updates the expected Bitbucket setup destination. (Test; M; 9 changed lines.)Tests: 15 files changed (4 added, 11 modified):
new-session-prefill.test.ts,new-session-repository-section.mounted.test.tsx,new-session-repository-state.test.ts,new-session-screen-body.mounted.test.tsx,provider-launch-input.test.ts,repository-branch-selector.mounted.test.tsx,use-continue-cloud-create.test.ts,use-new-session-creator.test.ts,use-new-session-prefill.test.ts,integration-urls.test.ts,use-mutation-outbox.test.ts,repo-picker-filter.test.ts,use-github-repos-refresh-cache.test.ts,use-github-repos-refresh.test.ts, anduse-new-session-repos.test.ts.Generated: 0 files changed.
Visual Changes
Visual Changes: N/A
Verification
Reviewer Notes
Human steps
The bot owns remaining verification.
Automated evidence
Scope and inventory
mobile-provider-parity-1d93-s7...mobile-provider-parity-1d93-s8.Kilo-Org/cloud; worktree:/Users/igor/Projects/.worktrees/mobile-provider-parity-1d93.Notes
Runtime and visual verification are pending for the cumulative stack; unit tests do not prove native behavior or sandbox checkout.
Stacked PRs — merge bottom to top. Each level shows only its own diff.
Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.
mobile-provider-parity-1d93-s1— feat(provider-review): add shared identity and stack checks #5663mobile-provider-parity-1d93-s2— feat(provider-review): define review contracts and vocabulary #5665mobile-provider-parity-1d93-s3— feat(provider-review): add safe provider SDK boundaries #5689mobile-provider-parity-1d93-s4— feat(git-token): authorize exact provider review resources #5692mobile-provider-parity-1d93-s5— feat(cloud-agent): preserve provider identity through checkout #5700mobile-provider-parity-1d93-s6— feat(provider-review): expose exact repositories and branches #5705mobile-provider-parity-1d93-s7— feat(mobile): preserve provider launch and recent identity #5711mobile-provider-parity-1d93-s8— feat(mobile): select exact provider repositories and branches #5729 ← this PRmobile-provider-parity-1d93-s9— feat(provider-review): add authorized GitLab review reads #5738mobile-provider-parity-1d93-s10— feat(provider-review): add authorized Bitbucket review reads #5745mobile-provider-parity-1d93-s11— feat(provider-review): add reconciled GitLab review actions #5748mobile-provider-parity-1d93-s12— feat(provider-review): add Bitbucket review actions and recovery #5756mobile-provider-parity-1d93-s13— feat(provider-review): expose the neutral review facade #5763 (tip)