Reverts PR #16919 (commitsdad10a78d,413ee1a28,b4a8031b2,afb958829) which was merged prematurely. Restoring the pre-merge state so #14817 and #15328 can be revisited as standing PRs. Reverted commits: -afb958829fix(computer-use): harden image-rejection fallback + AUTHOR_MAP -b4a8031b2fix(computer-use): unwrap _multimodal tool results -413ee1a28feat(computer-use): background focus-safe backend -dad10a78dfeat(computer-use): cua-driver backend, universal any-model schema Co-authored-by: teknium1 <teknium@users.noreply.github.com>
This commit is contained in:
31
cli.py
31
cli.py
@@ -8163,27 +8163,6 @@ class HermesCLI:
|
||||
choices.append("view")
|
||||
return choices
|
||||
|
||||
def _computer_use_approval_callback(self, action: str, args: dict, summary: str) -> str:
|
||||
"""Adapt the generic approval UI for the computer_use tool.
|
||||
|
||||
The computer_use handler expects verdicts of the form
|
||||
`approve_once` | `approve_session` | `always_approve` | `deny`.
|
||||
The CLI's built-in approval UI returns `once` | `session` | `always`
|
||||
| `deny`. Translate between the two.
|
||||
"""
|
||||
# Build a command-ish string so the existing UI renders something
|
||||
# meaningful. `summary` is already a one-line human description.
|
||||
verdict = self._approval_callback(
|
||||
command=f"computer_use: {summary}",
|
||||
description=f"Allow computer_use to perform `{action}`?",
|
||||
)
|
||||
return {
|
||||
"once": "approve_once",
|
||||
"session": "approve_session",
|
||||
"always": "always_approve",
|
||||
"deny": "deny",
|
||||
}.get(verdict, "deny")
|
||||
|
||||
def _handle_approval_selection(self) -> None:
|
||||
"""Process the currently selected dangerous-command approval choice."""
|
||||
state = self._approval_state
|
||||
@@ -9370,16 +9349,6 @@ class HermesCLI:
|
||||
set_approval_callback(self._approval_callback)
|
||||
set_secret_capture_callback(self._secret_capture_callback)
|
||||
|
||||
# Computer-use shares the same approval UI (prompt_toolkit dialog).
|
||||
# The tool handler expects a 3-arg callback (action, args, summary)
|
||||
# and returns "approve_once" | "approve_session" | "always_approve"
|
||||
# | "deny". Adapt our existing generic callback.
|
||||
try:
|
||||
from tools.computer_use_tool import set_approval_callback as _set_cu_cb
|
||||
_set_cu_cb(self._computer_use_approval_callback)
|
||||
except ImportError:
|
||||
pass # computer_use extras not installed
|
||||
|
||||
# Ensure tirith security scanner is available (downloads if needed).
|
||||
# Warn the user if tirith is enabled in config but not available,
|
||||
# so they know command security scanning is degraded.
|
||||
|
||||
Reference in New Issue
Block a user