Skip to content

feat(mobile): select exact provider repositories and branches - #5729

Closed
iscekic wants to merge 9 commits into
mobile-provider-parity-1d93-s7from
mobile-provider-parity-1d93-s8
Closed

feat(mobile): select exact provider repositories and branches#5729
iscekic wants to merge 9 commits into
mobile-provider-parity-1d93-s7from
mobile-provider-parity-1d93-s8

Conversation

@iscekic

@iscekic iscekic commented Aug 29, 2026

Copy link
Copy Markdown
Contributor
  • Repository choices show account, server, owner, and connection details, and search includes those details. Long labels wrap instead of truncating.
  • Repository and branch controls have larger touch targets. Screen readers announce the selected repository and loading or recovery status.
  • New Cloud Agent sessions and Continue now let you choose a starting branch. You can load more branches or retry a failed page without losing your prompt. Unavailable branches block starting until you choose an available branch.
  • Each provider shows its own loading and recovery status. Loaded repositories remain selectable while another provider loads or fails; revoked access removes the affected choices and keeps connection recovery available.
  • Personal users get organization-switch guidance for Bitbucket. Bitbucket connection setup now opens the organization's integration settings instead of Code Reviewer settings.
  • Recently used repositories appear only when they still match the current account, owner, and connection.
  • When Continue has only a repository name or link, you must choose the repository again instead of accepting a guessed match. An unavailable original model still shows its fallback notice.
  • Pending cloud launches now follow the selected repository and branch. After the account, organization, or selection changes, an older result cannot clear or replace the current form.
  • Saved launch recovery asks permission to retry the original settings, not the current connection and branch. Unsafe or conflicting saved launches block replacement.

Summary

RepositoryPlatform uses CodeReviewPlatform; ResolvedNewSessionRepository requires a LaunchRepositoryReference, accountId, and key, while NewSessionRepository retains 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.
dedupeRepositoriesByPlatformAndFullName keeps 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.)

NewSessionScreenBody passes the same ProviderLaunchSelection to ordinary creation and Continue; both require a currently listed branch.
getProviderLaunchFingerprint includes the account, exact repository identity, and upstreamBranch, 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.)

UseNewSessionCreatorInput and useContinueCloudCreate add confirmLegacyRetry, so both launch flows require consent before replaying a matching legacy request.
NewSessionPrepareInput centralizes ordinary requests; strict legacyLaunchInputSchema, legacyAttachmentsSchema, and legacyBitbucketRepositorySchema validate admitted input from getStoredSafeRetry.
Unsafe or competing records block replacement; retries preserve operationKey, any original initialMessageId, 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, and RepositoryGroups expose authorized rows, while withRepositoryAccount isolates normal and forced discovery caches without changing tRPC inputs.
RepositoryProviderStatus lets groups keep loaded rows during transient refresh failures but clear revoked choices; unresolved recents remain in history, outside the picker.
FORBIDDEN and UNAUTHORIZED stop 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.)

RepositoryBranchContext consumes cloudAgentNext.listRepositoryBranches and organizations.cloudAgentNext.listRepositoryBranches; only a listed default or chosen branch produces ProviderLaunchSelection.
FORBIDDEN, UNAUTHORIZED, and PRECONDITION_FAILED offer reconnection; NOT_FOUND and BAD_REQUEST require 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.)

UseNewSessionPrefillTargetsInput now requires resolved rows; prefillRepo selects 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.
reposSettled no 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.)

RepoPickerBridge and RepoPickerSection now carry only resolved rows; RepoOption aliases NewSessionRepository, and RepoPlatform shares RepositoryPlatform.
The picker and search use full identity labels with wrapping, larger targets, and announced selection rather than name-only labels.
RepoSelectorProps no 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.onChange now carries an exact key; provider cards retain separate loading, empty, denial, and identity-recovery messages.
The account-scoped organizations.list sheet lets Personal users set organizationId for Bitbucket without erasing the prompt.
The agentChat.newSession catalog 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.)

getBitbucketIntegrationUrl now targets /organizations/{organizationId}/integrations/bitbucket instead 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, and use-new-session-repos.test.ts.
Generated: 0 files changed.


Visual Changes

Visual Changes: N/A

Verification

  • No manual tests ran for this level because runtime and visual verification await the cumulative stack.
  • Native browser returns, accessibility, live launches, and sandbox checkout remain unverified.

Reviewer Notes

Human steps

  • before merge: Deploy the preceding token service and Cloud Agent changes before relying on pinned provider launches.
  • after merge: No additional deployment setup is required. This change adds no environment values, secrets, migrations, or manual cache clearing.

The bot owns remaining verification.

Automated evidence

  • The handoff reports 279 selected tests across eight data suites.
  • The handoff reports 273 tests across nine user interface (UI) suites.
  • These runs overlap, so their counts do not form a combined total.
  • Formatting, non-declaration lint, and scoped tests passed.
  • Fresh local tRPC declarations are missing; 17 data and 12 selector lint diagnostics remain unverified until standard continuous integration (CI).
  • Broad lint, typecheck, and CI results remain unverified.

Scope and inventory

  • Scope: level 8, mobile-provider-parity-1d93-s7...mobile-provider-parity-1d93-s8.
  • Repository: Kilo-Org/cloud; worktree: /Users/igor/Projects/.worktrees/mobile-provider-parity-1d93.
  • Inventory: 33 changed files, with 4,935 added lines and 1,168 removed lines.
  • File sizes count changed lines from the supplied statistics; A means added and M means modified.

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.

  1. mobile-provider-parity-1d93-s1feat(provider-review): add shared identity and stack checks #5663
  2. mobile-provider-parity-1d93-s2feat(provider-review): define review contracts and vocabulary #5665
  3. mobile-provider-parity-1d93-s3feat(provider-review): add safe provider SDK boundaries #5689
  4. mobile-provider-parity-1d93-s4feat(git-token): authorize exact provider review resources #5692
  5. mobile-provider-parity-1d93-s5feat(cloud-agent): preserve provider identity through checkout #5700
  6. mobile-provider-parity-1d93-s6feat(provider-review): expose exact repositories and branches #5705
  7. mobile-provider-parity-1d93-s7feat(mobile): preserve provider launch and recent identity #5711
  8. mobile-provider-parity-1d93-s8feat(mobile): select exact provider repositories and branches #5729 ← this PR
  9. mobile-provider-parity-1d93-s9feat(provider-review): add authorized GitLab review reads #5738
  10. mobile-provider-parity-1d93-s10feat(provider-review): add authorized Bitbucket review reads #5745
  11. mobile-provider-parity-1d93-s11feat(provider-review): add reconciled GitLab review actions #5748
  12. mobile-provider-parity-1d93-s12feat(provider-review): add Bitbucket review actions and recovery #5756
  13. mobile-provider-parity-1d93-s13feat(provider-review): expose the neutral review facade #5763 (tip)

@kilo-code-bot

kilo-code-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (33 files)
  • apps/mobile/src/app/(app)/agent-chat/repo-picker.tsx
  • apps/mobile/src/components/agents/new-session-prefill.test.ts
  • apps/mobile/src/components/agents/new-session-prefill.ts
  • apps/mobile/src/components/agents/new-session-repository-section.mounted.test.tsx
  • apps/mobile/src/components/agents/new-session-repository-section.tsx
  • apps/mobile/src/components/agents/new-session-repository-state.test.ts
  • apps/mobile/src/components/agents/new-session-repository-state.ts
  • apps/mobile/src/components/agents/new-session-screen-body.mounted.test.tsx
  • apps/mobile/src/components/agents/new-session-screen-body.tsx
  • apps/mobile/src/components/agents/provider-launch-input.test.ts
  • apps/mobile/src/components/agents/provider-launch-input.ts
  • apps/mobile/src/components/agents/repo-selector.tsx
  • apps/mobile/src/components/agents/repository-branch-selector.mounted.test.tsx
  • apps/mobile/src/components/agents/repository-branch-selector.tsx
  • apps/mobile/src/components/agents/use-continue-cloud-create.test.ts
  • apps/mobile/src/components/agents/use-continue-cloud-create.ts
  • apps/mobile/src/components/agents/use-new-session-creator.test.ts
  • apps/mobile/src/components/agents/use-new-session-creator.ts
  • apps/mobile/src/components/agents/use-new-session-prefill.test.ts
  • apps/mobile/src/components/agents/use-new-session-prefill.ts
  • apps/mobile/src/i18n/locales/en.json
  • apps/mobile/src/lib/integration-urls.test.ts
  • apps/mobile/src/lib/integration-urls.ts
  • apps/mobile/src/lib/persist/use-mutation-outbox.test.ts
  • apps/mobile/src/lib/persist/use-mutation-outbox.ts
  • apps/mobile/src/lib/picker-bridge.ts
  • apps/mobile/src/lib/repo-picker-filter.test.ts
  • apps/mobile/src/lib/repo-picker-filter.ts
  • apps/mobile/src/lib/use-github-repos-refresh-cache.test.ts
  • apps/mobile/src/lib/use-github-repos-refresh.test.ts
  • apps/mobile/src/lib/use-github-repos-refresh.ts
  • apps/mobile/src/lib/use-new-session-repos.test.ts
  • apps/mobile/src/lib/use-new-session-repos.ts

Reviewed by grok-4.6 · Input: 449.4K · Output: 25.2K · Cached: 797.2K

Review guidance: REVIEW.md from base branch mobile-provider-parity-1d93-s7

@iscekic

iscekic commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Closing: the owner stopped this workflow section. The branch is retained.

@iscekic iscekic closed this Aug 31, 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