Skip to content

πŸ™Œ OpenHands: AI-Driven Development

chore: drop dead constants, inert VITE_WORKER_URLS plumbing, and needless exports (#1238)

Hiep Lefbcb8084d74e
diff --git a/.env.sample b/.env.sample
index 85b02596aa..04354c0448 100644
--- a/.env.sample
+++ b/.env.sample
@@ -10,7 +10,6 @@ VITE_BACKEND_BASE_URL="http://127.0.0.1:8000" # Base URL used by browser-side di
# and docs/ACP_AGENTS.md β†’ "Running ACP agents in a Docker container".
# VITE_SESSION_API_KEY="" # Set to the same value as backend SESSION_API_KEY or OH_SESSION_API_KEYS_0 when auth is enabled
# 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
# Frontend dev server
diff --git a/AGENTS.md b/AGENTS.md
index 4ec6835ef6..e07c05408a 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -11,7 +11,6 @@
- `VITE_BACKEND_BASE_URL` for the agent server base URL.
- `VITE_SESSION_API_KEY` for optional session auth.
- `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.
- Public skills are loaded from the `@openhands/extensions` npm package at build time via `SKILLS_CATALOG` (exported from `@openhands/extensions/skills`). The frontend's `SkillsService` maps catalog entries to `SkillInfo` objects and merges them with user/project skills fetched from the agent-server (with `load_public: false`). The agent-server no longer clones the extensions repo or uses `EXTENSIONS_REF` for public skills.
- 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`.
diff --git a/__tests__/api/agent-server-adapter.test.ts b/__tests__/api/agent-server-adapter.test.ts
index acd819bdc0..89c8dcf8a9 100644
--- a/__tests__/api/agent-server-adapter.test.ts
+++ b/__tests__/api/agent-server-adapter.test.ts
@@ -35,7 +35,6 @@ vi.mock("#/api/agent-server-config", () => ({
getAgentServerBaseUrl: vi.fn(() => "http://127.0.0.1:8000"),
getAgentServerSessionApiKey: vi.fn(() => null),
getAgentServerWorkingDir: mockGetAgentServerWorkingDir,
- getConfiguredWorkerUrls: vi.fn(() => []),
shouldLoadPublicSkills: vi.fn(() => true),
syncBakedSessionApiKey: vi.fn(),
}));
diff --git a/__tests__/api/agent-server-conversation-service.test.ts b/__tests__/api/agent-server-conversation-service.test.ts
index 6f72989b99..de7e97ab3c 100644
--- a/__tests__/api/agent-server-conversation-service.test.ts
+++ b/__tests__/api/agent-server-conversation-service.test.ts
@@ -79,7 +79,6 @@ vi.mock("#/api/agent-server-config", () => ({
buildConversationWorkingDir: vi.fn(
(id: string) => `/state/workspaces/${id.replace(/-/g, "")}`,
),
- getConfiguredWorkerUrls: vi.fn(() => []),
getAgentServerHeaders: vi.fn(() => ({ "X-Session-API-Key": "test-api-key" })),
shouldLoadPublicSkills: vi.fn(() => true),
syncBakedSessionApiKey: vi.fn(),
diff --git a/__tests__/api/use-create-conversation-metadata.test.ts b/__tests__/api/use-create-conversation-metadata.test.ts
index 5fae5835c3..52d45db7b4 100644
--- a/__tests__/api/use-create-conversation-metadata.test.ts
+++ b/__tests__/api/use-create-conversation-metadata.test.ts
@@ -52,7 +52,6 @@ vi.mock("#/api/agent-server-config", () => ({
buildConversationWorkingDir: vi.fn(
(id: string) => `/state/workspaces/${id.replace(/-/g, "")}`,
),
- getConfiguredWorkerUrls: vi.fn(() => []),
shouldLoadPublicSkills: vi.fn(() => true),
syncBakedSessionApiKey: vi.fn(),
}));
diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md
index 321a14935c..97f08fc42d 100644
--- a/docs/DEVELOPMENT.md
+++ b/docs/DEVELOPMENT.md
@@ -160,7 +160,6 @@ You can create a `.env` file in the project directory with these variables based
| `VITE_BACKEND_HOST` | Backend host used by the Vite dev proxy | `127.0.0.1:8000` |
| `VITE_SESSION_API_KEY` | (Internal) Session API key injected by the launcher β€” set `LOCAL_BACKEND_API_KEY` instead | - |
| `VITE_WORKING_DIR` | Workspace path sent when starting new conversations | `workspace/project` |
-| `VITE_WORKER_URLS` | Optional comma-separated worker/app URLs for the Browser tab | - |
| `VITE_ENABLE_BROWSER_TOOLS` | Set to `false` to omit `BrowserToolSet` from new conversation payloads | `true` |
| `VITE_MOCK_API` | Enable/disable API mocking with MSW | `false` |
| `VITE_USE_TLS` | Use HTTPS/WSS for the Vite proxy target | `false` |
diff --git a/src/api/agent-server-config.ts b/src/api/agent-server-config.ts
index a161a34924..bfd0aa35b8 100644
--- a/src/api/agent-server-config.ts
+++ b/src/api/agent-server-config.ts
@@ -97,16 +97,6 @@ export function buildConversationWorkingDir(conversationId: string): string {
return `${base}/${hex}`;
}
-export function getConfiguredWorkerUrls(): string[] {
- const raw = import.meta.env.VITE_WORKER_URLS?.trim();
- if (!raw) return [];
-
- return raw
- .split(",")
- .map((url: string) => normalizeBaseUrl(url))
- .filter((url: string | null): url is string => Boolean(url));
-}
-
export function getAgentServerHeaders(): Record<string, string> {
const sessionApiKey = getAgentServerSessionApiKey();
return sessionApiKey ? { "X-Session-API-Key": sessionApiKey } : {};
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index b22362e652..d2a37bde27 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -1,17 +1,5 @@
import { SlashCommandItem } from "#/hooks/chat/use-slash-command";
-export const ASSET_FILE_TYPES = [
- ".png",
- ".jpg",
- ".jpeg",
- ".bmp",
- ".gif",
- ".pdf",
- ".mp4",
- ".webm",
- ".ogg",
-];
-
export const JSON_VIEW_THEME = {
base00: "transparent", // background
base01: "var(--cool-grey-900)", // lighter background
@@ -31,13 +19,6 @@ export const JSON_VIEW_THEME = {
base0F: "#ff5370", // deprecated, red
};
-export const DOCUMENTATION_URL = {
- MICROAGENTS: {
- MICROAGENTS_OVERVIEW:
- "https://docs.all-hands.dev/usage/prompting/microagents-overview",
- },
-};
-
export const PRODUCT_URL = {
PRODUCTION: "https://app.all-hands.dev",
};
@@ -46,21 +27,6 @@ export const SETTINGS_FORM = {
LABEL_CLASSNAME: "text-[11px] font-medium leading-4 tracking-[0.11px]",
};
-export const GIT_PROVIDER_OPTIONS = [
- {
- label: "GitHub",
- value: "github",
- },
- {
- label: "GitLab",
- value: "gitlab",
- },
- {
- label: "Bitbucket",
- value: "bitbucket",
- },
-];
-
// Chat input constants
export const CHAT_INPUT = {
HEIGHT_THRESHOLD: 100, // Height in pixels when suggestions should be hidden
diff --git a/src/utils/file-validation.ts b/src/utils/file-validation.ts
index 490912d506..0f3736af3a 100644
--- a/src/utils/file-validation.ts
+++ b/src/utils/file-validation.ts
@@ -1,5 +1,5 @@
-export const MAX_FILE_SIZE = 3 * 1024 * 1024; // 3MB maximum file size
-export const MAX_TOTAL_SIZE = 3 * 1024 * 1024; // 3MB maximum total size for all files combined
+const MAX_FILE_SIZE = 3 * 1024 * 1024; // 3MB maximum file size
+const MAX_TOTAL_SIZE = 3 * 1024 * 1024; // 3MB maximum total size for all files combined
export interface FileValidationResult {
isValid: boolean;