Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Added feature flag for opening vscode in a new tab (#8917)

tofarrb76553136e80
diff --git a/frontend/src/routes/vscode-tab.tsx b/frontend/src/routes/vscode-tab.tsx
index 139e1506f6..73068c0044 100644
--- a/frontend/src/routes/vscode-tab.tsx
+++ b/frontend/src/routes/vscode-tab.tsx
@@ -5,6 +5,7 @@ import { I18nKey } from "#/i18n/declaration";
import { RootState } from "#/store";
import { RUNTIME_INACTIVE_STATES } from "#/types/agent-state";
import { useVSCodeUrl } from "#/hooks/query/use-vscode-url";
+import { VSCODE_IN_NEW_TAB } from "#/utils/feature-flags";
function VSCodeTab() {
const { t } = useTranslation();
@@ -22,7 +23,9 @@ function VSCodeTab() {
const currentProtocol = window.location.protocol;
// Check if the iframe URL has a different protocol than the current page
- setIsCrossProtocol(iframeProtocol !== currentProtocol);
+ setIsCrossProtocol(
+ VSCODE_IN_NEW_TAB() || iframeProtocol !== currentProtocol,
+ );
} catch (e) {
// Silently handle URL parsing errors
setIframeError(t("VSCODE$URL_PARSE_ERROR"));
diff --git a/frontend/src/utils/feature-flags.ts b/frontend/src/utils/feature-flags.ts
index 6976dc91bb..db98c2d221 100644
--- a/frontend/src/utils/feature-flags.ts
+++ b/frontend/src/utils/feature-flags.ts
@@ -14,5 +14,6 @@ export function loadFeatureFlag(
export const BILLING_SETTINGS = () => loadFeatureFlag("BILLING_SETTINGS");
export const HIDE_LLM_SETTINGS = () => loadFeatureFlag("HIDE_LLM_SETTINGS");
+export const VSCODE_IN_NEW_TAB = () => loadFeatureFlag("VSCODE_IN_NEW_TAB");
export const ENABLE_TRAJECTORY_REPLAY = () =>
loadFeatureFlag("TRAJECTORY_REPLAY");