hermes - 💡(How to fix) Fix [bug/UX] 危险命令拦截:非批准消息无反馈 + BLOCKED 提示未本地化 [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

存在两个关联的 UX 问题:


问题 A:非批准消息无反馈

当 Agent 执行危险命令触发安全拦截时,Agent 线程被阻塞在 threading.Event.wait()tools/approval.py)。用户发送的普通文本消息走 running-agent 路径调用 agent.interrupt(),但 Agent 无法处理中断(被锁在 terminal tool 内部),消息被静默消耗,用户零反馈。

只有 /approve/deny/stop 三个命令能正确触发处理。

相关代码

  • gateway/run.py ~L6099-6106(/approve//deny bypass)
  • gateway/run.py ~L6214-6268(running-agent guard)
  • tools/approval.py ~L1243(Event.wait() 阻塞点)

问题 B:BLOCKED 提示未本地化

危险命令拦截提示使用硬编码英文,未经过 agent/i18n.t() 函数:

文件硬编码字符串
tools/terminal_tool.py L1852"Command denied: {desc}. Use the approval prompt..."
tools/approval.py L1206"BLOCKED: Failed to send approval request..."
tools/approval.py L153"BLOCKED: Command denied by user..."

已有完整的 i18n 基础设施(agent/i18n.py,16 种语言),但上述位置未调用。

建议修复

修复 A(高优先级):在 gateway/run.py 中检测 has_blocking_approval(),对非 /approve//deny//stop 的消息回复本地化引导消息。

修复 B(中优先级):将上述 3 处硬编码字符串改为 t() 调用,补全各语言翻译条目。

已有基础设施

  • agent/i18n.py — 完整的 i18n 系统,支持 16+ 语言
  • locales/zh.yaml — 中文翻译已存在
  • tests/agent/test_i18n.py — 翻译条目一致性测试

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [bug/UX] 危险命令拦截:非批准消息无反馈 + BLOCKED 提示未本地化 [1 pull requests]