Files
hermes-agent/tools
liuhao1024 ce11b6be1a fix(mcp): trust-gate Session/Always answers now stick per (server, tool)
On a `trust: untrusted` MCP server every write-capable call asks first. The
prompt offered "Allow for this session" and "Always" on messaging, TUI and
Desktop (Session on the CLI), but request_elicitation_consent collapsed every
yes to a one-call accept and recorded nothing, so the next call asked again.

The trust gate now passes an approval key `mcp:<server>/<tool>`: a session
answer is recorded for the chat, an always answer lands in the profile's
command_allowlist, and the gate checks is_approved before asking. Consent
with no identity to remember (MCP elicitation, sampling, payment-card fill,
spend-limit and over-limit prompts) sends allow_session/allow_permanent
false, so every surface offers only Once / Deny and a broader stale answer
covers that one call.

Salvaged from #109832 onto current main (the stale branch predates the
spend-limit gate and the approval_prompt split); its 141-line mock test
file is replaced by two invariant tests in the next commit.

Co-authored-by: jacques-commits <259371347+jacques-commits@users.noreply.github.com>
2026-10-23 16:16:43 -07:00
..
2026-10-08 19:54:07 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 21:38:05 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:42:29 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00