Skip to content

chore: delete dead code, unused deps and orphaned assets - #5647

Merged
benjaminshafii merged 2 commits into
devfrom
chore/delete-dead-code
Oct 5, 2026
Merged

benjaminshafii merged 2 commits into
devfrom
chore/delete-dead-code

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

What is this about?

Deletes code, dependencies and assets that nothing in the app, desktop, server or Den reaches. About 15k lines go, with no behaviour change.

What problem does it solve?

Dead modules, stale IPC commands and orphaned scripts are more to read, search and compile, for people and agents. Some dead desktop commands could still write files when called.

What was the situation before?

Leftovers from the React port, the Tauri migration, the menu overlay and removed tests still compiled and shipped. Unrelated PRs kept editing them.

How is this implemented?

  • Builds on the local chore/dead-code-sweep WIP, rebased on dev and re-checked against everything merged since.
  • Each deletion is confirmed by knip (new knip.jsonc) and a repo-wide search, including .github and .opencode.
  • App: orphaned modules and exports, the unregistered OpenAI image settings state, the unused microsandboxCreateSandbox flag, unused i18n keys and images.
  • Desktop: 16 IPC handlers that nothing calls, with their types and re-exports, plus 7 unused browser and microphone channels.
  • Den and repo: orphaned landing components, den-api stubs, test helpers whose tests are gone, apps/ui-demo, migration and broken dev scripts, the den-controller stub.

What else changed?

  • Removes 15 unused dependencies.
  • scripts/find-unused.sh is now a thin pnpm dlx knip wrapper.
  • Ignores *.tsbuildinfo and drops committed build state and evals/results files.

Release note

none

Evidence

No E2E; deletion only. Typecheck passes for app, server, desktop, den-api, den-web, landing, gateway and telemetry. The app builds, the app boot test passes (2 tests), and the desktop electron tests pass (62).

Remove code that nothing reaches, verified against origin/dev with knip
(new knip.jsonc) plus manual reference checks, including hidden dirs.
Typecheck passes for app, server, desktop, den-api, den-web, landing,
gateway and telemetry; the app builds; app boot and desktop tests pass.

App (apps/app):
- React-port leftovers and orphaned modules: actions store/provider,
  global sync and SDK providers, unused settings, connections and session
  modules, test-only helpers and their scripts.
- Dead exports: unused utils, Advanced sections, migration deferral
  helpers, compactSession, the deprecated signUpEmail stub.
- The unregistered OpenAI image settings state and the never-read
  microsandboxCreateSandbox flag.
- The menu-overlay renderer (native context menus replaced it in #4650),
  unused i18n keys and 192 unused grain-art images.
- Deps: @ai-sdk/react, @radix-ui/colors,
  @radix-ui/react-use-controllable-state, remark-breaks, remark-gfm.

Desktop (apps/desktop) and types:
- 16 renderer-unreachable IPC handlers and their types and re-exports
  (some wrote files), plus 7 unused browser and microphone channels.
- menu-overlay preload, unused dev icons, electron-devtools-installer.

Server (apps/server):
- Unused exports, @types/minimatch, @openwork/headless-threads and the
  opencode-chrome-devtools devDep with its module declaration (the
  bundled openwork-chrome-devtools plugin replaced it in #4423).

Den:
- Orphaned landing components, the den-api plugin-system barrel and
  desktop-policy-role-assignments re-export, a test-only cache hook,
  test helpers and evidence scripts left without tests, and unused deps
  (grammy, drizzle-orm in gateway, zod in telemetry).

Repo:
- apps/ui-demo, Tauri migration scripts, the broken dev-web-local and
  dev-den-local scripts, the den-controller stub and DEN_CONTROLLER_PORT,
  one-off scripts, HANDOFF.md, committed tsbuildinfo files and tracked
  evals/results output, the Remote MCP Apps docs.
- Add knip.jsonc and make scripts/find-unused.sh a thin knip wrapper
  that uses pnpm.

Signed-off-by: Benjamin Shafii <[email protected]>
@benjaminshafii
benjaminshafii requested a review from a team October 5, 2026 07:05
@mintlify

mintlify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
differentai 🟢 Ready View Preview Oct 5, 2026, 7:05 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Oct 5, 2026 7:58am UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Oct 5, 2026 7:58am UTC
openwork-diagnostics Skipped Skipped Oct 5, 2026 7:58am UTC
openwork-landing Skipped Skipped Oct 5, 2026 7:58am UTC

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

OpenWork evidence

Status Commit Preview Updated
🟢 Ready · evidence passed b045ac7 Open preview 2026-10-05 08:02:52 UTC

Run details · Open the preview to inspect evidence and sandbox options.

lib/artifacts.ts keeps ArtifactType, getArtifactType and
useOpenArtifactPath; the rest had no production caller and its tests
were already removed.

Signed-off-by: Benjamin Shafii <[email protected]>

This branch was successfully deployed

3 active (1 outdated) and 4 inactive deployments
Evidence / PR 5647 — b045ac7f Deployed Oct 5, 2026 by github-actions[bot]
Preview – openwork-app — b045ac7f Deployed Oct 5, 2026 by vercel[bot]
Preview – openwork-landing — b045ac7f Deployed Oct 5, 2026 by vercel[bot]
Preview – openwork-den — b045ac7f Deployed Oct 5, 2026 by vercel[bot]
Preview – openwork-diagnostics — b045ac7f Deployed Oct 5, 2026 by vercel[bot]
staging - packages/docs — faf5bd7f Deployed Oct 5, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant