Repository navigation
feat(agent): Add agent mode switching (Standard/Plan/Auto-Accept) - #213
Merged
Merged
Conversation
Implements three operational modes for the agent that can be toggled with Shift+Tab: - **Standard Mode** (default): Normal operation with all configured tools and approval checks - **Plan Mode**: Read-only mode for planning and analysis (only Read/Grep/Tree tools) - **Auto-Accept Mode**: All tool executions auto-approved (bypasses all guardrails) Changes: - Add AgentMode enum (Standard, Plan, AutoAccept) to domain layer - Integrate mode into ApplicationState and StateManager with cycling logic - Add Shift+Tab keybinding to cycle modes - Create UI mode indicator below input field (only shows for non-Standard modes) - Add mode-specific system prompts to guide LLM behavior - Implement approval bypass for Auto-Accept mode in shouldRequireApproval() - Inject StateManager into AgentService for mode-aware operations - Update InputView to display current mode with emoji indicators - Add comprehensive documentation to README - Regenerate mocks for updated interfaces The mode indicator displays: - 📋 PLAN MODE - Planning only, no execution - ⚡ AUTO-ACCEPT MODE - All tools auto-approved All tests passing ✓ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Eden Reich <[email protected]>
This commit fixes the issue where Plan Mode was still showing all tools to the LLM despite the system prompt instructions. The problem had two root causes: 1. **Tool filtering not implemented**: The system relied only on system prompt instructions to guide the LLM, but didn't actually filter the available tools before sending them to the model. 2. **StateManager initialization order bug**: StateManager was being initialized AFTER AgentService, causing it to be nil when the agent tried to check the current mode. Changes made: **Domain Layer:** - Add `ListToolsForMode(mode AgentMode)` method to ToolService interface **Service Layer:** - Implement `ListToolsForMode()` in LLMToolService with Plan mode filtering - Plan Mode: Only Read, Grep, and Tree tools - Standard/AutoAccept: All enabled tools - Implement `ListToolsForMode()` in NoOpToolService for interface compliance - Add debug logging for tool filtering (using logger instead of fmt.Printf) **Agent Service:** - Move tool retrieval into the event loop (from static initialization) - Retrieve current agent mode from StateManager on each iteration - Create SDK client with mode-filtered tools for each LLM call - Add debug logging to track mode detection **Container:** - Extract StateManager initialization into separate method - Initialize StateManager BEFORE domain services (fixes nil reference) - Remove duplicate StateManager initialization **Mocks:** - Regenerate FakeToolService with new ListToolsForMode method The fix ensures that when users switch to Plan Mode: - Only Read, Grep, and Tree tools are sent to the LLM - The LLM cannot call Write, Edit, Delete, Bash, or other modification tools - Mode changes take effect immediately on the next LLM interaction Signed-off-by: Eden Reich <[email protected]>
…ment - Add approval state tracking in domain layer - Implement approval UI components with visual feedback - Add keybindings for approval actions - Update agent service to handle approval workflow - Integrate approval system with chat handler
- Add A2A agent URL configuration - Implement agent task submission and querying - Add tool execution with proper error handling - Improve service layer for agent interactions Signed-off-by: Eden Reich <[email protected]>
Signed-off-by: Eden Reich <[email protected]>
Fixes a nil pointer dereference panic that occurred when EditTool and MultiEditTool attempted to render diffs in their FormatForLLM methods. The panic occurred because DiffRenderer was being instantiated with a nil styleProvider, which caused a segmentation fault when RenderDiff tried to call GetThemeColor on the nil pointer. Changes: - EditTool.FormatForLLM: Initialize themeService and styleProvider before creating DiffRenderer - MultiEditTool.FormatForLLM: Initialize themeService and styleProvider in both success and failure code paths This follows the established pattern used in FormatArgumentsForApproval methods, ensuring all DiffRenderer instances have a valid styleProvider. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Remove outdated TODO notes about placeholder implementations - Update tool names to match actual implementation: - SubmitTask → A2A_SubmitTask - Query → A2A_QueryAgent - DownloadArtifacts → A2A_DownloadArtifacts - Add complete A2A configuration example with all four tools - Update examples and workflow descriptions to use correct tool names - Expand tool references in agents configuration documentation 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
Implements three operational modes for the agent that can be toggled with Shift+Tab:
Changes
Closes #212
Generated with Claude Code