Repository navigation
refactor(server): remove ~4k LOC of dead legacy surface from openwork-server - #4188
Merged
Merged
Conversation
Deletes server surface with zero production callers, verified by repo-wide caller sweeps: - blueprint session seeding (+ direct opencode-DB writes) — the UI caller was removed earlier; drops the better-sqlite3 native dep - workspace import preview/apply routes — desktop imports archives via workspace-archive.mjs; the renderer client methods were never called - POST /workspace/:id/extensions/export — no callers - legacy /experimental/google-workspace/* routes — superseded by /experimental/extensions/call (gating test now probes that path) - one-time legacy config migrations: /runtime-config/migrate route + helpers, the legacy-config-sweep boot sweep, and the Settings > Advanced migrate action (config source inspection stays) - file-session read-batch/write-batch/renew/catalog-events routes — no callers anywhere (den-gateway test hits a mock upstream, still green) Kept intact: OpenWork Connect MCP (managed MCP, connect state and catalogs, cloud MCP health) and cloud provider injection / managed provider auth. openwork-server suite: 751 pass / 8 skip / 1 fail / 1 error — the same single pre-existing env failure as clean origin/dev (bun 1.3.5 lacks node:sqlite for workspace-kv-store.node.test.ts); zero new failures. Server and app typechecks pass.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (7cc5e1db4fdf2fcaf15917312c1980d676eeba2d). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Contributor
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (56e13e93a7d2e1a1722780910727e004a7521140). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
This was referenced Aug 28, 2026
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
…-sdk (stack restack after #4188 merge)
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
…opencode-sdk (stack restack after #4188 merge)
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
…-list (stack restack after #4188 merge)
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
… (stack restack after #4188 merge)
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
…ools (stack restack after #4188 merge)
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
…er-routes (stack restack after #4188 merge)
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
…time-port (stack restack after #4188 merge)
benjaminshafii
pushed a commit
that referenced
this pull request
Aug 28, 2026
…tests (stack restack after #4188 merge)
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
apps/serveris ~38k LOC of non-test src on top of an engine (opencode) that already ships sessions, events, files, config, and MCP surfaces. For comparison, T3 Code drives opencode as one of five providers with ~2.6k LOC behind a 135-line adapter interface. The gap is duplication, dead surface, and legacy migrations — not features. This is phase 1 of thinning openwork-server to the smallest layer that adds real value over opencode: -3,951 / +66 lines, all of it surface with zero production callers (each verified by repo-wide sweeps acrossapps/,packages/,ee/, andevals/).Explicitly untouched: OpenWork Connect MCP (managed MCP connections, connect state/catalogs, cloud MCP health) and cloud provider injection / managed provider auth.
What's removed
POST /workspace/:id/blueprint/sessions/materialize,blueprint-sessions.ts,opencode-db.ts(direct writes into opencode's SQLite)use-workspace-route-state.ts). The direct opencode-SQLite coupling is gone; dependency declaration cleanup is deferred to avoid unrelated lockfile churn.sanitizeOpenworkTemplateConfigmoved toworkspace-export-safety.ts(still used by the keptGET /export).POST /workspace/:id/import,POST /workspace/:id/import/preview,workspace-import-preview.tsimportWorkspace/previewWorkspaceImporthad zero call sites; desktop imports archives via its ownworkspace-archive.mjs. Export (GET /workspace/:id/export) stays.POST /workspace/:id/extensions/export,extensions-export.tsGET/POST /experimental/google-workspace/*(7 routes) + the OAuth connect-flow manager wiringPOST /experimental/extensions/call(the gating test asserted equality between both paths; it now probes the extensions path). The google-workspace extension module and all 14 data actions are untouched.POST /workspace/:id/runtime-config/migrate+ merge/strip helpers,legacy-config-sweep.tsboot sweep,legacyOpenwork/migratableKeys/sweepfields onGET /runtime-configAdvancedRuntimeConfigSourcesSection); only the Migrate action and the sweep display in Debug are gone.read-batch,write-batch,renew,catalog/eventscatalog/snapshotandopsstay (used by the app). The den-gateway allowlist test hits a mock upstream and still passes unchanged.Verification
pnpm --filter openwork-server typecheck— passpnpm --filter @openwork/app typecheck— passpnpm --filter openwork-server test(bun):origin/devbaseline (same machine): 791 pass / 8 skip / 1 fail / 1 error — 800 tests, 105 filesworkspace-kv-store.node.test.tscannot resolvenode:sqliteunder bun 1.3.5 (pre-existing env issue, file untouched here). The −40 tests / −6 files are exactly the deleted test files. Zero new failures.extensions-connect-gating,runtime-opencode-config-store,file-sessions,artifact-files.e2e— 15 pass / 0 fail.pnpm install --frozen-lockfile --prefer-offlinepasses with the trusted existing lockfile metadata.Follow-ups (not in this PR)
server.tsinto "write runtime DB → writeOPENCODE_CONFIG→ reload" (needs care:cloud-mcp-health+ diagnostics read its state).automation-runner.mjs+@openwork/headless-threadsthrough the opencode proxy and drop the duplicated session wrapper endpoints.settings.runtime_config_legacy_cleanup_*etc.) and the now-caller-less google-workspace connect-flow exports.