Repository navigation
chore(dead-code): remove unused crates, ipc, and helpers - #1960
Conversation
orgtrack-graph and orgtrack-sync were never wired into the app. Drop them and the unused sync_export adapters that only fed that pipeline.
These handlers were registered but never invoked from the frontend. Keep the git commit helper and perf_utils library APIs for tests.
CLI resume already goes through resumeCli, and the hosted session factory was a no-op after local-only routing.
Callers already use the RPC procedures or store mutations. Keep the live wrappers and the RPC layer itself.
The handoff exhaustiveness stub was unused, and the admission builders are already called from production paths.
These helpers are library entry points for manage_lsp and tests, not registered IPC commands.
Harry19081
left a comment
There was a problem hiding this comment.
Went through all six commits against develop. Everything removed here is genuinely unused: no frontend or Rust callers for the orgtrack graph/sync crates and sync_export adapters, the 13 IPC registrations, the TS wrappers (every remaining call goes through rpc.* procedures), or SessionService.resume. The four AgentOrgTurnAdmission constructors all have non-test callers, so dropping their allow(dead_code) is safe, and TaskExecutionHandoffState::as_wire already matches every variant with no wildcard, so the exhaustiveness stub was redundant.
The main issue: in three places the PR unregisters something but keeps a body that nothing calls, and describes it as a "library helper". Inline comments below. Two more that aren't on diff lines:
perf_utilsstill carries the IPC surface. All 10 unregistered functions keep#[command]anduse tauri::commandinperf-utils/src/hash.rsandjson_fast.rs, andperf-utils/Cargo.toml:9still says they are "re-registered fromcommands/handler_list.inc". Four of them (parse_json_file,parse_json_batch,compute_sha256_bytes,compute_blake3_bytes) have no caller at all. The other six are only called fromperf-utils/src/tests/andsrc-tauri/tests/perf_pipeline.rs. Deleting both modules also letssha2,blake3andsimd-jsongo from perf-utils; nothing else in that crate uses them.- Stale LSP doc comments now say these are Tauri commands:
lsp/src/manager.rs:5("the Taurilsp_start_servercommand"),manager.rs:572,log_buffer.rs:102,server/lifecycle.rs:187.
Description:
- The tauri-ipc verification line greps for
compute_json_hash|json_canonicalize. Neither of those names is in this PR (the removed ones arecompute_sha256*,compute_blake3*,*_json_*), so that search couldn't have verified anything. Potential risksmentions "Reviving Database query UI", but this PR doesn't touch the Database UI (that was #1948).cargo check -p org2is the build that expandshandler_list.inc; CI will cover it, but please confirm it's green before merge.
Follow-up, not blocking this PR: 33 more commands in handler_list.inc have no frontend caller and no Rust caller. Most were orphaned when the frontend wrappers were deleted in earlier unused-export sweeps (243061b, fbd8f0c, cabadcf):
{cline,kimi,mimo_code,omp,pi,qoder_cli,qwen_code,trae,workbuddy}_recent_pathsandexternal_history_auto_import_recent_pathsusage_dashboard_{rounds,sessions,summary,trends}github_{check_token,clone_repo,create_branch,list_branches,list_repos}andserver_check_github_visibilityagent_session_{apply,delete,enter}_worktreebrowser_webview_{bring_to_front,send_to_back}builder_profile_exemplars,get_session_tool_usage_attributions_for_call,get_local_lan_ip,skills_hub_updateproject_cancel_routine_runandproject_{list,share,unshare}_org_skill(s): these were added 2026-09-06 and never had a caller, so they may be backend-first work waiting on UI. Worth checking with the author before deleting.
| /// Create a commit with the given message | ||
| /// Uses run_git_command helper with retries and clean environment | ||
| #[tauri::command(rename_all = "camelCase")] | ||
| pub fn git_commit(folder_path: String, message: String) -> Result<(), String> { |
There was a problem hiding this comment.
With the registration gone, git_commit has no production caller; the only caller is git_commit_treats_clean_tree_as_ok in tests/bundle_tests.rs. That leaves bundle.rs entirely dead: this function plus the private run_git_command it uses. I'd delete bundle.rs, its test module, and the pub use bundle::* line in git/src/lib.rs rather than keep it as a "library helper" that nothing calls.
While you're here: the git2 comment in git/Cargo.toml still says git2 is "only used by bundle::calculate_ahead_behind". That function is gone; git2 is actually used by watch/git_status.rs.
| @@ -274,7 +273,6 @@ session_persistence::get_session_tool_usage_attributions_for_call, | |||
| // Git Bundle commands (for cloud session upload - preserves git history) | |||
| // Git Bundle Sync commands (for pull/push during cloud sessions) | |||
| // Git operations for conflict resolution | |||
There was a problem hiding this comment.
This leaves four section comments in a row with nothing under them. "Git Bundle commands" and "Git Bundle Sync commands" were already empty; "Git operations for conflict resolution" becomes empty with this PR. Please drop lines 273–275.
| @@ -618,18 +616,6 @@ file_ops::filter_ignored_paths, | |||
| file_ops::list_directory_filtered, | |||
| file_ops::list_directory_tree, | |||
| // Performance optimization commands | |||
There was a problem hiding this comment.
See the review summary: the 10 unregistered perf_utils functions still have #[command] on them, and none has a production caller (4 have no caller at all; 6 are only called from tests). They're dead code rather than in-crate APIs, so I'd delete hash.rs / json_fast.rs along with their tests and the sha2 / blake3 / simd-json dependencies.
| //! LSP command helpers | ||
| //! | ||
| //! Exposes LSP functionality to the frontend via Tauri commands. | ||
| //! Library helpers used by agent-core (`manage_lsp`) and tests. These |
There was a problem hiding this comment.
This only holds for part of the module. manage_lsp imports 6 of these (lsp_check_installed, lsp_get_install_command, lsp_get_uninstall_command, lsp_get_supported_languages, lsp_get_workspace_config, lsp_set_server_enabled). The other 17 have no caller anywhere: everything in server.rs, plus lsp_get_cached and lsp_is_server_enabled. (The lsp_did_open in e2e-test/src/lsp.rs is a local helper with the same name.) Stripping the macros turns a dead IPC surface into a dead library surface; I'd delete them instead.
|
|
||
| /// Start an LSP server for a specific language | ||
| #[tauri::command] | ||
| pub async fn lsp_start_server( |
There was a problem hiding this comment.
Nothing calls any function in this file. They all take tauri::State<'_, LspManagerState>, so they only ever made sense as commands; agent-core goes to LspManager directly. I'd delete the file along with GlobalLspConfig / BrokenServerInfo, which only these functions use.
|
|
||
| /// Return cached LSP servers if fresh, otherwise empty (caller should fetch fresh). | ||
| #[tauri::command] | ||
| pub fn lsp_get_cached() -> Vec<LanguageServerInfo> { |
There was a problem hiding this comment.
lsp_get_cached has no callers, and it's the only reader of cache::load_lsp. Meanwhile lsp_check_installed (used by manage_lsp) still calls cache::save_lsp on every scan, so the LSP cache becomes write-only disk I/O. I'd delete this function and the cache write, or the whole cache module.
| return searchParams.get("source") === "market"; | ||
| } | ||
|
|
||
| export function isHostedFromSearchParams( |
There was a problem hiding this comment.
unified.ts was the only importer of ./local, so this change orphans src/api/http/session/local.ts: about 140 lines of no-op stubs that exported sessionApi, under a header saying they're "kept for UnifiedSessionApi shape". That file can go in this PR too.
The hosted factory is gone and nothing imported the no-op local session API. Live session ops stay on Tauri/RPC.
Callers already use live RPC, store, or other named helpers. Keep the RPC procedures and the wrappers that still have production imports.
Frontend already uses usage_dashboard_overview and LspManager directly. Unregister the leftover IPC names and delete the unused LSP State wrappers. Keep GitHub library helpers for tests.
Problem
An unused-code audit found several production-gated leftovers that nothing called: the unwired
orgtrack-graph/orgtrack-synccrates, registered but unused git/GitHub/perf Tauri commands, a deprecatedSessionService.resumeduplicate, unused agent session/tool TypeScript wrappers, a dead handoff exhaustiveness stub with staleallow(dead_code)attributes, LSP#[tauri::command]macros that were never registered, leftover HTTP session stubs, unused search/repo/mobile TypeScript wrappers, superseded usage-dashboard IPC, and unused LSP State wrappers after the macros were stripped.Solution
Remove those unused surfaces in nine stacked commits (kept separate for review):
sync_exportadapters.git_commit,github_fetch_profile, and perf JSON/hash IPC; keep the library helpers.SessionService.resumeand unused hosted-session factory exports; keepresumeCliandisHostedFromSearchParams.allow(dead_code)attributes.#[tauri::command]macros; keepmanage_lsp/LspManageras library code.src/api/http/session/local.tsno-op stubs.commands/server.rsState wrappers. Keep GitHub library helpers for tests.This supersedes #1950, #1951, #1956, #1957, #1958, and #1959. SqlEditor cleanup already landed in #1948.
Potential risks
Reviving Database query UI, orgtrack graph sync, GitHub profile/list/clone IPC, Merkle TS wrappers, or the removed TypeScript wrappers requires restoring them from git history. Store
removeSession/updateSessionStatus, RPC procedures,resumeCli,manage_lsp,usage_dashboard_overview, and live git/perf/GitHub library APIs are unchanged.GroupChatContext,manage_nodes, and unusedSessionServicemethods were left in place because they need product confirmation or a coordinated ChatPanel refactor.cargo check -p org2was not rerun here because sidecar binaries are missing in the worktree.Verification
Cherry-pick of the original six commits onto current
develop(5984416aa, including #1948) applied cleanly. The three follow-up commits were made on the stacked branch.pnpm exec vitest run --config config/vitest.config.ts src/engines/ChatPanel/hooks/useWorkspaceChat/useWorkspaceChat.test.ts— 4 passedpnpm exec vitest run --config config/vitest.config.ts src/hooks/fileReview/__tests__/useFileReview.test.ts— 2 passedpnpm exec vitest run --config config/vitest.config.ts src/modules/WorkStation/CodeEditor/Panels/EditorPrimarySidebar/content/SearchContent/useSearchContent/__tests__/useSearchResults.loadMoreListeners.test.ts src/services/navigation/CodeNavigationService.test.ts src/modules/MainApp/Settings/sections/__tests__/MobileRemoteSettingsSection.relayPreset.test.ts src/api/tauri/usageDashboard/index.test.ts— 4 files, 48 passedcargo test -p agent_core --lib coordination::agent_org_turn_contexts— 24 passedcargo check -p lsp— passed after deletingcommands/server.rsagent_coreandlsp(org2 clippy issues in unstaged files ignored)NOT RUN on the stacked branch: full
pnpm test/pnpm typecheck/cargo test -p agent_core/cargo check -p org2/ browser, Wingman, or GitHub clone UI.