Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 28, 2026

Related GitHub Issue

This PR is part of Linear issue CLO-646: Make cloud agents aware of preview environments.

Description

Adds cloud environment detection utilities to enable the Roo Code extension to detect when it is running in a preview environment (Roo Code Cloud) and adjust behavior accordingly.

Key changes:

  • Created src/shared/cloud-environment.ts with utility functions:
    • isCloudEnvironment() - checks if running in Roo Code Cloud via ROO_CODE_IPC_SOCKET_PATH
    • getAppEnvironment() - returns the app environment (development/preview/production) from ROO_CODE_APP_ENV
    • isPreviewEnvironment(), isProductionEnvironment(), isDevelopmentEnvironment() - convenience helpers
  • Added comprehensive tests with 18 test cases covering all scenarios

Related PR:

  • RooCodeInc/Roo-Code-Cloud#2253 - Passes ROO_CODE_APP_ENV from cloud infrastructure to the extension

Test Procedure

  1. Unit tests added: Run cd src && npx vitest run shared/__tests__/cloud-environment.spec.ts
  2. All 18 tests pass covering:
    • Cloud environment detection
    • App environment parsing
    • Preview/production/development environment detection
    • Edge cases (missing env vars, invalid values)

Pre-Submission Checklist

  • Issue Linked: This PR is linked to Linear issue CLO-646
  • Scope: Changes are focused on cloud environment detection utilities only
  • Self-Review: I have performed a thorough self-review of my code
  • Testing: Tests added with 18 test cases covering all utilities
  • Documentation Impact: JSDoc documentation added to all functions
  • Contribution Guidelines: I have read the Contributor Guidelines

Documentation Updates

  • No documentation updates are required - internal utilities

Additional Notes

This is part of a two-PR set:

  1. Roo-Code-Cloud#2253: Infrastructure changes to pass ROO_CODE_APP_ENV from SDK through worker to VS Code
  2. This PR: Extension-side utilities to read and interpret the environment

Both PRs should be deployed together for the full feature to work.


Important

Add utilities in cloud-environment.ts for detecting cloud environments and app environments, with comprehensive tests in cloud-environment.spec.ts.

  • Utilities:
    • isCloudEnvironment(): Checks for ROO_CODE_IPC_SOCKET_PATH to determine cloud environment.
    • getAppEnvironment(): Returns app environment from ROO_CODE_APP_ENV.
    • isPreviewEnvironment(), isProductionEnvironment(), isDevelopmentEnvironment(): Helper functions for specific environments.
  • Tests:
    • Added cloud-environment.spec.ts with 18 test cases covering all utility functions and edge cases.

This description was created by Ellipsis for 15b0124. You can customize this summary. It will automatically update as commits are pushed.

- Add cloud-environment.ts with utilities to detect cloud and preview environments
- Add isCloudEnvironment() to check if running in Roo Code Cloud
- Add getAppEnvironment() to get the app environment (development/preview/production)
- Add isPreviewEnvironment(), isProductionEnvironment(), isDevelopmentEnvironment() helpers
- Add comprehensive tests for all utilities

This enables features to behave differently based on the cloud deployment
environment, such as detecting preview environments.
@roomote roomote bot requested review from cte, jr and mrubens as code owners January 28, 2026 18:35
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Jan 28, 2026
@roomote
Copy link
Contributor Author

roomote bot commented Jan 28, 2026

Rooviewer Clock   See task on Roo Cloud

Reviewed the cloud environment detection utilities. The implementation is clean, well-documented, and properly tested.

  • No issues found

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@mrubens mrubens closed this Jan 28, 2026
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 28, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants