You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PR] fix(hermes): bind /acp and /acp-cache to the host session ID - #4275
ranxianglei
changed the title
fix(hermes): bind /acp and /acp-cache to the host session ID
[PR] fix(hermes): bind /acp and /acp-cache to the host session ID
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4274
问题与修复
同一代理服务多个 Hermes 会话时,A 会话中的
/acp和/acp-cache可能显示最近活跃的 B 会话报告。Hermes 的命令分发器已经提供session_id,但 bili 的处理函数未声明接收该参数,随后使用路由 key 或hermes查询,并通过fallback=latest选中了其他会话。两个命令现在显式接收宿主的
session_id,按当前会话查询,并取消最近会话回退。缺少 ID 时明确提示且不发送会话查询;状态响应带有不同的会话 ID 时,拒绝显示面板或转发缓存工具调用。新会话尚无模型请求时保留原有提示。范围
仅 2 个文件,+92/-63:
hermes-plugin/__init__.py:接收宿主 ID,删除路由 key 与 latest 回退,检查返回的会话 ID。tests/hermes-native.test.ts:复用现有 Python 子进程测试,覆盖并发 A/B/A、新会话、陈旧环境/路由标识、缺少 ID、响应会话不匹配及原有空闲/无代理路径。无需修改 Hermes、kernel、配置或模型请求管道。旧版宿主若不传入 ID,会显示更新/重启提示。
本地验证
node --import tsx --test --test-name-pattern='python plugin runtime|in-session slash commands|MITM-domain discovery' tests/hermes-native.test.ts:31/31 通过。其中两个既有窗口用例因本机无 YAML 后端跳过正向断言。npm run typecheck、npm run build、git diff --check:通过。invoke_plugin_command的本地并发探针:8 次状态查询、4 次缓存工具调用均对应正确会话。tests/hermes-native.test.ts本地运行:38 通过、1 失败;失败发生在 Windows 临时安装目录清理的EPERM,未改动该清理逻辑。分类:I(其他宿主车道),p2 / hermes / scope/wiring。Issue 创建时请求的三个标签未成功应用,分类已写入 issue 正文。