feat(tools): per-call approval for action tools

3-way action_tool_policy (off/ask/allow). In "ask", the chat stream stays
open and the tool loop awaits approval: emits event:tool_request, the UI
shows Approve/Deny, POST /chat/approve resumes the same stream. Declined
actions return a denied result; a timeout denies.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jon
2026-07-23 14:39:00 -05:00
co-authored by Claude Opus 4.8
parent 492020b547
commit 52b3c5c3f0
6 changed files with 190 additions and 30 deletions
+5 -3
View File
@@ -998,9 +998,11 @@ class PersistentMemoryStore:
"rag_min_score": 0.6,
# Active project/workspace; "" = all documents (unscoped).
"active_project": "",
# Consent gate for tools that act (web_search/fetch_url/remember). Off by
# default: a playbook can list them, but they only run when this is on.
"allow_action_tools": False,
# Consent policy for tools that act (web_search/fetch_url/remember):
# "off" — withheld from the model entirely (default)
# "ask" — offered, but each call waits for per-call user approval
# "allow" — offered and run freely
"action_tool_policy": "off",
"system_prompt": "",
"timeout": 120,
# How long Ollama keeps the model resident in VRAM between messages.