Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

[Refactoring] Audit and Clean tool-handler.ts - Remove Dead Code #13

Description

@gloomcheng

Problem

src/core/mcp/handlers/tool-handler.ts is 741 lines and may contain dead code after Issue #11 refactoring.

Status: After splitting StableWorkflowHandler into domain-based handlers, tool-handler.ts might be deprecated or need restructuring.

Investigation Needed

  1. Is tool-handler.ts still used?

    • Check all imports of ToolHandler
    • Identify remaining responsibilities
  2. If used:

    • What functionality does it provide?
    • Can it be split by domain?
    • Does it overlap with new handlers?
  3. If unused:

    • Mark as deprecated
    • Create migration plan
    • Remove safely

Acceptance Criteria

  • Usage audit complete
  • Dead code identified and removed
  • If kept: file split or reduced to <400 lines
  • If removed: all references migrated
  • Build passing, tests green
  • Documentation updated

Priority

🔴 High - Technical debt clarity

Effort Estimate

1 day

Activity

  1. gloomcheng commented on Dec 25, 2025

    @gloomcheng
    ContributorAuthor

    Implemented in commit c2c1820

    Audit Results

    • ToolHandler: Instantiated but never used - all methods duplicated in new decorator-based handlers
    • Cascading dead code: handoff-service.ts and text-processor.ts only used by ToolHandler

    Removed

    • tool-handler.ts (741 lines)
    • handoff-service.ts (177 lines)
    • text-processor.ts (160 lines)
    • Empty validation/ directory

    Total: 1081 lines of dead code removed

    Build passes ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions