feat: add cloud environment detection utilities (CLO-646) #11051
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
src/shared/cloud-environment.tswith utility functions:isCloudEnvironment()- checks if running in Roo Code Cloud viaROO_CODE_IPC_SOCKET_PATHgetAppEnvironment()- returns the app environment (development/preview/production) fromROO_CODE_APP_ENVisPreviewEnvironment(),isProductionEnvironment(),isDevelopmentEnvironment()- convenience helpersRelated PR:
ROO_CODE_APP_ENVfrom cloud infrastructure to the extensionTest Procedure
cd src && npx vitest run shared/__tests__/cloud-environment.spec.tsPre-Submission Checklist
Documentation Updates
Additional Notes
This is part of a two-PR set:
ROO_CODE_APP_ENVfrom SDK through worker to VS CodeBoth PRs should be deployed together for the full feature to work.
Important
Add utilities in
cloud-environment.tsfor detecting cloud environments and app environments, with comprehensive tests incloud-environment.spec.ts.isCloudEnvironment(): Checks forROO_CODE_IPC_SOCKET_PATHto determine cloud environment.getAppEnvironment(): Returns app environment fromROO_CODE_APP_ENV.isPreviewEnvironment(),isProductionEnvironment(),isDevelopmentEnvironment(): Helper functions for specific environments.cloud-environment.spec.tswith 18 test cases covering all utility functions and edge cases.This description was created by
for 15b0124. You can customize this summary. It will automatically update as commits are pushed.