Skip to content

CloudAgent - Unify cloud-next routes into cloud with feature flag gating#313

Merged
eshurakov merged 3 commits into
mainfrom
eshurakov/cloud-agent-unified
Feb 18, 2026
Merged

CloudAgent - Unify cloud-next routes into cloud with feature flag gating#313
eshurakov merged 3 commits into
mainfrom
eshurakov/cloud-agent-unified

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • Removes separate /cloud-next routes and sidebar entries, consolidating everything under /cloud
  • Gates the sessions list page behind a cloud-agent-next feature flag (always enabled in development)
  • Routes the chat page to old vs new UI based on session ID prefix (ses_ = next-gen)
  • Deletes the now-unused CloudSessionsPage component from cloud-agent-next/
  • Fixes incorrect callbackPath in the organization cloud page that was redirecting to /cloud instead of /organizations/<id>/cloud after sign-in

Remove separate /cloud-next routes and sidebar entries. The /cloud
routes now serve CloudNextSessionsPage directly and use isNewSession()
to decide whether to render the next-gen or legacy chat wrapper.
Delete unused cloud-agent-next/CloudSessionsPage.tsx and add
server-side PostHog feature flag check to both personal and org
cloud route pages, falling back to the legacy CloudSessionsPage
when the flag is disabled.
@kilo-code-bot

kilo-code-bot Bot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

This PR cleanly consolidates the /cloud-next routes into the existing /cloud routes. The approach is well-structured:

  • Sessions pages (/cloud, /organizations/[id]/cloud) use a feature flag (cloud-agent-next) + dev-mode check to decide between old and new sessions UI
  • Chat pages (/cloud/chat, /organizations/[id]/cloud/chat) use isNewSession(sessionId) (checking ses_ prefix) to route between old (CloudChatPageWrapper) and new (CloudChatPageWrapperNext) chat wrappers
  • Sidebar entries for "Cloud Next" are removed
  • All internal navigation paths updated from /cloud-next to /cloud
  • The large duplicate CloudSessionsPage.tsx (1030 lines) in cloud-agent-next is deleted
Files Reviewed (14 files)
  • src/lib/cloud-agent/session-type.ts (new) - Session type discriminator
  • src/app/(app)/cloud/chat/page.tsx - Added auth + session routing
  • src/app/(app)/cloud/chat/CloudChatPageWrapperNext.tsx (renamed) - Wrapper for next chat
  • src/app/(app)/cloud/page.tsx - Feature flag routing
  • src/app/(app)/organizations/[id]/cloud/chat/page.tsx - Added session routing
  • src/app/(app)/organizations/[id]/cloud/chat/CloudChatPageWrapperNext.tsx (renamed) - Org wrapper for next chat
  • src/app/(app)/organizations/[id]/cloud/page.tsx - Feature flag routing for orgs
  • src/app/(app)/components/PersonalAppSidebar.tsx - Removed Cloud Next sidebar entry
  • src/app/(app)/components/OrganizationAppSidebar.tsx - Removed Cloud Next sidebar entry
  • src/components/cloud-agent-next/ChatSidebar.tsx - Path update
  • src/components/cloud-agent-next/CloudChatContainer.tsx - Path updates
  • src/components/cloud-agent-next/CloudNextSessionsPage.tsx - Path updates + title change
  • src/components/cloud-agent-next/SessionsList.tsx - Path update
  • src/components/cloud-agent-next/hooks/useSessionDeletion.ts - Path update
  • Deleted: src/app/(app)/cloud-next/ pages, src/app/(app)/organizations/[id]/cloud-next/ pages, src/components/cloud-agent-next/CloudSessionsPage.tsx

@eshurakov eshurakov requested review from a team and RSO February 18, 2026 10:36
@eshurakov eshurakov merged commit 2c2bd63 into main Feb 18, 2026
12 checks passed
@eshurakov eshurakov deleted the eshurakov/cloud-agent-unified branch February 18, 2026 12:20
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