-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Labels
area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent QualityIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityarea/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitystatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.workstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreamsLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.⛔ Do not contribute. Internal roadmap item.
Description
The current implementation of Plan Mode transitions relies on a manual synchronization method (syncPlanModeTools) in the Config class. This method is responsible for imperatively registering and unregistering the enter_plan_mode and exit_plan_mode tools from the ToolRegistry whenever the application's ApprovalMode changes.
This approach presents several architectural and maintainability challenges:
- State Fragmentation: Tool availability is managed in two different ways. Most tools are filtered declaratively by the
PolicyEngine, but plan-related tools are managed via imperative registration/unregistration. This split makes it difficult to reason about the total set of tools available to the model at any given time. - Fragile Lifecycle Management: Because these tools are added and removed dynamically, the system must ensure that
syncPlanModeToolsis called at every possible entry point where the mode might change (initialization, mode switches, auth refreshes). Missing a single call-site can result in "ghost tools" appearing in inappropriate modes (e.g.,exit_plan_modebeing available while in YOLO mode). - Policy Inconsistency: The existing
PolicyEngineis designed to be the single source of truth for tool visibility. By bypassing the policy engine for plan tools, we lose the ability to override or audit these specific tool permissions using the standard TOML-based policy hierarchy (Workspace, User, or Admin tiers). - Unnecessary Complexity: Manually managing the presence of tools in the registry adds boilerplate to the
Configclass that duplicates functionality already present in thePolicyEngine'sDENYdecision logic.
The management of enter_plan_mode and exit_plan_mode should be unified with the rest of the system's tool governance. These tools should remain registered in the registry (if Plan Mode is enabled) and their visibility should be controlled declaratively via the PolicyEngine based on the current ApprovalMode.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent QualityIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualityarea/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalitystatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.workstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreamsLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.⛔ Do not contribute. Internal roadmap item.
Type
Projects
Status
No status