mirror of
https://github.com/ollama/ollama.git
synced 2026-07-08 08:53:11 +00:00
Replaces the scattered auto-approve plumbing (ApprovalManager.AutoApprove, chatPermissionMode, opts.AutoApproveTools, and the approvalHandlerAutoApproves type-switch) with a single RunPolicy value object carrying ToolMode (Review/FullAccess/Disabled), an ApprovalPolicy strategy, and MaxToolRounds. Mode is derived once per surface via resolveAgentRunPolicy, and the TUI toggles it in place via RunPolicyState. These two changes land together because they share struct-field plumbing in agent_tui.go: the --hidethinking removal drops HideThinking from the same gofmt-realigned AgentTUIOptions/runOptions literals that gain the Policy field, so splitting them would produce intermediate states that do not build. Also drops the now-unused PermissionNotice() and RunPolicyState.SetPolicy, and simplifies the headless tool-resolution block. |
||
|---|---|---|
| .. | ||
| skills | ||
| store | ||
| tools | ||
| approval.go | ||
| approval_test.go | ||
| compactor.go | ||
| compactor_test.go | ||
| events.go | ||
| policy.go | ||
| registry.go | ||
| request_preview.go | ||
| request_preview_test.go | ||
| session.go | ||
| session_test.go | ||
| tool_display.go | ||
| tool_display_test.go | ||