Repository navigation
feat: Add interactive tool approval system for chat mode - #211
Merged
Merged
Conversation
Implement a comprehensive tool approval workflow that allows users to review and approve/reject tool executions before they run in chat mode. This enhances security and user control over potentially sensitive operations. Key changes: - Add new ViewStateToolApproval view state and ApprovalComponent UI - Implement approval request/response event flow with channel-based communication - Separate tool execution into approval-required and parallel-execution paths - Add approval-specific keybindings (←/→ navigate, Enter/y approve, n/Esc reject) - Extend StateManager with approval state management methods - Add IsChatMode flag to AgentRequest to differentiate chat vs agent modes - Tools requiring approval execute sequentially; others maintain parallel execution The approval modal displays tool name, arguments, and interactive approve/reject options with keyboard navigation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Signed-off-by: Eden Reich <[email protected]>
- Add Context domain model with approval tracking - Implement tool approval validation in agent service - Update bash tool to use context-based approval system - Add approval status tracking for pending/rejected tools
- Update chat command handler to support tool approval workflows - Add comprehensive test coverage for chat command functionality - Improve chat handler integration with approval system
- Refactor autocomplete rendering to use stable table format with aligned columns - Calculate column width across all filtered items to prevent jumping during navigation - Add vertical separator (│) for clearer visual distinction between columns - Update theme integration across selection views and UI components - Enhance grep tool with improved formatting - Expand theme mock with GetDimColor support The autocomplete now displays commands and tools in a clean, stable table layout that doesn't shift as users navigate through options. Signed-off-by: Eden Reich <[email protected]>
- Replace string concatenation with proper lipgloss styling - Remove redundant ID display in parentheses after agent name - Fix hex color codes appearing as literal text - Improve visual consistency across all render methods Signed-off-by: Eden Reich <[email protected]>
Improvements to project initialization and agent command: - Add configurable timeout flag for init command AI analysis - Implement comprehensive gateway health checks before agent/init execution - Add signal handling and graceful cleanup for init command - Increase tool execution concurrency from 3 to 10 for faster analysis - Improve analysis prompts with chunked reading strategy for efficiency - Add support for overwriting existing AGENTS.md via --overwrite flag - Simplify AGENTS.md documentation structure - Add agent container naming constant and improved logging - Enhance gateway startup with timeout and user-friendly error messages Signed-off-by: Eden Reich <[email protected]>
…selection view - Replace direct ANSI escape sequences with Lipgloss styles for better maintainability - Use lipgloss.NewStyle().Foreground() for consistent color handling - Improve code readability by separating color definitions from rendering logic - Maintain same visual appearance while using modern styling approach
- Add approval workflow for tool execution requests - Implement diff visualization component for code changes - Add real-time status updates for pending approvals - Enhance UI with approval/rejection controls and feedback - Update chat interface to handle approval states
…onsolidate application styling Add comprehensive documentation for the tool approval system: - Update CLAUDE.md with approval architecture and event flow - Add dedicated Tool Approval System section to CONFIG.md - Update README.md features list with approval system mention Documentation covers: - Configuration-driven approval requirements per tool - Approval workflow and event-driven architecture - UI controls and diff visualization for code changes - Security best practices and environment overrides - Default approval settings for different tool types Related to the approval component, diff renderer, and approval events (ToolApprovalRequestedEvent, ShowToolApprovalEvent, ToolApprovalResponseEvent) implemented in the feature branch. Signed-off-by: Eden Reich <[email protected]>
- Refactor conversation view tests to use mock styles - Update help bar tests for consistent style provider usage - Modify input view tests with mock style provider - Improve status view tests with proper style mocking - Update component factory tests for style provider integration - Enhance general component tests with mock style setup Signed-off-by: Eden Reich <[email protected]>
inference-gateway-releaser Bot
pushed a commit
that referenced
this pull request
Nov 19, 2025
## [0.56.0](v0.55.0...v0.56.0) (2025-11-19) ### 🚀 Features * **agent:** Add agent mode switching (Standard/Plan/Auto-Accept) ([#213](#213)) ([c4d5de1](c4d5de1)), closes [#212](#212) * Add interactive tool approval system for chat mode ([#211](#211)) ([68f11ec](68f11ec)) * Update A2A server configuration and UI components ([18c2213](18c2213))
Contributor
|
🎉 This PR is included in version 0.56.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Closed
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.
Summary
This PR implements a comprehensive tool approval workflow that allows users to review and approve or reject tool executions before they run in chat mode. This enhances security and user control over potentially sensitive operations.
Key Features
ToolApprovalRequestedEventwith channel-based communicationTechnical Changes
ViewStateToolApprovalview state andApprovalComponentUI componentStateManagerinterface with approval state management methods:SetupApprovalUIState()GetApprovalUIState()SetApprovalSelectedIndex()ClearApprovalUIState()IsChatModeflag toAgentRequestto differentiate chat vs agent execution contextsToolApprovalRequestedEvent,ToolApprovedEvent,ToolRejectedEventAgentServiceto separate approval and parallel pathsFiles Changed
internal/ui/components/approval_component.go(new): Approval modal rendererinternal/domain/state.go: Approval state types and view stateinternal/domain/events.go: Approval event typesinternal/domain/interfaces.go: StateManager approval methodsinternal/services/agent.go: Approval logic and execution separationinternal/handlers/chat_handler.go: Approval event handlinginternal/app/chat.go: Approval view rendering and message handlinginternal/ui/keybinding/actions.go®istry.go: Approval keybindingsTest Plan
🤖 Generated with Claude Code