Skip to content

fix(cloud-agent): remember environments and preserve default profiles - #9723

Merged
eshurakov merged 1 commit into
mainfrom
fix/cloud-environment-selection
Nov 4, 2026
Merged

eshurakov merged 1 commit into
mainfrom
fix/cloud-environment-selection

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • Remember the exact last selected environment per repository and personal/organization owner scope. Restore it only if it still matches the repository; otherwise require a valid choice. Preserve automatic selection for a single match and tolerate unavailable browser storage.
  • Keep the effective default profile active across environment switches, including V2 environments. V2 repository bindings remain ignored, and an explicit profile replaces the default. Align the profile picker and custom-agent preview with server-side resolution.
  • Preserve the supplied hook, picker, and DB-backed regression tests; update session rules 15/17 and add the pinned linkedom test dependency and lockfile entry.

Applied the supplied patch unchanged to current origin/main (fe50ac74d4af02555b9b1bfeab37cabb8a7d3356), without conflicts or adaptations. Reviewed git diff origin/main...HEAD.

Validation

  • Node v24.22.1, pnpm 11.1.2.
  • pnpm install --filter web... --filter @kilocode/cloud-agent-profile... --filter @kilocode/trpc... --frozen-lockfile --ignore-scripts: passed.
  • In packages/cloud-agent-profile, pnpm exec vitest run --no-file-parallelism: 324 tests passed across 17 files; pnpm typecheck: passed.
  • In apps/web, pnpm test --runInBand --runTestsByPath src/hooks/useSessionEnvironment.test.ts src/components/cloud-agent/ProfilePickerPopover.test.ts src/components/cloud-agent-next/environment-selection.test.ts src/components/cloud-agent-next/EnvironmentAccess.test.ts src/tests/cloud-agent-profile/profile-session-config.test.ts: 80 tests passed across all five suites. Used a local PostgreSQL 17 database with pgvector and the repository's unmodified Jest migration/setup flow; Docker is unavailable in this sandbox.
  • From the repository root, pnpm exec oxlint --config .oxlintrc.json on all 12 changed TS/TSX files: passed.
  • From the repository root, pnpm exec oxfmt --check with all 15 changed paths: passed (13 files matched after repository ignore rules).
  • git diff --check origin/main...HEAD: passed.
  • Full apps/web typecheck was attempted with timeout --kill-after=5s 195s pnpm typecheck but did not complete within the limit. The tRPC build completed with Rollup warnings; the full web typecheck is not claimed as passing.

@kilo-code-bot

kilo-code-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the environment-choice persistence and the V2 default-profile change across the shared resolution package, web hooks/UI, tests, spec, and lockfile; client and server resolution stay aligned and no defects were found.

Assumptions: none.

Files Reviewed (15 files)
  • .specs/cloud-agent-session.md
  • apps/web/package.json
  • apps/web/src/components/cloud-agent-next/NewSessionPanel.tsx
  • apps/web/src/components/cloud-agent/ProfilePickerPopover.test.ts
  • apps/web/src/components/cloud-agent/ProfilePickerPopover.tsx
  • apps/web/src/hooks/useEnvironmentProfiles.ts
  • apps/web/src/hooks/useSessionEnvironment.test.ts
  • apps/web/src/hooks/useSessionEnvironment.ts
  • apps/web/src/hooks/useSessionProfileLayers.ts
  • apps/web/src/tests/cloud-agent-profile/profile-session-config.test.ts
  • packages/cloud-agent-profile/src/index.ts
  • packages/cloud-agent-profile/src/profile-resolution.test.ts
  • packages/cloud-agent-profile/src/profile-resolution.ts
  • packages/cloud-agent-profile/src/profile-session-config.ts
  • pnpm-lock.yaml

Reviewed by deepseek-flash-latest · Input: 102.3K · Output: 30K · Cached: 2.4M

Review guidance: REVIEW.md from base branch main

@eshurakov
eshurakov added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit f7d81e5 Nov 4, 2026
62 checks passed
@eshurakov
eshurakov deleted the fix/cloud-environment-selection branch November 4, 2026 09:30
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.

2 participants