-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add interactive tool approval system for chat mode #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
edenreich
wants to merge
13
commits into
main
Choose a base branch
from
feat/tool-approval-system
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,355
−485
Conversation
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
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 <noreply@anthropic.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
- 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 <eden.reich@gmail.com>
- 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 <eden.reich@gmail.com>
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 <eden.reich@gmail.com>
…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
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