How Plan Approval Works with the Transient Approved Plan / Auto‑Approve Tools Window in DeepSeek-Reasonix
In DeepSeek-Reasonix, the transient "Approved Plan / Auto-Approve Tools" window appears when a tab's AutoApproveTools flag is enabled, causing the controller to automatically approve all planned tool calls without user confirmation.
Each tab in the Reasonix desktop application runs an independent controller that can operate in several modes, including plan mode, where tool calls are collected into a sequence before execution. When the auto-approval mechanism is active, the standard approval pipeline is bypassed for every tool in the generated plan, triggering a brief UI notification that disappears once execution begins.
Plan Mode and the Approval Pipeline
In Reasonix, controllers manage tab state through modes such as normal, plan, yolo (full-access), and combinations like plan-yolo. When a tab enters plan mode, the controller first generates a complete plan of tool calls while the user composes their prompt.
Under normal operation, every tool call traverses the approval pipeline with four possible states: deny → ask → allow → fallback. By default, the system requires explicit user confirmation (ask) before executing sensitive operations.
The AutoApproveTools Flag and Tab State
The auto-approval behavior is controlled by the AutoApproveTools boolean field defined on the WorkspaceTab struct. According to the source code in desktop/tabs.go (lines 3556‑3559), this field is stored as a runtime-only JSON property:
`json:"autoApproveTools"`
To toggle this state programmatically, the codebase provides the SetAutoApproveTools(on bool) method implemented around line 3651 in desktop/tabs.go. This method updates both the in-memory flag and the persisted tab state. Additionally, the helper function tabModeHasAutoApproveTools(mode string) bool (approximately line 4377) determines whether a specific tab mode implicitly enables auto-approval.
Controller Integration and Approval Bypass
During controller initialization, the buildTabController function (lines 1622‑1624 in desktop/tabs.go) configures the approval mechanism through two critical calls:
ctrl.EnableInteractiveApproval()— activates the interactive approval systemapplyTabToolApprovalModeToController— applies the current tab's tool approval mode
When AutoApproveTools is set to true, the controller internally treats the approval mode as allow for all tools within the plan, effectively short-circuiting the ask stage. The core approval logic resides in internal/control/session.go, where the SessionAPI consults the auto-approval flag before presenting confirmation dialogs.
The Transient UI Window
The "Approved Plan / Auto‑Approve Tools" notification is purely a UI artifact implemented in desktop/settings_app.go. This transient window automatically appears after plan generation completes when autoApproveTools is enabled, and disappears immediately as tool execution begins. It serves as visual feedback that the system is operating in auto-approval mode, but contains no interactive elements since the approval decision has already been made by the controller.
Step-by-Step Execution Flow
The complete auto-approval workflow follows this sequence:
- Plan generation — The controller records the sequence of tool calls while the user composes the prompt
- Plan completion — Once finalized, the UI displays the transient "Approved Plan / Auto‑Approve Tools" window
- Auto-approval — If
AutoApproveToolsis true,control.SessionAPIautomatically approves every tool in the plan (equivalent to setting each tool's approval mode toallow) - Execution — The controller runs the approved tools without pausing for user confirmation
Code Implementation Examples
To enable auto-approval for the current tab programmatically (for example, from a hot-key or menu action):
// Enable auto‑approval for the current tab
app.SetAutoApproveTools(true) // turns on YOLO/full‑access for the plan
// Disable it again – the next plan will require normal approvals
app.SetAutoApproveTools(false)
To query the current state for UI rendering or conditional logic:
if tab.Ctrl.AutoApproveTools() {
fmt.Println("Auto‑approve is on")
}
Summary
- Plan mode collects tool calls before execution, normally requiring user approval through the
deny → ask → allow → fallbackpipeline - The
AutoApproveToolsflag onWorkspaceTab(defined indesktop/tabs.golines 3556‑3559) controls whether planned tools are automatically approved SetAutoApproveTools(line 3651) andtabModeHasAutoApproveTools(line 4377) manage the toggle logic and mode detection- The controller applies the approval mode during
buildTabController(lines 1622‑1624) viaEnableInteractiveApproval()andapplyTabToolApprovalModeToController - The transient UI window is a notification only; actual approval bypass happens in
internal/control/session.go
Frequently Asked Questions
What is the difference between "yolo" mode and "plan-yolo" mode with auto-approval?
Yolo mode grants full access without any approval pipeline, while plan-yolo mode still generates a plan of tool calls but automatically approves them using the AutoApproveTools mechanism. In plan-yolo, you see the transient approval window, whereas in pure yolo mode the window does not appear because no plan is generated before execution.
Where is the auto-approval state persisted?
According to the source in desktop/tabs.go, the AutoApproveTools boolean is stored as a JSON field on the WorkspaceTab struct. While the flag persists across sessions via the tab state, it operates as a runtime configuration that can be toggled dynamically through SetAutoApproveTools().
Why does the approval window disappear so quickly?
The transient "Approved Plan / Auto‑Approve Tools" window disappears immediately because it is only a visual confirmation that the SessionAPI has automatically approved the tools. Since no user interaction is required when AutoApproveTools is enabled, the window clears as soon as the controller begins executing the first tool in the approved plan.
Can individual tools within a plan have different approval settings?
No. When AutoApproveTools is enabled via the transient window or programmatically, the controller treats all tools in the current plan as approved (mode allow). The implementation in internal/control/session.go applies the auto-approval flag globally to the entire plan sequence, overriding individual tool settings for that execution cycle.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →