Skip to content

feat(mobile): preserve provider launch and recent identity - #5711

Closed
iscekic wants to merge 8 commits into
mobile-provider-parity-1d93-s6from
mobile-provider-parity-1d93-s7
Closed

feat(mobile): preserve provider launch and recent identity#5711
iscekic wants to merge 8 commits into
mobile-provider-parity-1d93-s6from
mobile-provider-parity-1d93-s7

Conversation

@iscekic

@iscekic iscekic commented Aug 29, 2026

Copy link
Copy Markdown
Contributor
  • Mobile session details now show GitLab and Bitbucket repository names, including older saved sessions.
  • If you change accounts, organizations, or repositories while starting a mobile session, an older attempt no longer replaces your current form.
  • Continue keeps the new attempt busy after an account or organization change, even when an older attempt finishes or fails.
  • If a connection fails during mobile session creation, retrying reuses the saved start instead of creating a duplicate session.

Summary

  • Scope: level 7, mobile-provider-parity-1d93-s6...mobile-provider-parity-1d93-s7.
  • Repository: Kilo-Org/cloud; worktree: /Users/igor/Projects/.worktrees/mobile-provider-parity-1d93.
  • Inventory: 22 changed files, with 3,370 added lines and 216 removed lines. File sizes below use added/removed lines; A means added, and M means modified.

ProviderLaunchSelection pairs a required LaunchRepositoryReference with optional upstreamBranch; resolveProviderLaunchInput returns ProviderPrepareInput for exactly one provider.
When launchSelection is supplied, ProviderLaunchContext rejects null selections, absent accounts, mismatched owners, blank branches, and personal Bitbucket launches.
provider-launch:v1 fingerprints include the account, owner, integration, repository, and selected branch; omitted launchSelection preserves legacy payloads and fingerprint bytes.

Files
  • apps/mobile/src/components/agents/provider-launch-input.ts — validates provider/name agreement and Bitbucket identifiers, maps integration pins, and preserves the selected branch. (Source; A; +128/-0 lines.)
  • apps/mobile/src/components/agents/provider-launch-input.test.ts — adds shared launch mapping and compatibility tests. (Test; A; +246/-0 lines.)

PrepareInput adds optional bitbucketRepo, githubIntegrationId, gitlabIntegrationId, gitlabInstanceUrl, and bitbucketIntegrationId.
createSessionManager forwards these fields without requiring them, so older Cloud Agent software development kit (SDK) callers remain valid.
The authorized server lookup stays until old callers and records disappear and the 30-day ledger window expires.

Files
  • packages/cloud-agent-sdk/src/session-manager.ts — extends the public prepare contract without changing the existing createAndStart forwarding. (Source; M; +7/-0 lines.)
  • packages/cloud-agent-sdk/src/session-manager.test.ts — extends prepare forwarding and legacy payload compatibility tests. (Test; M; +77/-0 lines.)

UseNewSessionCreatorInput and ContinueDestination accept optional launchSelection; PrepareSessionInput and ContinuePrepareInput share the provider mapping.
Both creators bind pending work to the account and organization; ordinary creation also tracks the repository and branch.
Retired work cannot clear the form, report errors, or navigate, and an older Continue completion cannot reset a replacement request's busy state.

Files
  • apps/mobile/src/components/agents/use-new-session-creator.ts — uses shared fingerprints and checks request ownership around uploads, persistence, cleanup, and navigation. Keeps bare-name GitHub retry bytes only without normalized input and writes the replacement row before removing the legacy row. (Source; M; +87/-76 lines.)
  • apps/mobile/src/components/agents/use-continue-cloud-create.ts — shares provider/branch mapping, keeps clone-only requests without a synthetic prompt, and ignores retired results through retry cleanup and navigation. (Source; M; +79/-80 lines.)
  • apps/mobile/src/components/agents/new-session-screen-body.tsx — checks account/organization scope before starting Continue, reporting errors, or clearing the shared busy state. (Source; M; +20/-1 lines.)
  • apps/mobile/src/components/agents/use-new-session-creator.test.ts — extends ordinary-creation contract tests. (Test; M; +156/-7 lines.)
  • apps/mobile/src/components/agents/use-new-session-creator.mounted.test.tsx — adds mounted coverage for ordinary creation, retries, and request retirement. (Test; A; +717/-0 lines.)
  • apps/mobile/src/components/agents/use-continue-cloud-create.test.ts — extends Continue input compatibility tests. (Test; M; +95/-0 lines.)
  • apps/mobile/src/components/agents/use-continue-cloud-create.mounted.test.tsx — adds mounted coverage for Continue retries and request retirement. (Test; A; +474/-0 lines.)
  • apps/mobile/src/components/agents/new-session-screen-body.mounted.test.tsx — adds the screen regression for overlapping Continue requests with both creators mounted. (Test; A; +394/-0 lines.)

resolveNewSessionStartDisabled and resolveContinueStartDisabled now accept ProviderLaunchContext and reject stale normalized selections before cloud submission.
isProviderLaunchSelectionCurrent applies the shared owner and branch checks; omitted selections and remote Continue admission keep their previous behavior.

Files
  • apps/mobile/src/lib/new-session-submit.ts — adds normalized selection checks to both cloud Start guards while retaining existing prompt, profile, model, attachment, and remote checks. (Source; M; +41/-28 lines.)
  • apps/mobile/src/lib/new-session-submit.test.ts — extends submit readiness tests for normalized selections. (Test; M; +53/-0 lines.)

useMutationOutbox updates its in-memory rows after successful writeSafeRetry and writeReconcileFirst writes, keeping saved operationKey values available to later retries.
Generation checks prevent late writes or removals from changing another account's state, and identity changes clear cached rows before reload.
Persistence ordering, safe-retry and reconcile-first rules, and terminal-failure handling stay unchanged.

Files
  • apps/mobile/src/lib/persist/use-mutation-outbox.ts — updates local rows after persistence, clears rows on identity changes, and applies write/remove results only to the current generation. (Source; M; +27/-6 lines.)
  • apps/mobile/src/lib/persist/use-mutation-outbox.test.ts — extends persisted key reuse and account-isolation coverage. (Test; M; +105/-0 lines.)

cliSessionsV2.recentRepositories adds account-scoped RecentRepositoryIdentity, and RecentAgentRepository exposes it without removing gitUrl or lastUsedAt.
History remains unique by URL, ordered by latest use, and limited to ten rows; discovery runs once per owner within each request.
Only one authorized provider/host/path match resolves; mixed owners, competing integrations, and incomplete discovery retain legacy-unresolved rows instead of guessing.

Files
  • apps/web/src/routers/cli-sessions-v2-router.ts — groups by URL before the limit and aggregates owner/provider evidence. Resolves authorized HTTP(S)/SSH matches, folds GitHub path case only, and retains ambiguous, not-found, or unavailable identities. Rejects URL queries/fragments and reuses discovery per owner. (Source; M; +145/-5 lines.)
  • apps/mobile/src/lib/hooks/use-agent-sessions.ts — exports the inferred RecentAgentRepository type without changing query inputs or legacy result fields. (Source; M; +4/-0 lines.)
  • apps/web/src/routers/cli-sessions-v2-router.test.ts — extends identity resolution and URL-unique recent-history coverage. (Test; M; +374/-1 lines.)

fetchAllGitHubRepositoriesForOrganization and fetchGitHubRepositoriesForUser add requireComplete, which defaults to false.
When true, discovery gathers all healthy integrations and rejects failed or unconfigured installations instead of resolving against partial results.
Organization browsing still accepts partial results, and personal browsing still uses one integration; recent lookups require complete discovery.

Files
  • apps/web/src/lib/cloud-agent/github-integration-helpers.ts — adds complete personal discovery and the shared completeness check, while preserving existing cached/fresh browsing behavior. (Source; M; +31/-10 lines.)
  • apps/web/src/lib/cloud-agent/github-integration-helpers.test.ts — extends complete-discovery and legacy browsing coverage. (Test; M; +104/-0 lines.)

FetchedSessionData now derives repository from runtime or stored Git URLs when githubRepo is absent.
gitUrl falls back to the runtime URL when the stored URL is missing, so older GitLab and Bitbucket sessions keep repository metadata.

Files
  • apps/mobile/src/components/agents/mobile-session-manager.ts — reconstructs repository display names across providers and supplies the runtime URL fallback; existing branch precedence stays unchanged. (Source; M; +6/-2 lines.)

Contract flow

Producer Contract Consumer
Normalized selection caller ProviderLaunchSelection, ProviderLaunchContext Shared launch mapping and both cloud Start guards
resolveProviderLaunchInput ProviderPrepareInput and repository fingerprint useNewSessionCreator, useContinueCloudCreate
Both creators Ordinary or clone-only prepare input with operationKey Personal and organization prepareSession
SDK caller Additive PrepareInput createSessionManager and the mobile prepare adapter
cliSessionsV2.recentRepositories RecentRepositoryIdentity plus legacy URL fields useRecentAgentRepositories, RecentAgentRepository

Tests: 11 files changed (4 added, 7 modified; +2,795/-8 lines): new-session-screen-body.mounted.test.tsx, provider-launch-input.test.ts, use-continue-cloud-create.mounted.test.tsx, use-continue-cloud-create.test.ts, use-new-session-creator.mounted.test.tsx, use-new-session-creator.test.ts, new-session-submit.test.ts, use-mutation-outbox.test.ts, github-integration-helpers.test.ts, cli-sessions-v2-router.test.ts, and session-manager.test.ts.
Generated: 0 files changed.


Visual Changes

Visual Changes: N/A

Verification

  • No manual tests ran for this level because runtime verification awaits the cumulative stack and belongs to the bot.
  • Live mobile behavior, actual checkout, and provider writes remain unverified.

Reviewer Notes

Human steps

  • before merge: Deploy the preceding token service and Cloud Agent changes before relying on pinned provider launches.
  • before merge: Require actual standard continuous integration (CI) execution, including the database route suite.
  • after merge: No additional human setup is required. This level adds no required environment values, secrets, migrations, or manual cache clearing.

The bot owns remaining verification.

Automated evidence

  • The implementer reports eight scoped checks passed, including 239 mobile tests, 259 SDK tests, and 37 GitHub helper tests.
  • The database route suite remains unverified locally because prepared no-setup inputs are missing.
  • This description does not establish passing CI, database tests, live checkout, provider writes, or full-section completion.

Notes

Runtime verification is pending for the cumulative stack; this level does not add the branch-selection UI.

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 ← this PR
  8. mobile-provider-parity-1d93-s8feat(mobile): select exact provider repositories and branches #5729
  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: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/routers/cli-sessions-v2-router.ts 113 Case-sensitive GitLab/Bitbucket path match fails against lowercased stored git_url values
Files Reviewed (22 files)
  • apps/mobile/src/components/agents/mobile-session-manager.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/use-continue-cloud-create.mounted.test.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.mounted.test.tsx
  • apps/mobile/src/components/agents/use-new-session-creator.test.ts
  • apps/mobile/src/components/agents/use-new-session-creator.ts
  • apps/mobile/src/lib/hooks/use-agent-sessions.ts
  • apps/mobile/src/lib/new-session-submit.test.ts
  • apps/mobile/src/lib/new-session-submit.ts
  • apps/mobile/src/lib/persist/use-mutation-outbox.test.ts
  • apps/mobile/src/lib/persist/use-mutation-outbox.ts
  • apps/web/src/lib/cloud-agent/github-integration-helpers.test.ts
  • apps/web/src/lib/cloud-agent/github-integration-helpers.ts
  • apps/web/src/routers/cli-sessions-v2-router.test.ts
  • apps/web/src/routers/cli-sessions-v2-router.ts - 1 issue
  • packages/cloud-agent-sdk/src/session-manager.test.ts
  • packages/cloud-agent-sdk/src/session-manager.ts

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 214.5K · Output: 26.5K · Cached: 1.3M

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

@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