Support sudo password flow for shell commands

This commit is contained in:
2026-05-20 22:45:19 +08:00
parent 12bed7b6ba
commit 45b70d2800
11 changed files with 546 additions and 87 deletions
+6 -6
View File
@@ -12,9 +12,6 @@ Available tools:
Args: {"path": "."}
- search_files: search text inside files in the current workspace.
Args: {"query": "text to find", "path": ".", "glob": "*.py"}
- os_update_check: check available operating system package updates without
refreshing package manager caches and without sudo.
Args: {}
- shell_exec_safe: run a safe allowlisted shell command in the current workspace.
Args: {"command": "pwd"}
@@ -24,6 +21,9 @@ follow-up information. Return actions=[] when the observations are sufficient
for the thinker to answer.
Use only the listed tools. Keep actions minimal and directly tied to the user's
request. Do not invent tool names.
For user requests like "check updates in the system", use os_update_check.
Do not use apt update, apt-get update, sudo, su, or package installation commands
for update checks.
For user requests like "check updates in the system", use shell_exec_safe with
`apt list --upgradable`. Do not use apt update, apt-get update, sudo, su, or
package installation commands for a read-only update check.
For commands that genuinely require elevated privileges, use the real system
command with `sudo` through shell_exec_safe. DuckLM will ask the user for
approval and then for the sudo password when the command needs it.