Skip to content

⚠️ DEPRECATED - Feat: Add Interactive Tool Management Modal to TUI - #1767

Closed
spoons-and-mirrors wants to merge 2 commits into
anomalyco:devfrom
spoons-and-mirrors:feat/tool-box
Closed

spoons-and-mirrors wants to merge 2 commits into
anomalyco:devfrom
spoons-and-mirrors:feat/tool-box

Conversation

@spoons-and-mirrors

Copy link
Copy Markdown
Contributor

This PR introduces a new Tools modal to the TUI, allowing users to easily toggle tools on/off per agent during their session, accessible via <leader>o or /tools

image

This feature provides users with fine-grained control over their AI assistant's capabilities while
maintaining a clean, intuitive interface that integrates seamlessly with the existing TUI experience.

Core Features

  • Interactive Tool Toggle: Modal interface with searchable tool list and checkbox-style toggles
  • Agent-Scoped: Tool settings are specific to each agent
  • Session-Scoped: Tool overrides apply only to the current session (not persisted to disk)
  • Smart Filtering: Tools are automatically filtered to show only user-manageable tools (excludes internal tools like patch and invalid)
  • Organized Display: Tools grouped by source (Built-in and MCP Tools) with fuzzy search support
  • Overridden tools show with a warning color
  • Allows TAB key to cycle through agents while tool modal is open

Implementation Details

  • New ToolsDialog component following existing modal patterns (dialog/tools.go)
  • New /app/tools endpoint for fetching available tools with metadata
  • Tools include name, description, source (builtin/mcp), and defaultEnabled fields(2nd commit)
  • Early MCP initialization in bootstrap for immediate tool availability

Architecture & Maintainability

The PR includes two logical commits. The second commit is not required for the feature to work but improves maintainability.

  1. Core Feature Implementation: Basic tool modal with hardcoded filtering (for patch and invalid tools)
  2. Centralized Tool Service Refactor (optional):
    • Introduces ToolService with App.state() caching patterns
    • Centralizes tool defaults in documented TOOL_DEFAULTS object
    • Replaces hardcoded logic with API-driven approach
    • Maintains backward compatibility

- Implement interactive tool dialog allowing users to toggle tools per agent during chat sessions.
- Tools are fetched from server API, categorized by source (built-in/MCP), and support fuzzy search.
- Tool overrides are session and agent-scoped and not persisted to state.
- Filter out tools that should not be shown to users
…vice

- Replace hardcoded `name !== "patch" && name !== "invalid"` logic with documented metadata
- Add ToolService with TOOL_DEFAULTS object explaining why tools are disabled:
  * patch: Experimental/deprecated tool marked 'do not use'
  * invalid: Internal error handling tool
- Enhance /app/tools API to include defaultEnabled field in response
- Update TUI to use API-provided defaults instead of hardcoded logic
- Add proper App.state() caching with 60s TTL for tool metadata
- Maintain backward compatibility with deprecated IsToolDefaultEnabled()
- Only show tools that are meant to be user-manageable

This centralizes tool default management, makes it self-documenting, and
follows established patterns for state management and caching.
@spoons-and-mirrors

Copy link
Copy Markdown
Contributor Author

deprecated and improved on by #1854

@spoons-and-mirrors spoons-and-mirrors changed the title Feat: Add Interactive Tool Management Modal to TUI DEPRECATED - Feat: Add Interactive Tool Management Modal to TUI Aug 12, 2025
@spoons-and-mirrors spoons-and-mirrors changed the title DEPRECATED - Feat: Add Interactive Tool Management Modal to TUI ⚠️ DEPRECATED - Feat: Add Interactive Tool Management Modal to TUI Aug 12, 2025
@spoons-and-mirrors
spoons-and-mirrors deleted the feat/tool-box branch August 14, 2025 19:05
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.

1 participant