chore: drop dead constants, inert VITE_WORKER_URLS plumbing, and needless exports#1238
chore: drop dead constants, inert VITE_WORKER_URLS plumbing, and needless exports#1238hieptl wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Mock-LLM E2E Tests42/42 passed Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
📸 Snapshot Test ReportWarning Snapshot comparison step crashed (timeout, OOM, or runner error) — diff results below may be incomplete or absent. ✅ All snapshots match the main branch baselines.
✅ Unchanged snapshots (73)
Generated by the Snapshot Tests workflow. This comment was created by an AI agent (OpenHands) on behalf of the repo maintainers. |
🔶 Mock-LLM Docker E2E Test Results37/42 passed · 5 skipped Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
Why
Description:
Symbol-level cleanup across shared files — every removed symbol verified to have zero consumers:
src/utils/constants.ts:ASSET_FILE_TYPES(11 LOC),DOCUMENTATION_URL(6 LOC),GIT_PROVIDER_OPTIONS(13 LOC). No imports anywhere; the file's other exports (JSON_VIEW_THEME,PRODUCT_URL,SETTINGS_FORM,CHAT_INPUT,EPS,BTW_COMMAND,MODEL_COMMAND,BUILT_IN_COMMANDS,METADATA_PREFIXES) are all live and untouched.getConfiguredWorkerUrls()insrc/api/agent-server-config.ts(9 LOC) — an inert feature remnant. Its only caller (useUnifiedActiveHost) was deleted in PR feat(files-tab): Files tab with diff + rich/plain file viewer, safe-HTML markdown #284 (files-tab rework). Since then the documentedVITE_WORKER_URLSenv var has done nothing: the function reading it was never called. Removing the function, its three stalegetConfiguredWorkerUrls: vi.fn(() = [])test-mock-factory lines, and the misleading docs (.env.sample,AGENTS.mddeployment-env list,docs/DEVELOPMENT.mdenv table).normalizeBaseUrlstays — it has another live caller (VITE_BACKEND_BASE_URLhandling).MAX_FILE_SIZEandMAX_TOTAL_SIZEinsrc/utils/file-validation.ts— both are used internally by the validation functions but imported nowhere; droppingexportshrinks the API surface without behavior change. (MAX_TOTAL_SIZEis a small scope addition discovered during implementation: identical pattern, same file, same line of reasoning.)Scope (9 files, ~60 LOC removed):
src/utils/constants.tssrc/api/agent-server-config.tsgetConfiguredWorkerUrls()(~9 LOC)__tests__/api/agent-server-adapter.test.ts__tests__/api/agent-server-conversation-service.test.ts__tests__/api/use-create-conversation-metadata.test.ts.env.sampleVITE_WORKER_URLSsample lineAGENTS.mdVITE_WORKER_URLSdeployment-env bulletdocs/DEVELOPMENT.mdVITE_WORKER_URLSenv-table rowsrc/utils/file-validation.tsMAX_FILE_SIZE+MAX_TOTAL_SIZE(consts kept — used internally)Acceptance Criteria:
npm run lint,npm test,npm run build:liball pass (no new tests written).git grep "ASSET_FILE_TYPES\|DOCUMENTATION_URL\|GIT_PROVIDER_OPTIONS\|getConfiguredWorkerUrls\|VITE_WORKER_URLS"returns zero hits.validateIndividualFileSizes/ total-size validation behavior unchanged (consts still defined, just private).Out of scope / Notes:
Summary
Symbol-level dead-code cleanup (~60 LOC across 9 files): three never-imported constants, the
getConfiguredWorkerUrls()function that has been inert since PR #284 deleted its only caller (making the documentedVITE_WORKER_URLSenv var a no-op for weeks), the stale docs advertising that env var, and two needlessly exported file-size constants.Changes
src/utils/constants.ts— removeASSET_FILE_TYPES,DOCUMENTATION_URL,GIT_PROVIDER_OPTIONS(all other exports verified live and untouched)src/api/agent-server-config.ts— removegetConfiguredWorkerUrls();normalizeBaseUrlstays (live caller forVITE_BACKEND_BASE_URL)getConfiguredWorkerUrls: vi.fn(() = [])mock-factory lines.env.sample/AGENTS.md/docs/DEVELOPMENT.md— scrub the now-meaninglessVITE_WORKER_URLSdocumentationsrc/utils/file-validation.ts— un-exportMAX_FILE_SIZE+MAX_TOTAL_SIZE(kept as private consts; behavior identical)Verification
npm run lint✅ (exit 0) ·npm test✅ (exit 0 — 3016 passed | 12 skipped | 9 todo; zero test-count change, as only inert mock lines left test files) ·npm run build:lib✅ (exit 0)git grepfor every removed symbol andVITE_WORKER_URLS→ zero hits repo-wideRisk
Low. All removed symbols had zero consumers; the env-var docs described a feature that has not functioned since #284. Worth knowing: anyone who sets
VITE_WORKER_URLStoday already gets no effect — this PR just makes reality and documentation agree. If Browser-tab host probing returns, it should be rebuilt rather than revived from this remnant.Rollback
Revert this single commit; independent of all other units.
Issue Number
Resolves #1237
Type
🐳 Docker images for this PR
• GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas
ghcr.io/openhands/agent-canvasghcr.io/openhands/agent-server:1.26.0-pythonopenhands-automation==1.0.0a6d3ebf88baa25703885031cf7c9138a4ebda65e6bPull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-d3ebf88Run
All tags pushed for this build
About Multi-Architecture Support
sha-d3ebf88) is a multi-arch manifest supporting both amd64 and arm64sha-d3ebf88-amd64) are also available if needed