feat(cloud-panel): persist selected repository across new sessions#3414
feat(cloud-panel): persist selected repository across new sessions#3414kilo-code-bot[bot] wants to merge 1 commit into
Conversation
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Issue Detail
In the current auto-select flow the impact is minimal: Suggested fix: add an explicit membership check before the cast: const VALID_PLATFORMS: RepositoryPlatform[] = ['github', 'gitlab'];
...
typeof (parsed as Record<string, unknown>).platform === 'string' &&
VALID_PLATFORMS.includes((parsed as Record<string, unknown>).platform as RepositoryPlatform)Files Reviewed (2 files)
Fix these issues in Kilo Cloud Reviewed by claude-sonnet-4.6 · 447,860 tokens Review guidance: REVIEW.md from base branch |
Summary
getLastUsedRepo/setLastUsedRepohelpers tomodel-preferences.ts, following the samesafeLocalStoragepattern used for model and variant persistence. The value is stored as JSON{ fullName, platform }undercloud-agent:last-used-repo:personalorcloud-agent:last-used-repo:organization:<id>.setLastUsedRepoinsidehandleRepoSelectwhenever the selection is user-initiated (clicking or typing in the repo picker).useEffectnow checks localStorage first and pre-selects the matching repository fromunifiedRepositoriesbefore falling back to the most-recently-used repo from the server query. If the stored repo is no longer in the user's repository list the effect silently falls through to the existing fallback behaviour.Verification
/cloud, remounting the panel).cloud-agent:last-used-repo:personal) and verify the panel falls back to the most recent repo from the server (original behaviour).Visual Changes
N/A
Reviewer Notes
as LastUsedRepocast ingetLastUsedRepois guarded by explicittypeofchecks for both required string fields (fullName,platform), so the cast does not hide real uncertainty.pnpm typecheckwas skipped because the monorepo build was killed by resource limits in this environment; targetedtsc --noEmiton the web app returned no errors.Built for Evgeny Shurakov by Kilo for Slack