π OpenHands: AI-Driven Development
fix: make load_public_skills default to true (opt-out) (#901)
Tim O'Farrellfc450ef0e96a
diff --git a/.env.sample b/.env.sampleindex a07368204d..88656258ff 100644--- a/.env.sample+++ b/.env.sample@@ -9,7 +9,7 @@ VITE_BACKEND_BASE_URL="http://127.0.0.1:8000" # Base URL used by browser-side di# VITE_WORKING_DIR="/workspace/project/agent-canvas" # Base dir for per-conversation working_dirs. Each conversation's working_dir is <VITE_WORKING_DIR>/<id_hex>. Defaults to <OH_CANVAS_SAFE_STATE_DIR>/workspaces, which is the sibling of the agent server's <state_dir>/conversations/ persistence dir β both share the same <id_hex> per conversation.# VITE_WORKER_URLS="" # Optional comma-separated worker URLs for the Browser tab# VITE_ENABLE_BROWSER_TOOLS="true" # Set to false to omit BrowserToolSet from new conversations-# VITE_LOAD_PUBLIC_SKILLS="true" # Set to true to enable loading public skills from https://github.com/OpenHands/extensions (off by default)+# VITE_LOAD_PUBLIC_SKILLS="false" # Set to false to disable loading public skills from https://github.com/OpenHands/extensions (on by default)# Frontend dev serverVITE_FRONTEND_PORT="3001" # Port to run the frontend applicationdiff --git a/AGENTS.md b/AGENTS.mdindex e8e101603a..0398b79f78 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -13,7 +13,7 @@- `VITE_WORKING_DIR` for the default workspace path sent when starting conversations.- `VITE_WORKER_URLS` as a comma-separated list of browser worker URLs if you want the Browser tab to probe exposed app hosts.- `VITE_ENABLE_BROWSER_TOOLS=false` to omit `BrowserToolSet` from new conversation payloads.- - `VITE_LOAD_PUBLIC_SKILLS=false` to disable loading public skills from the OpenHands extensions marketplace (https://github.com/OpenHands/extensions). Defaults to true.+ - `VITE_LOAD_PUBLIC_SKILLS=false` to disable loading public skills from the OpenHands extensions marketplace (https://github.com/OpenHands/extensions). Defaults to true (opt-out).- Default working-dir fallback is now the relative path `workspace/project` (exported as `DEFAULT_WORKING_DIR` from `src/api/agent-server-config.ts`); git-path heuristics and the default PLAN preview path should reuse that constant instead of hardcoding `/workspace/project`.- The UI keeps most OpenHands routes/layout intact, but hosted-only behavior (org, account management, integrations) has been removed via the fabricated OSS config because there is no separate app backend.- Verification command: `npm run typecheck && npm run build`.diff --git a/__tests__/api/agent-server-config.test.ts b/__tests__/api/agent-server-config.test.tsindex d2fdd6b28c..0fd06e88f2 100644--- a/__tests__/api/agent-server-config.test.ts+++ b/__tests__/api/agent-server-config.test.ts@@ -90,19 +90,19 @@ describe("agent server config", () => {expect(getAgentServerSessionApiKey()).toBe("saved-session-key");});- it("does not load public skills by default when VITE_LOAD_PUBLIC_SKILLS is unset", () => {+ it("loads public skills by default when VITE_LOAD_PUBLIC_SKILLS is unset", () => {vi.stubEnv("VITE_LOAD_PUBLIC_SKILLS", "");- expect(shouldLoadPublicSkills()).toBe(false);+ expect(shouldLoadPublicSkills()).toBe(true);});- it("loads public skills only when VITE_LOAD_PUBLIC_SKILLS is explicitly 'true'", () => {+ it("loads public skills when VITE_LOAD_PUBLIC_SKILLS is explicitly 'true'", () => {vi.stubEnv("VITE_LOAD_PUBLIC_SKILLS", "true");expect(shouldLoadPublicSkills()).toBe(true);});- it("does not load public skills for any non-'true' value of VITE_LOAD_PUBLIC_SKILLS", () => {+ it("does not load public skills only when VITE_LOAD_PUBLIC_SKILLS is explicitly 'false'", () => {vi.stubEnv("VITE_LOAD_PUBLIC_SKILLS", "false");expect(shouldLoadPublicSkills()).toBe(false);diff --git a/src/api/agent-server-config.ts b/src/api/agent-server-config.tsindex 9a7ab02d9f..c31e4e2780 100644--- a/src/api/agent-server-config.ts+++ b/src/api/agent-server-config.ts@@ -182,8 +182,8 @@ export function getAgentServerHeaders(): Record<string, string> {* Returns whether public skills from the OpenHands extensions marketplace* (https://github.com/OpenHands/extensions) should be loaded.*- * Defaults to false. Set VITE_LOAD_PUBLIC_SKILLS=true to enable.+ * Defaults to true. Set VITE_LOAD_PUBLIC_SKILLS=false to disable.*/export function shouldLoadPublicSkills(): boolean {- return import.meta.env.VITE_LOAD_PUBLIC_SKILLS === "true";+ return import.meta.env.VITE_LOAD_PUBLIC_SKILLS !== "false";}