chore: delete 18k lines of code that nothing reaches#26238

merged1
main
t3/slop-cleanup-v2
opened2d agobyTtheo
View on GitHubTwo-way sync enabledPR last imported 2d ago

Another slop audit. A lot of this repo is code that nothing can reach: dead exports, code that only its own tests keep alive, client checks on capability flags that every protocol-2 server has always sent as true, legacy paths for peers that can no longer connect, and fixtures the October test purge (#22557) left behind.

This PR deletes the parts that need no product decision. Users see no change. About 18k lines net go, across 878 files, and 61 files are gone. It replaces #23984, which fell 581 commits behind; every item was proven again on current main.

What goes

  • Flag checks that can never fail. 26 capability flags are true on all 146 protocol-2 releases, and 2 were never true. The server still sends every flag, because older app-store mobile builds read them. Where a check also waited for the server config, an explicit config check stays. With the checks go the legacy "context as text" send path, single-link PR mode, the client-side command-context fallback, the full-snapshot fallback, and per-update thread continuation.
  • API nobody calls. 11 WebSocket methods and 3 HTTP routes that no client calls today and no protocol-2 release ever called (all 142 tags checked).
  • Code only tests use. For example the in-memory copy of the SQL projection store (ProjectionStore.layerMemory), the whole unused ProviderRuntimeEventV2 union, the OpenCode CLI inventory, the sidebar PR snapshot code, and the old mobile connection store.
  • Dead code. Unreachable timeline branches and the checkpoint rollback chain, dead GitActionsControl modes, ThreadLifecycleService, the second adapter-registry builder, props nobody passes, writes to columns nothing reads, and exports only their own file uses.
  • DesktopBridge. Members marked optional "for older shells" are required now. The desktop window only loads its own bundled UI, and the preload defines every member.
  • Purge leftovers. Replay fixtures and recorder scenarios nothing reads, 55 acp-mock-agent flags no test sets, orphan native fixtures, and a fixture kit for a closed issue.
  • Mobile manual memos. 266 useMemo/useCallback calls in files the React Compiler already compiles. Each removal was checked against the compiled output, so the value still comes from the compiler cache with the same deps. 168 stay, because removing them would change caching or identity.
  • Small stuff. Unreachable APNs remote-start code in the relay, two orphaned Expo 57 patches, unused deps and devDependency moves, unused marketing images, dead CSS, debug leftovers, and stale docs.

Review tip: hide whitespace. With whitespace hidden, the diff is +2,219 / -20,229.

Worth knowing

  • If the bounded thread snapshot ever returns a body that does not decode, the client now loads the thread over the socket instead of trying the full HTTP snapshot first. That fallback existed for servers without the bounded route; every protocol-2 server has it.
  • Old mobile file-cache folders from v0.0.28 and older are no longer migrated or cleaned up. Current readers already reject that data.
  • Found along the way, not changed here: on mobile, HardwareKeyboardCommandProvider can show a stale command list until the route changes, because the compiler already drops registrationVersion from that cache on main.

Not in this PR (product calls or refactors): LegacySidebar, legacy Plan mode, OpenCode 1.x, the V1 importer, the 5 flags missing from early previews, package scripts maintainers run by hand, and merging logic web and mobile both carry.

Verification

  • vp run check:changed on the rebased commit: format, lint, knip, typecheck of 36 packages, and 5,167 tests in 375 files pass.
  • Each of the 12 slices passed its own checks and focused tests. An independent review read every added line and removed condition; its findings (a relay token-claim step, a config-loaded gate in settings sync, and the observability reference) are fixed here.
  • Rebasing found two semantic conflicts git did not flag. This branch inlined nextQueuedRun, which main had since changed to skip held runs (#17885); main's version and its call sites are kept. A new Codex test on main used a testkit helper this branch moved; it now uses the shared one.

Created with Claude Opus 5.5 in Claude Code, inside T3 Code. GPT-6.1 Sol in Codex started several slices before a provider outage; Claude Opus 5.5 finished them.

šŸ¤– Generated with Claude Code

Checks

24 successful Ā· 16 skipped
All checks passed
2819196
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This cleanup removes APIs, compatibility paths, and unused code across clients and servers. The investigation did not establish the full behavioral reach of the removals or complete the assessment of default changes and diagnostic suppressions.

Notes:

  • All code in this push has already been reviewed. Approvability was decided on eligibility alone.

No code changes detected at 2819196. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

āœ… Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiBāœ…
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiBāœ…
CodexLive turn WebSocket wire1.3 KiB1.3 KiB0 B (0.0%)2.0 KiBāœ…
CodexLive turn WebSocket decoded21.6 KiB21.6 KiB0 B (0.0%)24.4 KiBāœ…
CodexLive turn messages220 (0.0%)8āœ…
ClaudeTotal thread wire5.1 KiB5.0 KiBāˆ’6 B (āˆ’0.1%)6.8 KiBāœ…
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiBāœ…
ClaudeLive turn WebSocket wire1.3 KiB1.3 KiBāˆ’6 B (āˆ’0.5%)2.0 KiBāœ…
ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiBāœ…
ClaudeLive turn messages220 (0.0%)8āœ…

Baseline: 3b2f958 Ā· PR result: 2819196 Ā· Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Added 1 commit

  • chore: delete dead code, test-only code, and always-true flag checks2819196