Repository navigation
chore(link): remove the desktop link feature - #5570
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 150 files
You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
CI:
- knip: drop the `vite` devDependency orphaned with the link daemon
- unit: realign the ban-e2e-app-imports test with the narrowed allowlist,
and invert it — the dropped packages must now be rejected
Review (cubic):
- P1 resolve-provider: normalize the resolved KIND alongside the provider.
`user-desktop` bound the hosted provider but still reported itself, so a
caller persisting that kind recorded a sandboxMap row with no runner.
Inverted the two tests that asserted the mismatch.
- P2 remove the desktop-only background subtask delivery path:
THREAD_SUBTASK_DELIVER, deliverBackgroundSubtaskResult, and the orphaned
createDesktopSubtaskDispatcher (its only caller was the deleted daemon).
- P3 remove the dead `--local-sandbox-provider` / `--hot` CLI flags from the
parser, help, shell completion and every dev script, so they error instead
of silently doing nothing; setDevMode's link-only services go with them.
- P3 inline `{ cwd: null }` in dispatch-run — buildHarnessWorkspaceInput's
repo branch was unreachable once hosted runs stopped mounting /repo.
- P3 drop the timeout contract from the thread gate; nothing set timeoutMs
or runTimeoutMs and no abort signal was ever constructed.
Also deletes smoke-link.ts, which probed the removed /api/links/me route.
decocms Bot
pushed a commit
that referenced
this pull request
Aug 2, 2026
PR: #5570 chore(link): remove the desktop link feature Bump type: patch - decocms (apps/api/package.json): 4.160.1 -> 4.160.2 - @decocms/native (apps/native/package.json): 4.160.1 -> 4.160.2 - @decocms/e2e (packages/e2e/package.json): 1.27.1 -> 1.27.2 - @decocms/harness (packages/harness/package.json): 2.8.2 -> 2.8.3 - @decocms/sandbox (packages/sandbox/package.json): 1.35.2 -> 1.35.3 - @decocms/shared (packages/shared/package.json): 0.13.1 -> 0.13.2 - deploy/helm/sandbox-env (chart 0.10.2) (deploy/helm/sandbox-env/values.yaml deploy/helm/sandbox-env/Chart.yaml): image.tag/appVersion -> 1.35.3 Deploy-Scope: both
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
…harnesses `assertHarnessRunsInCluster` throws for claude-code/codex at the dispatch gate, and `dispatchRunAndWait` throws again on any non-decopilot id — so the factories the barrel registered could never be reached by a lookup. Local CLI runs happen in the Tauri app's Rust harness crate; cloud-CLI is unimplemented. Also removes `buildSandboxDaemon()` from the server bundler: it built packages/sandbox's daemon bundle + typegen tarball on every API build for host/runner.ts's text-import, and that file no longer exists (#5570). The sandbox image workflow runs its own `bun run --cwd=packages/sandbox build`, so the image is unaffected.
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
… on the package (#5573) * chore(harness): drop the unreachable cluster registration of the CLI harnesses `assertHarnessRunsInCluster` throws for claude-code/codex at the dispatch gate, and `dispatchRunAndWait` throws again on any non-decopilot id — so the factories the barrel registered could never be reached by a lookup. Local CLI runs happen in the Tauri app's Rust harness crate; cloud-CLI is unimplemented. Also removes `buildSandboxDaemon()` from the server bundler: it built packages/sandbox's daemon bundle + typegen tarball on every API build for host/runner.ts's text-import, and that file no longer exists (#5570). The sandbox image workflow runs its own `bun run --cwd=packages/sandbox build`, so the image is unaffected. * chore(harness): drop the source-text assertions from the registration test Asserting a file's source does not contain a symbol tests the deletion, not the behavior. The registry lookup is already covered by the gate's own tests. * chore(harness): delete the TypeScript CLI harnesses, now that nothing hosts them #5575 deleted the TS sandbox daemon, which was the last runtime that registered `claudeCodeHarnessFactory`/`codexHarnessFactory`; the preceding commit dropped the cluster's unreachable registration. That left the whole TS CLI harness implementation with zero production consumers — the live one is Rust (`apps/native/crates/harness`), which is a port, not a consumer. Deleted: packages/harness/src/{codex,claude-code/index,resolve-executable, model/index}, cli-session-error, cli-stream-metadata, the ./claude-code and ./codex export subpaths, and the ai-sdk-provider-{claude-code,codex-cli} deps. Kept: claude-code/model/agent-tiers.ts + chat-tier.ts (apps/web and apps/api import `resolveAgentTier` to build the model picker), and cli-harness.ts's `cliProviderName` (the read side of CLI session resume). Knip could not see any of this: packages/harness's exports map has a "./*" glob, so every src file looks like a public entrypoint. - cli-import-boundary.test.ts deleted: it read claude-code/index.ts and codex/index.ts off disk, so it fails ENOENT once they are gone. - cli-harness.test.ts covered only `isCliHarness`, which was dead. Repointed to `cliProviderName` — the surviving export, and a cross-language contract with the Rust crate that had no test at all. - cli-message-prep.ts lost `prepCliMessages` (CLI-only) and kept `extractUserText` (decopilot). Renamed to extract-user-text.ts so the filename stops describing code that is gone. * docs(harness): correct the README for a package with one harness The overview still advertised Claude Code and Codex harnesses, a codex usage example, and "portable between the API and sandbox daemon" as the boundary rationale — all three are gone. Restates the real one: apps/web and packages/sandbox are lint-barred from apps/api/src, so the contracts the three share have to live outside the API. * chore(harness): enumerate the exports map so knip can see this package packages/harness's exports ended in "./*": ["./src/*.ts", "./src/*/index.ts"], so every file under src/ looked like a public entry point and knip could never report anything here as unused. That is how ~2k lines of dead CLI harness code stayed invisible until it was grepped by hand. Replaces the glob with the 56 subpaths actually imported (plus "."), generated from the real import specifiers across apps/ and packages/ and verified to resolve. No consumer changes: bun run check passes in all 15 workspaces. Knip now reports on this package, and immediately found two things the glob was hiding: - no-background-tasks-prompt.ts — a system-prompt fragment whose own doc says "shared across CLI harnesses (claude-code, codex)"; orphaned when those were deleted. Removed. - THOUGHT_SIGNATURE_SEPARATOR — used only inside its own module. Narrowed to module-private. No guard test: a missing entry is already a compile error (TS2307) on bun run check. Documented in the README, since that message reads as "file missing" when the file is merely unexported.
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
…arness registry Final step of the harness-package teardown (#5573 deleted the dead TS CLI harnesses; #5577 moved the wire contracts to @decocms/shared/harness). After those, the package was 9.5k lines consumed by apps/api alone — its stated reason to exist (portability into the desktop daemon's bundle) died with the link daemon (#5570) and the TS sandbox daemon (#5575). The move: - packages/harness/src → apps/api/src/harnesses/lib (git mv, history kept). 58 api files rewritten from "@decocms/harness/X" to "@/harnesses/lib/X". All the lib's deps were already in apps/api's manifest; the workspace package, its README, tsconfig and dependency edges are gone. - The leaf discipline survives as a directory rule: ban-cross-tree-imports now applies its harness clauses (no @/ imports, no @/core/studio-context, no @aws-sdk/*) to apps/api/src/harnesses/lib/, and no-cross-tree.test.ts moved with the tree and still guards it. The engine stays a leaf; only the package wrapper is gone. The registry collapse (spec §5.4, executed at last): - InProcessSandboxClient absorbs localDispatch and hard-wires decopilotHarnessFactory — the registry it consulted was a Map with one entry, populated by an import side effect. registry.ts, localDispatch, the orphaned lib barrel and their registration tests are deleted; the client's tests now assert the real factory's contract (eager CLI guard, lazy stream) instead of stubbing a seam. - apps/api/src/harnesses/index.ts keeps one side effect: registering the cluster environment builder the factory requires. Fallout knip caught once the package boundary stopped hiding it: - buildRepoEnvironmentPrompt: dead (nothing builds that prompt block). Deleted. - CHAT_MODES: only its derived type is consumed. Narrowed to module-private. DBOS workflow-source snapshot re-baselined (import-specifier text is hashed; apps/api/scripts/update-workflow-source-snapshot.ts, 8 hashes). Infra: sandbox-daemon.yml change filter, release-changes test fixtures, root README workspace table, bundle-server-script comment.
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
…arness registry (#5578) Final step of the harness-package teardown (#5573 deleted the dead TS CLI harnesses; #5577 moved the wire contracts to @decocms/shared/harness). After those, the package was 9.5k lines consumed by apps/api alone — its stated reason to exist (portability into the desktop daemon's bundle) died with the link daemon (#5570) and the TS sandbox daemon (#5575). The move: - packages/harness/src → apps/api/src/harnesses/lib (git mv, history kept). 58 api files rewritten from "@decocms/harness/X" to "@/harnesses/lib/X". All the lib's deps were already in apps/api's manifest; the workspace package, its README, tsconfig and dependency edges are gone. - The leaf discipline survives as a directory rule: ban-cross-tree-imports now applies its harness clauses (no @/ imports, no @/core/studio-context, no @aws-sdk/*) to apps/api/src/harnesses/lib/, and no-cross-tree.test.ts moved with the tree and still guards it. The engine stays a leaf; only the package wrapper is gone. The registry collapse (spec §5.4, executed at last): - InProcessSandboxClient absorbs localDispatch and hard-wires decopilotHarnessFactory — the registry it consulted was a Map with one entry, populated by an import side effect. registry.ts, localDispatch, the orphaned lib barrel and their registration tests are deleted; the client's tests now assert the real factory's contract (eager CLI guard, lazy stream) instead of stubbing a seam. - apps/api/src/harnesses/index.ts keeps one side effect: registering the cluster environment builder the factory requires. Fallout knip caught once the package boundary stopped hiding it: - buildRepoEnvironmentPrompt: dead (nothing builds that prompt block). Deleted. - CHAT_MODES: only its derived type is consumed. Narrowed to module-private. DBOS workflow-source snapshot re-baselined (import-specifier text is hashed; apps/api/scripts/update-workflow-source-snapshot.ts, 8 hashes). Infra: sandbox-daemon.yml change filter, release-changes test fixtures, root README workspace table, bundle-server-script comment.
viktormarinho
added a commit
that referenced
this pull request
Aug 3, 2026
The desktop link (#5570) was the tunnel's only consumer; the package (3.4k lines: NATS WebSocket tunnel client/server, subject tokens, backoff plumbing) has had zero manifest dependents and zero code imports since. It was never published (no publish workflow). Remaining mentions were fixture data: release-changes.test.ts path fixtures (removed) and ban-e2e-app-imports.test.ts, which uses @decocms/tunnel/subject as an example of a DENIED unlisted package — that test keeps passing, a deleted package is guaranteed unlisted. Root README workspace row removed; check:readmes now validates 13 workspaces.
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.
Summary
Removes the desktop link end to end — 150 files, −26,162 lines. Local CLI runs now happen entirely inside the Tauri desktop app (
apps/native, which owns its own Rustlocal-apiand never touches this path), so the link daemon, its tunnel transport, and the cluster-side dispatch route that fed it are all dead weight.Its own PR so it can be reverted independently of the Go-daemon teardown (#5569).
Deleted:
apps/api/src/link-daemon/(42 files),apps/api/src/links/(17),apps/api/src/tools/links/,api/routes/links/, thedeco linkCLI + its store/registry/TUI,auth/dev-link-session.ts,packages/sandbox/server/{daemon-spawn,daemon-asset}.ts,packages/sandbox/server/provider/desktop/, the link resilience scenarios + compose service, and 7 e2e specs.Rewritten:
app.ts,dispatch-run.ts,thread-gate-workflow.ts,routes.ts,background-tool-workflow.ts,resolve-provider.ts,lifecycle.ts,cli.ts,dev.ts.Four judgment calls to check
1.
user-desktopsurvives as a readable legacy value. It's persisted invirtual_mcps.metadata.sandboxMap(migration 092 normalizeddesktop/remote-userinto it), soresolveProvidermaps it to the hosted provider instead of throwing. Old rows keep parsing and stay deletable; nothing new is ever written with it. No migration, no destructive write — that was the explicit call over dropping the rows.2. CLI harnesses lose their only host — but cluster behavior is unchanged.
resolveHarnessExecutionSiteused to route(claude-code|codex, user-desktop)to the desktop daemon and already threwnot implementedfor every agent-sandbox target (cloud-CLI was never wired). With the desktop branch gone it collapses toassertHarnessRunsInCluster, which throws for the same CLI harnesses and lets decopilot through. Anything that worked onagent-sandboxbefore still works identically.3.
deco devis kept, not deleted. Link was an opt-in flag there (--local-sandbox-provider), not a dependency — deleting the file would have taken the local dev loop with it. Only the auto-spawn/toxiproxy/session wiring is gone.4.
useCurrentLinkis kept, and is now explicitly native-only. It looks like link code but isn't: the Tauri app interceptsPOST /api/:org/tools/LINK_CURRENT_GETin Rust (crates/local-api/src/routes/intercept/link_current.rs) to report locally-detected CLI harnesses. Deleting it would have broken the desktop agent picker. It now calls the route directly (the tool is deliberately gone fromStudioToolIO— the contract is owned by the Rust interceptor, not the registry) and short-circuits to offline on web. Same reasoning keptlink-bearer-auth.ts:desktop-session-bridge.tsis the native app's system-browser auth and only borrowsresolveLinkBearer.Test coverage this removes — please weigh in
7 e2e specs are deleted. Four (
link-control,link-dispatch-pull,link-ingest,link-tunnel) are pure link. The other six are the problem:harness-conformance,chat-locked-thread,decopilot-thread-queue,decopilot-unified-control-plane,decopilot-messages,decopilot-fence-queueingare all structurally built on the desktop path — they pin threads tosandbox_provider_kind = 'user-desktop'and spin a fake tunnel daemon — but several also covered hosted dispatch-queue, fence, and control-plane behavior incidentally.I deleted rather than re-pointed them: re-pinning to
agent-sandboxis not mechanical (the CLI-pinned ones can't be, per #2 above), and I can't run Playwright here to verify a rewrite. Hosted-path equivalents are follow-up work — the changed logic is still covered by unit tests, but not end to end.Testing
bun test: 2868 pass, 39 fail — and all 39 fail identically onmain(DB-dependent integration tests with no local Postgres). Diffed baseline-vs-branch to confirm zero new failures. One test genuinely broke and is fixed: the DBOS workflow source guard, re-baselined viaapps/api/scripts/update-workflow-source-snapshot.tsafter editingthread-gate-workflow.resolve-providercases now assert the hosted fallback,SANDBOX_DELETE's desktop case asserts legacy teardown through hosted, andresolveHarnessExecutionSite's table becameassertHarnessRunsInCluster's.bun run checkclean in all 5 workspaces (apps/web's ~20react-resizable-panelserrors are pre-existing dependency drift).bun run lint0 errors.knipclean. It caught the orphan tail and all of it is gone:stopLink/superviseLink+ the link service block (~11k chars),cli/lib/port-wait.tsandcli/open-url.ts(link-TUI-only;ensure-serviceshas its own privatewaitForPort), the@decocms/tunneldep, 5 now-unused e2e deps, and 3 orphaned e2e fixtures. NarrowedbuildHarnessWorkspaceInputandresolveEffectiveVirtualMcpForHarnessto module-private. Only pre-existingviteremains.plugins/ban-e2e-app-imports.js's allowlist in sync withpackages/e2e/package.json, per CLAUDE.md's both-places rule.Not verified
The web UI changes compile but I could not exercise them in a browser —
use-current-link's native gating in particular changes what the desktop agent picker and the chat empty states render. Worth a manual pass in the Tauri app before merge.Conflicts
Overlaps #5569 on
packages/shared/src/tools/tool-io.ts(both regenerate it) andregistry-metadata.ts. Whichever lands second needs a regenerate.Summary by cubic
Removed the desktop link feature end-to-end and routed all execution to the hosted cluster. The Tauri app (
apps/native) continues to handle local runs via its Rustlocal-api, so no cluster link or tunnel is needed.Refactors
deco linkCLI; removed@decocms/tunnel.resolveHarnessExecutionSite→assertHarnessRunsInCluster; removed the thread gate timeout and desktop-only background subtask delivery; inlined{ cwd: null }indispatch-run.user-desktopnow resolves to hosted kind + provider; removedlinkStatusProbeand tunnel dispatch wiring.--local-sandbox-providerand--hotflags from parser/help/completions; dev store no longer tracks ToxiProxy/Sandbox; deletedscripts/smoke-link.ts, dev ToxiProxy helpers, and port-wait utilities.useCurrentLinkas native-only; it calls the Rust interceptor forLINK_CURRENT_GETand short-circuits to offline on web.vitedevDependency.Migration
user-desktopvalues remain readable and now map to hosted (kind normalized); no new writes.deco linkand link-related dev flags are removed. Verify desktop agent picker/empty states in the Tauri app before merge.Written for commit 1c66406. Summary will update on new commits.