mirror of
https://github.com/ollama/ollama.git
synced 2026-07-10 09:44:18 +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. |
||
|---|---|---|
| .. | ||
| bench | ||
| config | ||
| internal | ||
| launch | ||
| runner | ||
| tui | ||
| agent_tui.go | ||
| agent_tui_test.go | ||
| background_unix.go | ||
| background_windows.go | ||
| cmd.go | ||
| cmd_launcher_test.go | ||
| cmd_test.go | ||
| start.go | ||
| start_darwin.go | ||
| start_default.go | ||
| start_windows.go | ||
| warn_thinking_test.go | ||