- Add CLOUD_INTEGRATION.md with detailed feature documentation - Add CLOUD_QUICKSTART.md for user-friendly quick start guide - Add CLOUD_ARCHITECTURE.md with technical architecture details - Update README.md to reference cloud features and documentation Addresses issue #6614 by documenting the existing cloud integration features that were already implemented in the codebase.
10 KiB
Roo Code Cloud Integration
This document provides comprehensive information about Roo Code's cloud integration features, including cloud-synchronized provider profiles, task sharing, and enhanced task lifecycle events.
Table of Contents
- Overview
- Cloud Authentication
- Cloud-Synchronized Provider Profiles
- Task Sharing
- Task Lifecycle Events
- Configuration
- API Reference
- Troubleshooting
Overview
Roo Code's cloud integration enables teams to collaborate more effectively by providing:
- Cloud-Synchronized Provider Profiles - Centralized management of API provider configurations across team members
- Task Sharing - Share tasks with your organization or publicly with configurable visibility
- Enhanced Task Lifecycle Events - Granular tracking of task states for analytics and monitoring
- Organization Settings - Centralized configuration management for teams
Cloud Authentication
Setting Up Authentication
Roo Code uses web-based authentication for cloud services. To authenticate:
- Click on the account button in the Roo Code interface
- Select "Sign in with Roo Cloud"
- Complete the authentication flow in your browser
- Return to VS Code once authenticated
Authentication States
The cloud service tracks several authentication states:
- Authenticated - User is signed in with valid credentials
- Has Active Session - User has an active session token
- Organization Member - User belongs to an organization with specific roles
Environment Variables
For automated environments, you can use:
ROO_CODE_CLOUD_TOKEN- Static authentication tokenROO_CODE_CLOUD_ORG_SETTINGS- Static organization settings (JSON format)
Cloud-Synchronized Provider Profiles
Overview
Provider profiles allow teams to share API configurations (models, endpoints, settings) across team members. When a profile is updated by an organization admin, all team members automatically receive the updates.
How It Works
- Profile Sync on Login - When you sign in to Roo Cloud, your provider profiles are automatically synchronized
- Real-time Updates - Profile changes are propagated to all team members in real-time
- Local Override - You can still create local profiles that won't be synchronized
Managing Cloud Profiles
Cloud profiles are managed through the CloudService and ProviderSettingsManager:
// Sync cloud profiles
await provider.syncCloudProfiles()
// The sync process:
// 1. Fetches organization settings from cloud
// 2. Compares with local profiles
// 3. Updates local profiles with cloud changes
// 4. Preserves local-only profiles
Profile Structure
Cloud-synchronized profiles include:
- API provider type (OpenAI, Anthropic, etc.)
- Model configurations
- Endpoint URLs
- Rate limits and quotas
- Custom headers and authentication
Task Sharing
Overview
Task sharing allows you to share your Roo Code conversations and results with your team or publicly. This is useful for:
- Knowledge sharing within teams
- Getting help from colleagues
- Creating reproducible examples
- Building a knowledge base
Sharing a Task
To share a task:
- Click the share button in the task interface
- Choose visibility:
- Organization - Only visible to your organization members
- Public - Visible to anyone with the link
- The share URL is automatically copied to your clipboard
Share Configuration
Organizations can configure sharing settings:
interface OrganizationCloudSettings {
recordTaskMessages?: boolean // Enable message recording
enableTaskSharing?: boolean // Enable sharing feature
taskShareExpirationDays?: number // Auto-expire shared tasks
allowMembersViewAllTasks?: boolean // Organization-wide visibility
}
API Usage
// Share a task programmatically
const result = await CloudService.instance.shareTask(
taskId,
"organization", // or "public"
clineMessages, // Optional: backfill messages if needed
)
// Check if sharing is enabled
const canShare = await CloudService.instance.canShareTask()
Task Lifecycle Events
Overview
Roo Code tracks detailed task lifecycle events for analytics, monitoring, and debugging purposes. These events provide insights into how tasks progress and where issues might occur.
Event Types
Task Provider Lifecycle
taskCreated- New task instance created
Task Lifecycle
taskStarted- Task execution beginstaskCompleted- Task finishes successfullytaskAborted- Task is cancelled by usertaskFocused- Task gains focus in UItaskUnfocused- Task loses focustaskActive- Task is actively processingtaskIdle- Task is waiting for input
Subtask Lifecycle
taskPaused- Parent task paused for subtasktaskUnpaused- Parent task resumestaskSpawned- New subtask created
Task Execution
message- New message in conversationtaskModeSwitched- Task switches mode (e.g., code to debug)taskAskResponded- User responds to task question
Task Analytics
taskTokenUsageUpdated- Token usage changestaskToolFailed- Tool execution fails
Event Handling
// Listen to task events
provider.on(RooCodeEventName.TaskCompleted, (taskId, tokenUsage, toolUsage) => {
console.log(`Task ${taskId} completed`)
console.log(`Tokens used: ${tokenUsage.total}`)
console.log(`Tools used: ${Object.keys(toolUsage).join(", ")}`)
})
// Emit custom events
task.emit(RooCodeEventName.TaskStarted)
Event Payloads
Each event includes relevant data:
interface TaskCompletedPayload {
taskId: string
tokenUsage: {
input: number
output: number
total: number
}
toolUsage: Record<string, number>
isSubtask: boolean
}
Configuration
Organization Settings
Organizations can configure default settings for all members:
interface OrganizationSettings {
version: number
cloudSettings?: OrganizationCloudSettings
defaultSettings: OrganizationDefaultSettings
allowList: OrganizationAllowList
providerProfiles?: Record<string, ProviderSettings>
}
Allow Lists
Control which models and providers team members can use:
interface OrganizationAllowList {
allowAll: boolean
providers: Record<
string,
{
allowAll: boolean
models?: string[]
}
>
}
Settings Synchronization
Settings are synchronized in the following order:
- Organization defaults (from cloud)
- User's cloud-synchronized settings
- Local workspace settings
- Local user preferences
API Reference
CloudService
The main service for cloud integration:
class CloudService {
// Authentication
async login(): Promise<void>
async logout(): Promise<void>
isAuthenticated(): boolean
getUserInfo(): CloudUserInfo | null
// Organization
getOrganizationId(): string | null
getOrganizationName(): string | null
getOrganizationRole(): string | null
// Settings
getAllowList(): OrganizationAllowList
getOrganizationSettings(): OrganizationSettings | undefined
// Task Sharing
async shareTask(taskId: string, visibility?: ShareVisibility): Promise<ShareResponse>
async canShareTask(): Promise<boolean>
}
CloudShareService
Handles task sharing functionality:
class CloudShareService {
async shareTask(taskId: string, visibility?: ShareVisibility): Promise<ShareResponse>
async canShareTask(): Promise<boolean>
}
CloudAPI
Low-level API client:
class CloudAPI {
async shareTask(taskId: string, visibility?: ShareVisibility): Promise<ShareResponse>
}
Troubleshooting
Common Issues
Authentication Failures
- Token Expired - Sign out and sign in again
- Network Issues - Check your internet connection
- Organization Not Found - Verify your organization membership
Profile Sync Issues
- Profiles Not Updating - Check cloud connection status
- Conflicts - Local changes may override cloud settings
- Missing Profiles - Ensure you have proper permissions
Task Sharing Problems
- Sharing Disabled - Check organization settings
- Task Not Found - Ensure task was properly recorded
- Permission Denied - Verify your organization role
Debug Mode
Enable debug logging for cloud services:
// In your VS Code settings
{
"rooCode.debug.cloudServices": true
}
Error Handling
All cloud operations include proper error handling:
try {
const result = await CloudService.instance.shareTask(taskId)
if (result.success) {
console.log("Shared at:", result.shareUrl)
}
} catch (error) {
if (error instanceof AuthenticationError) {
// Handle auth errors
} else if (error instanceof TaskNotFoundError) {
// Handle missing task
}
}
Security Considerations
- API Keys - Never share provider API keys through cloud profiles
- Sensitive Data - Be cautious when sharing tasks containing sensitive information
- Permissions - Regularly review organization member permissions
- Expiration - Set appropriate expiration times for shared tasks
Best Practices
-
Profile Management
- Use descriptive names for profiles
- Document profile purposes
- Regularly review and update profiles
-
Task Sharing
- Review task content before sharing
- Use organization visibility for internal discussions
- Set expiration for temporary shares
-
Event Tracking
- Monitor task completion rates
- Track tool usage patterns
- Identify common failure points
Future Enhancements
The cloud integration is continuously evolving. Planned features include:
- Enhanced collaboration tools
- Real-time task collaboration
- Advanced analytics dashboards
- Custom organization workflows
- Integration with external services
For the latest updates, check the CHANGELOG and join our Discord community.