Skip to content

Conversation

@AlexMikhalev
Copy link
Contributor

Summary

Remove dead code warnings and properly integrate McpToolsHandler into the REPL system.

Changes

McpToolsHandler Integration

  • Remove #[allow(dead_code)] from McpToolsHandler (now actively used by REPL)
  • Add mcp_handler field to ReplHandler with proper feature gating
  • Update all MCP command handlers to use mcp_handler instead of calling service directly

Wizard Refactoring

  • Refactor custom_wizard() to use into_result() pattern
  • Replace 6 verbose match blocks with clean .into_result()? calls
  • Remove unused PromptResult import

Dead Code Removal

  • Remove unused error variants from OnboardingError: Config, RoleExists, Network
  • Remove PathNotFound variant from ValidationError (never constructed)
  • Remove unused utility functions: prompt_confirm, prompt_input
  • Add #[cfg(test)] to is_first_run function (test-only)
  • Remove #[allow(dead_code)] from service methods now used via McpToolsHandler

Verification

  • ✅ All 134 unit tests pass
  • ✅ All 11 integration tests pass
  • ✅ No breaking changes
  • ✅ Code quality improved (-152 lines net)

Impact

  • No user-facing changes - internal refactoring only
  • Improved maintainability - removed dead code, simplified patterns
  • Better code organization - McpToolsHandler properly integrated

Ready for review and merge.

- Add --tui flag to force TUI mode
- REPL is now default when running terraphim-agent without arguments
- TUI mode requires a server to be running at localhost:8000
- Update help text to reflect new default behavior
- All tests passing
- Fix needless_borrows_for_generic_args in terraphim_update (4 instances)
- Fix unnecessary_unwrap in terraphim-session-analyzer tests
- Fix needless_question_mark in terraphim_agent repl/mcp_tools
- Fix wildcard_in_or_patterns in terraphim_agent repl/mcp_tools
- Add #[allow(dead_code)] for McpToolsHandler (feature not used)
- Remove deprecated rocksdb feature tests (causing unexpected_cfgs errors)
- All clippy checks now pass
Remove dead code warnings and properly integrate McpToolsHandler:

- Remove #[allow(dead_code)] from McpToolsHandler (now actively used)
- Integrate McpToolsHandler into ReplHandler for MCP commands
- Refactor wizard to use into_result() pattern (cleaner error handling)
- Remove unused error variants: PathNotFound, Config, RoleExists, Network
- Remove unused functions: prompt_confirm, prompt_input
- Gate test-only function is_first_run with #[cfg(test)]

Changes:
- mcp_tools.rs: Remove dead_code attributes, simplify error handling
- handler.rs: Add mcp_handler field, use in MCP command handlers
- wizard.rs: Use into_result() instead of manual match blocks
- mod.rs: Remove unused OnboardingError variants
- validation.rs: Remove PathNotFound variant
- prompts.rs: Remove unused utility functions
- service.rs: Remove dead_code attributes from now-used methods

Verification:
- All 134 unit tests pass
- All 11 integration tests pass
- No breaking changes
- Code quality improved
@AlexMikhalev AlexMikhalev merged commit 0481d0f into main Jan 31, 2026
10 of 11 checks passed
@AlexMikhalev AlexMikhalev deleted the fix/dead-code-cleanup branch January 31, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants