chore(tauri-commands): remove 114 registered commands with no caller - #1177
Merged
Conversation
`handler_list.inc` registered 1,019 Tauri commands; a sweep of that registry against every non-Rust file in the repository found 145 with no caller in `src/`, `tests/`, or `src-tauri/capabilities/`. Classifying each by whether Rust itself calls the function: 127 have no caller anywhere, 15 are invoked as plain Rust functions from agent-core and the CLI bridge (registration dead, function live), and 3 are reached only by a test. This removes 114 of the 127 — the 13 `benchmark_*` commands ship separately because they are one archived feature with its own archive entry. Removes the command functions, their registrations, and everything they were the last caller of: the managed `IndexManager` nothing read, the four MCP marketplace registry clients, the four `event_pipeline` analytics/history/ pagination/statistics services left with only their own tests, and the transitively-dead helpers behind git bundles, repo watch, the proxy CA, and Cursor history. Registry: 1,019 -> 905 entries. 8,243 deletions, 20 insertions.
Chloe-JY
force-pushed
the
chore/dead-tauri-command-sweep
branch
from
September 1, 2026 06:22
e764165 to
f8cad3e
Compare
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.
Problem
src-tauri/src/commands/handler_list.incregistered 1,019 Tauri commands.A full sweep of that registry against every non-Rust file in the repository
found 145 with no caller in
src/,tests/, orsrc-tauri/capabilities/.Registering a command is not free: each one keeps its implementation and
everything reachable from it compiled into the binary, exposed on the IPC
surface, and in scope for review, refactors, and audits. Several of these
commands were the last remaining voter for whole modules — a state manager
nothing reads, four HTTP registry clients, four analytics/pagination services
kept alive only by their own tests.
The 145 are not uniformly dead, and this PR removes only the subset that is.
Classifying each by whether Rust itself calls the function:
Class B matters: the 11
internal_browser_*commands pluslist_internal_browser_targetsandget_active_internal_browser_stateare theagent's browser-control tool, invoked as plain Rust functions from
crates/agent-core/src/core/tools/impls/web/control_internal_browser.rs.cli_agent_runis invoked byagent_sessions::cli::agent_core_bridge,get_webview_cookiesby Cursor session-token capture,get_watch_statusbywatch_repos,convert_patch_to_unifiedbyes_convert_patch_to_diff. Theirregistration is dead but their function is not — deleting them would break
agent web control and CLI session startup. They are left alone here and belong
in a separate PR that drops the registration and keeps the function.
The 13
benchmark_*commands are class A but ship separately in #1173, becausethey are one coherent archived feature with its own
.archive/README.mdentry.This PR covers the remaining 114.
Solution
Removed the 114 command functions and their
handler_list.incregistrations,then followed each removal outward and removed what it was the last caller of.
The registry goes from 1,019 to 905 entries; the diff is 8,243 deletions
against 20 insertions.
Whole modules that lost their last voter and are deleted:
src/infrastructure/index_manager.rs(+ its tests) —IndexManagerwasconstructed and
app.manage()d insetup_hook::state, but its only readerswere
get_index_status/get_all_indexes/start_indexing/release_index. With those gone nothing reads the managed state, so the type,its state registration, and its tests go with them.
crates/agent-core/src/specialization/mcp/registries/— thehub,smithery,mcpbar, andglamaMCP-marketplace clients. Every public item in all fourwas a
*_search/*_detail/*_installcommand; nothing outside thedirectory referenced it.
src/agent_sessions/event_pipeline/{analytics,history,pagination,statistics}.rs(+ their four test files) — the services behind
es_compute_analytics,es_query_session_history,es_paginate_eventsand friends. After thecommands went, their only remaining callers were their own tests.
src/agent_sessions/event_pipeline/commands/{analytics,pagination}.rs— thecommand modules themselves, left holding nothing but a doc comment.
crates/agent-core/src/specialization/skills/market/browse.rs— the wholefile was
skills_hub_browseplus two imports.Command families removed in place (implementation deleted, module kept because
live commands remain in it): browser DOM editing / multi-select / element
geometry / standalone browser windows / devtools introspection (28,
dom_editor.rs801→93 lines,windows.rs165→30); external-sessiones_*analytics, history, pagination, extraction (16); Cursor and Kiro session capture
and token reading (6);
cache_*session-cache accessors (7); git bundlecreate/apply/push and repo-watch status (14); market-proxy allocation and CA
certificate install/trust (8); skills-hub env storage and install (4); recent-file
menu, work-item transition, team-inbox unread count, PTY cwd, temp dir, file
search by extension, Qdrant debug info, aligned diff, routine-scheduler debug,
and the remaining scattered singles.
Transitively-dead support code removed with them, each verified against
origin/developto be reachable only from a removed command:HealthMonitorbulk health,RepoStateStore::get_all_cached_statuses(and itsone test),
Watcher::unwatch_all, proxy CAinstall_ca/is_ca_installed/uninstall_ca,stat_cursor_cli_history_for_session,get_cursor_sessionswithits two date helpers, git-bundle
auto_commit_if_neededandMAX_BUNDLE_SIZE,external-IDE
try_open_appandgenerate_app_name_variants, work-itemguard_completion(and the one assertion that referenced it), and theestimate_cost_blendedCursor pricing helper.Resulting invariant: every entry in
handler_list.incis either reachable fromthe frontend or reachable from Rust — no registration exists whose only purpose
is to keep code compiling.
Potential risks
calling any of them would now get a runtime "command not found" instead of a
result. Verified exhaustively (see Verification) that no caller exists in this
repository, including
tests/e2e/andsrc-tauri/capabilities/default.json,and that the repository has no dynamically-constructed command names.
feature whose UI is gone: browser DOM editing, the MCP marketplace clients,
the SWE-bench-adjacent
es_*analytics services. If any of those UIs isplanned to return, this PR is the commit to revert or cherry-pick from. That
is a deliberate call — the alternative is carrying compiled, unreviewed,
unreachable backends indefinitely.
skill-env JSON written by the removed commands all remain where they were.
Nothing is deleted from the user's disk; the code that read those files is
what went away. Restoring the code restores access.
proxy_install_cert/proxy_uninstall_certaregone, so a user who already has the ORGII CA in their trust store has no
in-app way to remove it. They can remove it through Keychain Access. Nothing
installs a new CA any more either.
app.manage(Arc<Mutex<IndexManager>>)is gone frominit_core_state. Any future command that asks for that state viatauri::Statewill panic at call time rather than fail to compile — the usualTauri hazard. No such command exists now.
event_pipelineservicesuites and
index_manager_tests) plus onestate_storetest and oneassertion in a
work_item_featurestest. Every one of them exercised codedeleted in this PR; no test covering surviving behavior was touched.
were exercised at runtime in a built app — this is a static-reachability
argument backed by a clean workspace build, clippy, and the test suites of
every touched crate. The strongest residual risk is a caller reaching a
command through a mechanism no static scan can see; the repository's two
indirect
invoke()sites were both checked and both pass literal constants.migration, schema, or persisted format.
Verification
Re-verified after rebasing onto
develop(805940303), which had since merged#1172 (semantic-search removal) and #1174 (rspack dev server). Two conflicts,
both resolved by re-deriving rather than hand-merging:
semantic_commands/ debug.rswas deleted by #1172 and its deletion accepted (this PR only removedone function from it), and
handler_list.incwas regenerated from the newdevelopby re-running the removal script — leaving a diff of exactly 114registration lines plus one section comment whose only entry is gone. The
unrelated
db_browser/tempfilelockfile drift that the rebase pulled in wasdropped, so
Cargo.lockis untouched.cargo check --workspace --all-targets— clean, zero warnings.cargo clippy --workspace --all-targets -- -D warnings— exit 0, post-rebase.cargo test --workspacepost-rebase — 3,250 passed, plus the pre-rebaseper-crate run below.
cargo testfor every crate in the diff —advanced_search,agent_cli,agent_core,browser,git,integrations,key_vault,orgtrack_core,perf_utils,project_management,search,session_persistence,system_services,terminal,org2— 6,450 passed, 0 failed, 27ignored (exit 0).
All cargo commands run with a private
CARGO_TARGET_DIR. Two ORGII worktreesresolve this package to the same build-script
OUT_DIR, so a shared targetdir verifies the wrong worktree's
handler_list.inc— which can produce afalse green as easily as a false failure.
Registry sweep. Parsed all 1,019 entries of
handler_list.incand searched9,690 repository files (
.ts/.tsx/.js/.jsx/.mjs/.cjs/.json/.html/.md/.rs/ .toml/.yml/.yaml, excludingnode_modules,target,.archive) for eachcommand name. 145 had zero non-Rust hits.
Rust-caller classification with a fixpoint. For each of the 145, located
every Rust reference, discarded definitions,
usestatements (includingmulti-line
use {...}blocks) and comments, resolved each remaining site toits enclosing
fn, then iterated to a fixpoint so a command whose only calleris another dead command is itself dead. This is what separates the 127 from
the 15 that agent-core calls directly.
Shadowed-name check. Two collisions were caught and corrected: the
proxy_releasecommand is dead while theproxy_releasemodule in the CLIsession runner is live and unrelated;
IndexManager::get_all_indexes/release_indexare methods sharing a name with their commands.Fallout isolated by differential orphan analysis. Ran an orphaned-
pub fnscan over
src-tauri/before and after and diffed, so only functions thischange orphaned were removed. That diff also caught four false positives —
context_window_hint,get_all_health,ca_exists,get_process_cwd— whichwere restored: the first was already test-only on
develop(its lastnon-test mention was a doc comment) and the other three have same-file
callers.
stat_storewas flagged and likewise left in place.Indirect invocation checked. The repository's only non-literal
invoke()call sites are
useEmbeddedWebviewanddiagnostics/rustBridge; both receivecommand names as constants, so no command is reachable through a constructed
string. No removed command appears in
src-tauri/capabilities/default.json.Two intermittent failures surfaced, neither caused by this PR. Both are
races on process-global state in tests this diff does not touch, and both were
reproduced deterministically and fixed in their own PRs:
database::db::connection::tests::pooled_connection_is_reused_after_drop—the one that failed this PR's first CI run.
reset_connection_pool()clearsthe global idle pool for every path, so a parallel test can discard the
connection this one asserts on. This PR changes no file in
crates/database. Fixed in fix(database): serialize the tests that race on the global pool #1180.agent_core::…::resolved_workspace_falls_back_to_personal_workspace— readsglobal
ORGII_HOMEtwice and compares, without holdingtest_env::lock_home(). This PR changes no file incrates/agent-core/src/core/definitions/. Fixed in fix(agent-core): lock ORGII_HOME while the workspace test reads it #1181.Merging fix(database): serialize the tests that race on the global pool #1180 and fix(agent-core): lock ORGII_HOME while the workspace test reads it #1181 first will make this PR's CI green. Neither fix is
folded in here: they are separate problems in separate crates.
Not run: no TypeScript changes, so
pnpm typecheck/vitest/ Playwrightwere not run. No UI change, so no screenshots.
Pre-commit hook trailer is absent. Committed from a
git worktree, where.husky/_/husky.shis gitignored and therefore never created bygit worktree add, andnode_modulesis not installed. The hook's"Pre-commit hook ran." tamper-evidence trailer is structurally always missing
in a worktree and carries no signal here. The check it would have run for a
Rust diff is
cargo clippy, which was run manually and is reported above.