hermes-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHermes Agent
Hermes Agent
Hermes Agent is an open-source AI agent framework by Nous Research that runs in your terminal, messaging platforms, and IDEs. It belongs to the same category as Claude Code (Anthropic), Codex (OpenAI), and OpenClaw — autonomous coding and task-execution agents that use tool calling to interact with your system. Hermes works with any LLM provider (OpenRouter, Anthropic, OpenAI, DeepSeek, local models, and 15+ others) and runs on Linux, macOS, and WSL.
What makes Hermes different:
- Self-improving through skills — Hermes learns from experience by saving reusable procedures as skills. When it solves a complex problem, discovers a workflow, or gets corrected, it can persist that knowledge as a skill document that loads into future sessions. Skills accumulate over time, making the agent better at your specific tasks and environment.
- Persistent memory across sessions — remembers who you are, your preferences, environment details, and lessons learned. Pluggable memory backends (built-in, Honcho, Mem0, and more) let you choose how memory works.
- Multi-platform gateway — the same agent runs on Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Email, and 10+ other platforms with full tool access, not just chat.
- Provider-agnostic — swap models and providers mid-workflow without changing anything else. Credential pools rotate across multiple API keys automatically.
- Profiles — run multiple independent Hermes instances with isolated configs, sessions, skills, and memory.
- Extensible — plugins, MCP servers, custom tools, webhook triggers, cron scheduling, and the full Python ecosystem.
People use Hermes for software development, research, system administration, data analysis, content creation, home automation, and anything else that benefits from an AI agent with persistent context and full system access.
This skill helps you work with Hermes Agent effectively — setting it up, configuring features, spawning additional agent instances, troubleshooting issues, finding the right commands and settings, and understanding how the system works when you need to extend or contribute to it.
Hermes Agent是Nous Research开发的开源AI Agent框架,可在终端、消息平台和IDE中运行。它与Claude Code(Anthropic)、Codex(OpenAI)和OpenClaw属于同一类别——这类自主编码和任务执行Agent通过调用工具与系统交互。Hermes兼容所有LLM提供商(OpenRouter、Anthropic、OpenAI、DeepSeek、本地模型及其他15+提供商),可在Linux、macOS和WSL上运行。
Hermes的独特之处:
- 通过技能实现自我提升 —— Hermes会将可复用流程保存为技能,从经验中学习。当它解决复杂问题、发现工作流或得到修正时,可将该知识保存为技能文档,供后续会话加载。技能会随时间积累,让Agent在你的特定任务和环境中表现更出色。
- 跨会话持久化记忆 —— 记住你的身份、偏好、环境细节和所学经验。可插拔的记忆后端(内置、Honcho、Mem0等)让你选择记忆的运作方式。
- 多平台网关 —— 同一Agent可在Telegram、Discord、Slack、WhatsApp、Signal、Matrix、Email及其他10+平台上运行,且完全支持工具调用,不局限于聊天功能。
- 提供商无关性 —— 在工作流中切换模型和提供商,无需修改其他内容。凭证池会自动轮换多个API密钥。
- 配置文件 —— 运行多个独立的Hermes实例,每个实例都有独立的配置、会话、技能和记忆。
- 可扩展性 —— 支持插件、MCP服务器、自定义工具、Webhook触发器、定时任务调度,以及完整的Python生态系统。
人们使用Hermes进行软件开发、研究、系统管理、数据分析、内容创作、家庭自动化,以及任何需要具备持久上下文和完整系统访问权限的AI Agent的场景。
本技能帮助你高效使用Hermes Agent —— 包括设置、配置功能、生成额外Agent实例、排查问题、找到合适的命令和设置,以及在需要扩展或贡献代码时理解系统的工作原理。
Quick Start
快速开始
bash
undefinedbash
undefinedInstall
安装
Interactive chat (default)
交互式聊天(默认)
hermes
hermes
Single query
单次查询
hermes chat -q "What is the capital of France?"
hermes chat -q "法国的首都是什么?"
Setup wizard
设置向导
hermes setup
hermes setup
Change model/provider
切换模型/提供商
hermes model
hermes model
Check health
检查健康状态
hermes doctor
---hermes doctor
---CLI Reference
CLI参考
Global Flags
全局标志
hermes [flags] [command]
--version, -V Show version
--resume, -r SESSION Resume session by ID or title
--continue, -c [NAME] Resume by name, or most recent session
--worktree, -w Isolated git worktree mode (parallel agents)
--skills, -s SKILL Preload skills (comma-separate or repeat)
--profile, -p NAME Use a named profile
--yolo Skip dangerous command approval
--pass-session-id Include session ID in system promptNo subcommand defaults to .
chathermes [flags] [command]
--version, -V 显示版本
--resume, -r SESSION 通过ID或标题恢复会话
--continue, -c [NAME] 通过名称恢复会话,或恢复最近的会话
--worktree, -w 独立Git工作树模式(并行Agent)
--skills, -s SKILL 预加载技能(逗号分隔或重复指定)
--profile, -p NAME 使用指定名称的配置文件
--yolo 跳过危险命令确认
--pass-session-id 在系统提示中包含会话ID未指定子命令时默认执行。
chatChat
聊天
hermes chat [flags]
-q, --query TEXT Single query, non-interactive
-m, --model MODEL Model (e.g. anthropic/claude-sonnet-4)
-t, --toolsets LIST Comma-separated toolsets
--provider PROVIDER Force provider (openrouter, anthropic, nous, etc.)
-v, --verbose Verbose output
-Q, --quiet Suppress banner, spinner, tool previews
--checkpoints Enable filesystem checkpoints (/rollback)
--source TAG Session source tag (default: cli)hermes chat [flags]
-q, --query TEXT 单次查询,非交互式
-m, --model MODEL 模型(例如 anthropic/claude-sonnet-4)
-t, --toolsets LIST 逗号分隔的工具集
--provider PROVIDER 强制指定提供商(openrouter、anthropic、nous等)
-v, --verbose 详细输出
-Q, --quiet 隐藏横幅、加载动画、工具预览
--checkpoints 启用文件系统检查点(/rollback)
--source TAG 会话来源标签(默认:cli)Configuration
配置
hermes setup [section] Interactive wizard (model|terminal|gateway|tools|agent)
hermes model Interactive model/provider picker
hermes config View current config
hermes config edit Open config.yaml in $EDITOR
hermes config set KEY VAL Set a config value
hermes config path Print config.yaml path
hermes config env-path Print .env path
hermes config check Check for missing/outdated config
hermes config migrate Update config with new options
hermes auth Interactive credential manager
hermes auth add PROVIDER Add OAuth or API-key credential (e.g. nous, openai-codex, qwen-oauth)
hermes auth list List stored credentials
hermes auth remove PROVIDER Remove a stored credential
hermes doctor [--fix] Check dependencies and config
hermes status [--all] Show component statushermes setup [section] 交互式向导(model|terminal|gateway|tools|agent)
hermes model 交互式模型/提供商选择器
hermes config 查看当前配置
hermes config edit 在$EDITOR中打开config.yaml
hermes config set KEY VAL 设置配置值
hermes config path 打印config.yaml路径
hermes config env-path 打印.env路径
hermes config check 检查缺失/过时的配置
hermes config migrate 更新配置以添加新选项
hermes auth 交互式凭证管理器
hermes auth add PROVIDER 添加OAuth或API密钥凭证(例如 nous、openai-codex、qwen-oauth)
hermes auth list 列出已存储的凭证
hermes auth remove PROVIDER 删除已存储的凭证
hermes doctor [--fix] 检查依赖项和配置
hermes status [--all] 显示组件状态Tools & Skills
工具与技能
hermes tools Interactive tool enable/disable (curses UI)
hermes tools list Show all tools and status
hermes tools enable NAME Enable a toolset
hermes tools disable NAME Disable a toolset
hermes skills list List installed skills
hermes skills search QUERY Search the skills hub
hermes skills install ID Install a skill (ID can be a hub identifier OR a direct https://…/SKILL.md URL; pass --name to override when frontmatter has no name)
hermes skills inspect ID Preview without installing
hermes skills config Enable/disable skills per platform
hermes skills check Check for updates
hermes skills update Update outdated skills
hermes skills uninstall N Remove a hub skill
hermes skills publish PATH Publish to registry
hermes skills browse Browse all available skills
hermes skills tap add REPO Add a GitHub repo as skill sourcehermes tools 交互式工具启用/禁用(curses UI)
hermes tools list 显示所有工具及其状态
hermes tools enable NAME 启用工具集
hermes tools disable NAME 禁用工具集
hermes skills list 列出已安装的技能
hermes skills search QUERY 搜索技能中心
hermes skills install ID 安装技能(ID可以是中心标识符或直接的https://…/SKILL.md URL;当前置元数据无名称时,传入--name覆盖)
hermes skills inspect ID 预览技能而不安装
hermes skills config 按平台启用/禁用技能
hermes skills check 检查更新
hermes skills update 更新过时的技能
hermes skills uninstall N 删除中心技能
hermes skills publish PATH 发布到注册表
hermes skills browse 浏览所有可用技能
hermes skills tap add REPO 添加GitHub仓库作为技能源MCP Servers
MCP服务器
hermes mcp serve Run Hermes as an MCP server
hermes mcp add NAME Add an MCP server (--url or --command)
hermes mcp remove NAME Remove an MCP server
hermes mcp list List configured servers
hermes mcp test NAME Test connection
hermes mcp configure NAME Toggle tool selectionhermes mcp serve 将Hermes作为MCP服务器运行
hermes mcp add NAME 添加MCP服务器(--url或--command)
hermes mcp remove NAME 删除MCP服务器
hermes mcp list 列出已配置的服务器
hermes mcp test NAME 测试连接
hermes mcp configure NAME 切换工具选择Gateway (Messaging Platforms)
网关(消息平台)
hermes gateway run Start gateway foreground
hermes gateway install Install as background service
hermes gateway start/stop Control the service
hermes gateway restart Restart the service
hermes gateway status Check status
hermes gateway setup Configure platformsSupported platforms: Telegram, Discord, Slack, WhatsApp, Signal, Email, SMS, Matrix, Mattermost, Home Assistant, DingTalk, Feishu, WeCom, BlueBubbles (iMessage), Weixin (WeChat), API Server, Webhooks. Open WebUI connects via the API Server adapter.
hermes gateway run 前台启动网关
hermes gateway install 安装为后台服务
hermes gateway start/stop 控制服务
hermes gateway restart 重启服务
hermes gateway status 检查状态
hermes gateway setup 配置平台支持的平台:Telegram、Discord、Slack、WhatsApp、Signal、Email、SMS、Matrix、Mattermost、Home Assistant、钉钉、飞书、企业微信、BlueBubbles(iMessage)、微信、API Server、Webhooks。Open WebUI通过API Server适配器连接。
Sessions
会话
hermes sessions list List recent sessions
hermes sessions browse Interactive picker
hermes sessions export OUT Export to JSONL
hermes sessions rename ID T Rename a session
hermes sessions delete ID Delete a session
hermes sessions prune Clean up old sessions (--older-than N days)
hermes sessions stats Session store statisticshermes sessions list 列出最近的会话
hermes sessions browse 交互式选择器
hermes sessions export OUT 导出为JSONL
hermes sessions rename ID T 重命名会话
hermes sessions delete ID 删除会话
hermes sessions prune 清理旧会话(--older-than N days)
hermes sessions stats 会话存储统计信息Cron Jobs
定时任务
hermes cron list List jobs (--all for disabled)
hermes cron create SCHED Create: '30m', 'every 2h', '0 9 * * *'
hermes cron edit ID Edit schedule, prompt, delivery
hermes cron pause/resume ID Control job state
hermes cron run ID Trigger on next tick
hermes cron remove ID Delete a job
hermes cron status Scheduler statushermes cron list 列出任务(--all显示已禁用的任务)
hermes cron create SCHED 创建任务:'30m'、'every 2h'、'0 9 * * *'
hermes cron edit ID 编辑调度、提示、交付方式
hermes cron pause/resume ID 控制任务状态
hermes cron run ID 在下一个触发点执行任务
hermes cron remove ID 删除任务
hermes cron status 调度器状态Webhooks
Webhooks
hermes webhook subscribe N Create route at /webhooks/<name>
hermes webhook list List subscriptions
hermes webhook remove NAME Remove a subscription
hermes webhook test NAME Send a test POSThermes webhook subscribe N 在/webhooks/<name>创建路由
hermes webhook list 列出订阅
hermes webhook remove NAME 删除订阅
hermes webhook test NAME 发送测试POST请求Profiles
配置文件
hermes profile list List all profiles
hermes profile create NAME Create (--clone, --clone-all, --clone-from)
hermes profile use NAME Set sticky default
hermes profile delete NAME Delete a profile
hermes profile show NAME Show details
hermes profile alias NAME Manage wrapper scripts
hermes profile rename A B Rename a profile
hermes profile export NAME Export to tar.gz
hermes profile import FILE Import from archivehermes profile list 列出所有配置文件
hermes profile create NAME 创建配置文件(--clone、--clone-all、--clone-from)
hermes profile use NAME 设置默认配置文件
hermes profile delete NAME 删除配置文件
hermes profile show NAME 显示详细信息
hermes profile alias NAME 管理包装脚本
hermes profile rename A B 重命名配置文件
hermes profile export NAME 导出为tar.gz
hermes profile import FILE 从归档导入Credential Pools
凭证池
hermes auth add Interactive credential wizard
hermes auth list [PROVIDER] List pooled credentials
hermes auth remove P INDEX Remove by provider + index
hermes auth reset PROVIDER Clear exhaustion statushermes auth add 交互式凭证向导
hermes auth list [PROVIDER] 列出池化凭证
hermes auth remove P INDEX 按提供商+索引删除
hermes auth reset PROVIDER 清除耗尽状态Other
其他
hermes insights [--days N] Usage analytics
hermes update Update to latest version
hermes pairing list/approve/revoke DM authorization
hermes plugins list/install/remove Plugin management
hermes honcho setup/status Honcho memory integration (requires honcho plugin)
hermes memory setup/status/off Memory provider config
hermes completion bash|zsh Shell completions
hermes acp ACP server (IDE integration)
hermes claw migrate Migrate from OpenClaw
hermes uninstall Uninstall Hermeshermes insights [--days N] 使用分析
hermes update 更新到最新版本
hermes pairing list/approve/revoke DM授权
hermes plugins list/install/remove 插件管理
hermes honcho setup/status Honcho记忆集成(需要honcho插件)
hermes memory setup/status/off 记忆提供商配置
hermes completion bash|zsh Shell补全
hermes acp ACP服务器(IDE集成)
hermes claw migrate 从OpenClaw迁移
hermes uninstall 卸载HermesSlash Commands (In-Session)
会话内斜杠命令
Type these during an interactive chat session. New commands land fairly
often; if something below looks stale, run in-session for the
authoritative list or see the live slash commands reference.
The registry of record is — every consumer
(autocomplete, Telegram menu, Slack mapping, ) derives from it.
/helphermes_cli/commands.py/help在交互式聊天会话中输入这些命令。新命令会频繁更新;如果以下内容看起来过时,可在会话中运行获取权威列表,或查看实时斜杠命令参考。记录的注册表是——所有消费端(自动补全、Telegram菜单、Slack映射、)均从中派生。
/helphermes_cli/commands.py/helpSession Control
会话控制
/new (/reset) Fresh session
/clear Clear screen + new session (CLI)
/retry Resend last message
/undo Remove last exchange
/title [name] Name the session
/compress Manually compress context
/stop Kill background processes
/rollback [N] Restore filesystem checkpoint
/snapshot [sub] Create or restore state snapshots of Hermes config/state (CLI)
/background <prompt> Run prompt in background
/queue <prompt> Queue for next turn
/steer <prompt> Inject a message after the next tool call without interrupting
/agents (/tasks) Show active agents and running tasks
/resume [name] Resume a named session
/goal [text|sub] Set a standing goal Hermes works on across turns until achieved
(subcommands: status, pause, resume, clear)
/redraw Force a full UI repaint (CLI)/new (/reset) 新会话
/clear 清屏并开启新会话(CLI)
/retry 重新发送最后一条消息
/undo 删除最后一次对话
/title [name] 为会话命名
/compress 手动压缩上下文
/stop 终止后台进程
/rollback [N] 恢复文件系统检查点
/snapshot [sub] 创建或恢复Hermes配置/状态快照(CLI)
/background <prompt> 在后台运行提示
/queue <prompt> 加入下一轮队列
/steer <prompt> 在下次工具调用后注入消息,不中断会话
/agents (/tasks) 显示活跃Agent和运行中的任务
/resume [name] 恢复指定名称的会话
/goal [text|sub] 设置Hermes在多轮对话中持续执行的目标,直至完成
(子命令:status、pause、resume、clear)
/redraw 强制重新绘制完整UI(CLI)Configuration
配置
/config Show config (CLI)
/model [name] Show or change model
/personality [name] Set personality
/reasoning [level] Set reasoning (none|minimal|low|medium|high|xhigh|show|hide)
/verbose Cycle: off → new → all → verbose
/voice [on|off|tts] Voice mode
/yolo Toggle approval bypass
/busy [sub] Control what Enter does while Hermes is working (CLI)
(subcommands: queue, steer, interrupt, status)
/indicator [style] Pick the TUI busy-indicator style (CLI)
(styles: kaomoji, emoji, unicode, ascii)
/footer [on|off] Toggle gateway runtime-metadata footer on final replies
/skin [name] Change theme (CLI)
/statusbar Toggle status bar (CLI)/config 查看配置(CLI)
/model [name] 查看或切换模型
/personality [name] 设置个性
/reasoning [level] 设置推理级别(none|minimal|low|medium|high|xhigh|show|hide)
/verbose 循环切换:off → new → all → verbose
/voice [on|off|tts] 语音模式
/yolo 切换是否跳过确认
/busy [sub] 控制Hermes工作时Enter键的行为(CLI)
(子命令:queue、steer、interrupt、status)
/indicator [style] 选择TUI忙碌指示器样式(CLI)
(样式:kaomoji、emoji、unicode、ascii)
/footer [on|off] 在最终回复中切换网关运行元数据页脚
/skin [name] 更改主题(CLI)
/statusbar 切换状态栏(CLI)Tools & Skills
工具与技能
/tools Manage tools (CLI)
/toolsets List toolsets (CLI)
/skills Search/install skills (CLI)
/skill <name> Load a skill into session
/reload-skills Re-scan ~/.hermes/skills/ for added/removed skills
/reload Reload .env variables into the running session (CLI)
/reload-mcp Reload MCP servers
/cron Manage cron jobs (CLI)
/curator [sub] Background skill maintenance (status, run, pin, archive, …)
/kanban [sub] Multi-profile collaboration board (tasks, links, comments)
/plugins List plugins (CLI)/tools 管理工具(CLI)
/toolsets 列出工具集(CLI)
/skills 搜索/安装技能(CLI)
/skill <name> 将技能加载到会话
/reload-skills 重新扫描~/.hermes/skills/以检测添加/删除的技能
/reload 将.env变量重新加载到运行中的会话(CLI)
/reload-mcp 重新加载MCP服务器
/cron 管理定时任务(CLI)
/curator [sub] 后台技能维护(status、run、pin、archive等)
/kanban [sub] 多配置文件协作看板(tasks、links、comments)
/plugins 列出插件(CLI)Gateway
网关
/approve Approve a pending command (gateway)
/deny Deny a pending command (gateway)
/restart Restart gateway (gateway)
/sethome Set current chat as home channel (gateway)
/update Update Hermes to latest (gateway)
/topic [sub] Enable or inspect Telegram DM topic sessions (gateway)
/platforms (/gateway) Show platform connection status (gateway)/approve 批准待处理命令(网关)
/deny 拒绝待处理命令(网关)
/restart 重启网关(网关)
/sethome 将当前聊天设置为主频道(网关)
/update 将Hermes更新到最新版本(网关)
/topic [sub] 启用或查看Telegram DM主题会话(网关)
/platforms (/gateway) 显示平台连接状态(网关)Utility
实用工具
/branch (/fork) Branch the current session
/fast Toggle priority/fast processing
/browser Open CDP browser connection
/history Show conversation history (CLI)
/save Save conversation to file (CLI)
/copy [N] Copy the last assistant response to clipboard (CLI)
/paste Attach clipboard image (CLI)
/image Attach local image file (CLI)/branch (/fork) 分支当前会话
/fast 切换优先级/快速处理
/browser 打开CDP浏览器连接
/history 显示对话历史(CLI)
/save 将对话保存到文件(CLI)
/copy [N] 将最后N条助手回复复制到剪贴板(CLI)
/paste 粘贴剪贴板图片(CLI)
/image 附加本地图片文件(CLI)Info
信息
/help Show commands
/commands [page] Browse all commands (gateway)
/usage Token usage
/insights [days] Usage analytics
/gquota Show Google Gemini Code Assist quota usage (CLI)
/status Session info (gateway)
/profile Active profile info
/debug Upload debug report (system info + logs) and get shareable links/help 显示命令
/commands [page] 浏览所有命令(网关)
/usage 令牌使用情况
/insights [days] 使用分析
/gquota 显示Google Gemini Code Assist配额使用情况(CLI)
/status 会话信息(网关)
/profile 活跃配置文件信息
/debug 上传调试报告(系统信息+日志)并获取可分享链接Exit
退出
/quit (/exit, /q) Exit CLI/quit (/exit, /q) 退出CLIKey Paths & Config
关键路径与配置
~/.hermes/config.yaml Main configuration
~/.hermes/.env API keys and secrets
$HERMES_HOME/skills/ Installed skills
~/.hermes/sessions/ Gateway routing index, request dumps, *.jsonl transcripts (and optional per-session JSON snapshots when sessions.write_json_snapshots: true)
~/.hermes/state.db Canonical session store (SQLite + FTS5)
~/.hermes/logs/ Gateway and error logs
~/.hermes/auth.json OAuth tokens and credential pools
~/.hermes/hermes-agent/ Source code (if git-installed)Profiles use with the same layout.
~/.hermes/profiles/<name>/~/.hermes/config.yaml 主配置文件
~/.hermes/.env API密钥和机密
$HERMES_HOME/skills/ 已安装的技能
~/.hermes/sessions/ 网关路由索引、请求转储、*.jsonl转录(当sessions.write_json_snapshots: true时,可选包含每个会话的JSON快照)
~/.hermes/state.db 标准会话存储(SQLite + FTS5)
~/.hermes/logs/ 网关和错误日志
~/.hermes/auth.json OAuth令牌和凭证池
~/.hermes/hermes-agent/ 源代码(如果通过git安装)配置文件使用,布局相同。
~/.hermes/profiles/<name>/Config Sections
配置章节
Edit with or .
hermes config edithermes config set section.key value| Section | Key options |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Full config reference: https://hermes-agent.nousresearch.com/docs/user-guide/configuration
使用或编辑。
hermes config edithermes config set section.key value| 章节 | 键选项 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Providers
提供商
20+ providers supported. Set via or .
hermes modelhermes setup| Provider | Auth | Key env var |
|---|---|---|
| OpenRouter | API key | |
| Anthropic | API key | |
| Nous Portal | OAuth | |
| OpenAI Codex | OAuth | |
| GitHub Copilot | Token | |
| Google Gemini | API key | |
| DeepSeek | API key | |
| xAI / Grok | API key | |
| Hugging Face | Token | |
| Z.AI / GLM | API key | |
| MiniMax | API key | |
| MiniMax CN | API key | |
| Kimi / Moonshot | API key | |
| Alibaba / DashScope | API key | |
| Xiaomi MiMo | API key | |
| Kilo Code | API key | |
| OpenCode Zen | API key | |
| OpenCode Go | API key | |
| Qwen OAuth | OAuth | |
| Custom endpoint | Config | |
| GitHub Copilot ACP | External | |
Full provider docs: https://hermes-agent.nousresearch.com/docs/integrations/providers
支持20+提供商。通过或设置。
hermes modelhermes setup| 提供商 | 认证方式 | 密钥环境变量 |
|---|---|---|
| OpenRouter | API密钥 | |
| Anthropic | API密钥 | |
| Nous Portal | OAuth | |
| OpenAI Codex | OAuth | |
| GitHub Copilot | 令牌 | |
| Google Gemini | API密钥 | |
| DeepSeek | API密钥 | |
| xAI / Grok | API密钥 | |
| Hugging Face | 令牌 | |
| Z.AI / GLM | API密钥 | |
| MiniMax | API密钥 | |
| MiniMax CN | API密钥 | |
| Kimi / Moonshot | API密钥 | |
| Alibaba / DashScope | API密钥 | |
| Xiaomi MiMo | API密钥 | |
| Kilo Code | API密钥 | |
| OpenCode Zen | API密钥 | |
| OpenCode Go | API密钥 | |
| Qwen OAuth | OAuth | |
| 自定义端点 | 配置 | |
| GitHub Copilot ACP | 外部 | |
Toolsets
工具集
Enable/disable via (interactive) or .
hermes toolshermes tools enable/disable NAME| Toolset | What it provides |
|---|---|
| Web search and content extraction |
| Web search only (subset of |
| Browser automation (Browserbase, Camofox, or local Chromium) |
| Shell commands and process management |
| File read/write/search/patch |
| Sandboxed Python execution |
| Image analysis |
| AI image generation |
| Video analysis and generation |
| Text-to-speech |
| Skill browsing and management |
| Persistent cross-session memory |
| Search past conversations |
| Subagent task delegation |
| Scheduled task management |
| Ask user clarifying questions |
| Cross-platform message sending |
| In-session task planning and tracking |
| Multi-agent work-queue tools (gated to workers) |
| Extra introspection/debug tools (off by default) |
| Minimal, low-risk toolset for locked-down sessions |
| Spotify playback and playlist control |
| Smart home control (off by default) |
| Discord integration tools |
| Discord admin/moderation tools |
| Feishu (Lark) document tools |
| Feishu (Lark) drive tools |
| Yuanbao integration tools |
| Reinforcement learning tools (off by default) |
| Mixture of Agents (off by default) |
Full enumeration lives in as the dict; is the default bundle most platforms inherit from.
toolsets.pyTOOLSETS_HERMES_CORE_TOOLSTool changes take effect on (new session). They do NOT apply mid-conversation to preserve prompt caching.
/reset通过(交互式)或启用/禁用。
hermes toolshermes tools enable/disable NAME| 工具集 | 提供的功能 |
|---|---|
| 网页搜索和内容提取 |
| 仅网页搜索( |
| 浏览器自动化(Browserbase、Camofox或本地Chromium) |
| Shell命令和进程管理 |
| 文件读/写/搜索/补丁 |
| 沙箱化Python执行 |
| 图像分析 |
| AI图像生成 |
| 视频分析和生成 |
| 文本转语音 |
| 技能浏览和管理 |
| 跨会话持久化记忆 |
| 搜索过往对话 |
| 子Agent任务委托 |
| 定时任务管理 |
| 向用户询问澄清问题 |
| 跨平台消息发送 |
| 会话内任务规划和跟踪 |
| 多Agent工作队列工具(仅限工作者) |
| 额外的内省/调试工具(默认关闭) |
| 用于锁定会话的最小低风险工具集 |
| Spotify播放和播放列表控制 |
| 智能家居控制(默认关闭) |
| Discord集成工具 |
| Discord管理/ moderation工具 |
| 飞书文档工具 |
| 飞书云盘工具 |
| 元宝集成工具 |
| 强化学习工具(默认关闭) |
| 多Agent混合(默认关闭) |
完整枚举在的字典中;是大多数平台继承的默认工具包。
toolsets.pyTOOLSETS_HERMES_CORE_TOOLS工具更改在(新会话)后生效。为了保留提示缓存,它们不会在对话中途应用。
/resetSecurity & Privacy Toggles
安全与隐私开关
Common "why is Hermes doing X to my output / tool calls / commands?" toggles — and the exact commands to change them. Most of these need a fresh session ( in chat, or start a new invocation) because they're read once at startup.
/resethermes常见的“Hermes为什么对我的输出/工具调用/命令执行X操作?”开关——以及更改它们的确切命令。其中大多数需要新会话(聊天中输入,或启动新的进程),因为它们在启动时仅读取一次。
/resethermesSecret redaction in tool output
工具输出中的机密脱敏
Secret redaction is on by default — tool output (terminal stdout, , web content, subagent summaries, etc.) is scanned for strings that look like API keys, tokens, and secrets before it enters the conversation context and logs. Leave it enabled for normal use:
read_filebash
hermes config set security.redact_secrets true # keep enabled globallyRestart required. is snapshotted at import time — toggling it mid-session (e.g. via from a tool call) will NOT take effect for the running process. Tell the user to change it in config from a terminal, then start a new session. This is deliberate — it prevents an LLM from flipping the toggle on itself mid-task.
security.redact_secretsexport HERMES_REDACT_SECRETS=falseDisable only when you deliberately need raw credential-like strings for debugging or redactor development:
bash
hermes config set security.redact_secrets false机密脱敏默认开启——工具输出(终端标准输出、、网页内容、子Agent摘要等)在进入对话上下文和日志之前,会被扫描以查找类似API密钥、令牌和机密的字符串。正常使用时保持开启:
read_filebash
hermes config set security.redact_secrets true # 全局保持开启需要重启。 在导入时被快照——在会话中途切换(例如通过工具调用执行)不会对运行中的进程生效。告知用户从终端更改配置,然后启动新会话。这是有意设计的——防止LLM在任务中途自行切换该开关。
security.redact_secretsexport HERMES_REDACT_SECRETS=false仅在出于调试或脱敏器开发目的,故意需要原始凭证类字符串时才禁用:
bash
hermes config set security.redact_secrets falsePII redaction in gateway messages
网关消息中的PII脱敏
Separate from secret redaction. When enabled, the gateway hashes user IDs and strips phone numbers from the session context before it reaches the model:
bash
hermes config set privacy.redact_pii true # enable
hermes config set privacy.redact_pii false # disable (default)与机密脱敏分离。启用后,网关会在会话上下文到达模型之前,对用户ID进行哈希处理并剥离电话号码:
bash
hermes config set privacy.redact_pii true # 启用
hermes config set privacy.redact_pii false # 禁用(默认)Command approval prompts
命令确认提示
By default (), Hermes prompts the user before running shell commands flagged as destructive (, , etc.). The modes are:
approvals.mode: manualrm -rfgit reset --hard- — always prompt (default)
manual - — use an auxiliary LLM to auto-approve low-risk commands, prompt on high-risk
smart - — skip all approval prompts (equivalent to
off)--yolo
bash
hermes config set approvals.mode smart # recommended middle ground
hermes config set approvals.mode off # bypass everything (not recommended)Per-invocation bypass without changing config:
hermes --yolo …export HERMES_YOLO_MODE=1
Note: YOLO / does NOT turn off secret redaction. They are independent.
approvals.mode: off默认情况下(),Hermes在运行标记为破坏性的Shell命令(如、等)之前会提示用户确认。模式包括:
approvals.mode: manualrm -rfgit reset --hard- —— 始终提示(默认)
manual - —— 使用辅助LLM自动批准低风险命令,高风险命令则提示确认
smart - —— 跳过所有确认提示(等效于
off)--yolo
bash
hermes config set approvals.mode smart # 推荐的折中方案
hermes config set approvals.mode off # 绕过所有确认(不推荐)无需更改配置的单次调用绕过:
hermes --yolo …export HERMES_YOLO_MODE=1
注意:YOLO / 不会关闭机密脱敏。它们是独立的。
approvals.mode: offShell hooks allowlist
Shell钩子允许列表
Some shell-hook integrations require explicit allowlisting before they fire. Managed via — prompted interactively the first time a hook wants to run.
~/.hermes/shell-hooks-allowlist.json某些Shell钩子集成需要显式加入允许列表才能触发。通过管理——钩子首次运行时会交互式提示。
~/.hermes/shell-hooks-allowlist.jsonDisabling the web/browser/image-gen tools
禁用web/browser/image-gen工具
To keep the model away from network or media tools entirely, open and toggle per-platform. Takes effect on next session (). See the Tools & Skills section above.
hermes tools/reset要让模型完全远离网络或媒体工具,打开并按平台切换。在下次会话()后生效。请参阅上面的“工具与技能”部分。
hermes tools/resetVoice & Transcription
语音与转录
STT (Voice → Text)
STT(语音→文本)
Voice messages from messaging platforms are auto-transcribed.
Provider priority (auto-detected):
- Local faster-whisper — free, no API key:
pip install faster-whisper - Groq Whisper — free tier: set
GROQ_API_KEY - OpenAI Whisper — paid: set
VOICE_TOOLS_OPENAI_KEY - Mistral Voxtral — set
MISTRAL_API_KEY
Config:
yaml
stt:
enabled: true
provider: local # local, groq, openai, mistral
local:
model: base # tiny, base, small, medium, large-v3消息平台的语音消息会自动转录。
提供商优先级(自动检测):
- 本地faster-whisper —— 免费,无需API密钥:
pip install faster-whisper - Groq Whisper —— 免费 tier:设置
GROQ_API_KEY - OpenAI Whisper —— 付费:设置
VOICE_TOOLS_OPENAI_KEY - Mistral Voxtral —— 设置
MISTRAL_API_KEY
配置:
yaml
stt:
enabled: true
provider: local # local、groq、openai、mistral
local:
model: base # tiny、base、small、medium、large-v3TTS (Text → Voice)
TTS(文本→语音)
| Provider | Env var | Free? |
|---|---|---|
| Edge TTS | None | Yes (default) |
| ElevenLabs | | Free tier |
| OpenAI | | Paid |
| MiniMax | | Paid |
| Mistral (Voxtral) | | Paid |
| NeuTTS (local) | None ( | Free |
Voice commands: (voice-to-voice), (always voice), .
/voice on/voice tts/voice off| 提供商 | 环境变量 | 免费? |
|---|---|---|
| Edge TTS | 无 | 是(默认) |
| ElevenLabs | | 免费 tier |
| OpenAI | | 付费 |
| MiniMax | | 付费 |
| Mistral (Voxtral) | | 付费 |
| NeuTTS(本地) | 无( | 免费 |
语音命令:(语音转语音)、(始终语音输出)、。
/voice on/voice tts/voice offSpawning Additional Hermes Instances
生成额外的Hermes实例
Run additional Hermes processes as fully independent subprocesses — separate sessions, tools, and environments.
运行额外的Hermes进程作为完全独立的子进程——拥有独立的会话、工具和环境。
When to Use This vs delegate_task
使用场景对比:delegate_task
vs 生成hermes
进程
delegate_taskhermes | Spawning | |
|---|---|---|
| Isolation | Separate conversation, shared process | Fully independent process |
| Duration | Minutes (bounded by parent loop) | Hours/days |
| Tool access | Subset of parent's tools | Full tool access |
| Interactive | No | Yes (PTY mode) |
| Use case | Quick parallel subtasks | Long autonomous missions |
| 生成 | |
|---|---|---|
| 隔离性 | 独立对话,共享进程 | 完全独立的进程 |
| 持续时间 | 分钟级(受父循环限制) | 小时/天级 |
| 工具访问 | 父进程工具的子集 | 完整工具访问权限 |
| 交互性 | 无 | 是(PTY模式) |
| 用例 | 快速并行子任务 | 长时间自主任务 |
One-Shot Mode
一次性模式
terminal(command="hermes chat -q 'Research GRPO papers and write summary to ~/research/grpo.md'", timeout=300)terminal(command="hermes chat -q '研究GRPO论文并将摘要写入~/research/grpo.md'", timeout=300)Background for long tasks:
后台运行长时间任务:
terminal(command="hermes chat -q 'Set up CI/CD for ~/myapp'", background=true)
undefinedterminal(command="hermes chat -q '为~/myapp设置CI/CD'", background=true)
undefinedInteractive PTY Mode (via tmux)
交互式PTY模式(通过tmux)
Hermes uses prompt_toolkit, which requires a real terminal. Use tmux for interactive spawning:
undefinedHermes使用prompt_toolkit,需要真实终端。使用tmux进行交互式生成:
undefinedStart
启动
terminal(command="tmux new-session -d -s agent1 -x 120 -y 40 'hermes'", timeout=10)
terminal(command="tmux new-session -d -s agent1 -x 120 -y 40 'hermes'", timeout=10)
Wait for startup, then send a message
等待启动,然后发送消息
terminal(command="sleep 8 && tmux send-keys -t agent1 'Build a FastAPI auth service' Enter", timeout=15)
terminal(command="sleep 8 && tmux send-keys -t agent1 '构建FastAPI认证服务' Enter", timeout=15)
Read output
读取输出
terminal(command="sleep 20 && tmux capture-pane -t agent1 -p", timeout=5)
terminal(command="sleep 20 && tmux capture-pane -t agent1 -p", timeout=5)
Send follow-up
发送后续指令
terminal(command="tmux send-keys -t agent1 'Add rate limiting middleware' Enter", timeout=5)
terminal(command="tmux send-keys -t agent1 '添加限流中间件' Enter", timeout=5)
Exit
退出
terminal(command="tmux send-keys -t agent1 '/exit' Enter && sleep 2 && tmux kill-session -t agent1", timeout=10)
undefinedterminal(command="tmux send-keys -t agent1 '/exit' Enter && sleep 2 && tmux kill-session -t agent1", timeout=10)
undefinedMulti-Agent Coordination
多Agent协作
undefinedundefinedAgent A: backend
Agent A:后端
terminal(command="tmux new-session -d -s backend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t backend 'Build REST API for user management' Enter", timeout=15)
terminal(command="tmux new-session -d -s backend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t backend '构建用户管理REST API' Enter", timeout=15)
Agent B: frontend
Agent B:前端
terminal(command="tmux new-session -d -s frontend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t frontend 'Build React dashboard for user management' Enter", timeout=15)
terminal(command="tmux new-session -d -s frontend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t frontend '构建用户管理React仪表盘' Enter", timeout=15)
Check progress, relay context between them
检查进度,在它们之间传递上下文
terminal(command="tmux capture-pane -t backend -p | tail -30", timeout=5)
terminal(command="tmux send-keys -t frontend 'Here is the API schema from the backend agent: ...' Enter", timeout=5)
undefinedterminal(command="tmux capture-pane -t backend -p | tail -30", timeout=5)
terminal(command="tmux send-keys -t frontend '这是后端Agent提供的API架构:...' Enter", timeout=5)
undefinedSession Resume
恢复会话
undefinedundefinedResume most recent session
恢复最近的会话
terminal(command="tmux new-session -d -s resumed 'hermes --continue'", timeout=10)
terminal(command="tmux new-session -d -s resumed 'hermes --continue'", timeout=10)
Resume specific session
恢复特定会话
terminal(command="tmux new-session -d -s resumed 'hermes --resume 20260225_143052_a1b2c3'", timeout=10)
undefinedterminal(command="tmux new-session -d -s resumed 'hermes --resume 20260225_143052_a1b2c3'", timeout=10)
undefinedTips
提示
- Prefer for quick subtasks — less overhead than spawning a full process
delegate_task - Use (worktree mode) when spawning agents that edit code — prevents git conflicts
-w - Set timeouts for one-shot mode — complex tasks can take 5-10 minutes
- Use for fire-and-forget — no PTY needed
hermes chat -q - Use tmux for interactive sessions — raw PTY mode has vs
\rissues with prompt_toolkit\n - For scheduled tasks, use the tool instead of spawning — handles delivery and retry
cronjob
- 对于快速子任务,优先使用—— 比生成完整进程的开销更小
delegate_task - 编辑代码时使用(工作树模式) —— 防止Git冲突
-w - 为一次性模式设置超时 —— 复杂任务可能需要5-10分钟
- 使用实现即发即忘 —— 无需PTY
hermes chat -q - 使用tmux进行交互式会话 —— 原始PTY模式与prompt_toolkit存在和
\r的问题\n - 对于定时任务,使用工具而非生成进程 —— 它会处理交付和重试
cronjob
Durable & Background Systems
持久化与后台系统
Four systems run alongside the main conversation loop. Quick reference
here; full developer notes live in , user-facing docs under
.
AGENTS.mdwebsite/docs/user-guide/features/有四个系统与主对话循环并行运行。此处为快速参考;完整开发者说明在中,面向用户的文档在下。
AGENTS.mdwebsite/docs/user-guide/features/Delegation (delegate_task
)
delegate_task任务委托(delegate_task
)
delegate_taskSynchronous subagent spawn — the parent waits for the child's summary
before continuing its own loop. Isolated context + terminal session.
- Single: .
delegate_task(goal, context, toolsets) - Batch: runs children in parallel, capped by
delegate_task(tasks=[{goal, ...}, ...])(default 3).delegation.max_concurrent_children - Roles: (default; cannot re-delegate) vs
leaf(can spawn its own workers, bounded byorchestrator).delegation.max_spawn_depth - Not durable. If the parent is interrupted, the child is
cancelled. For work that must outlive the turn, use or
cronjob.terminal(background=True, notify_on_complete=True)
Config: in .
delegation.*config.yaml同步子Agent生成——父进程等待子进程的摘要后再继续自身循环。拥有独立上下文和终端会话。
- 单次任务: 。
delegate_task(goal, context, toolsets) - 批量任务: 并行运行子任务,上限为
delegate_task(tasks=[{goal, ...}, ...])(默认3)。delegation.max_concurrent_children - 角色: (默认;无法重新委托) vs
leaf(可以生成自己的工作者,受orchestrator限制)。delegation.max_spawn_depth - 非持久化。 如果父进程被中断,子进程会被取消。对于必须在对话轮次结束后继续的工作,使用或
cronjob。terminal(background=True, notify_on_complete=True)
配置:中的。
config.yamldelegation.*Cron (scheduled jobs)
定时任务(cron)
Durable scheduler — + . Drive it via
the tool, the CLI (, , ,
, , , ), or the slash command.
cron/jobs.pycron/scheduler.pycronjobhermes cronlistaddeditpauseresumerunremove/cron- Schedules: duration (,
"30m"), "every" phrase ("2h"), 5-field cron ("every monday 9am"), or ISO timestamp."0 9 * * *" - Per-job knobs: ,
skills/modeloverride,provider(pre-run data collection;scriptmakes the script the whole job),no_agent=True(chain job A's output into job B),context_from(run in a specific dir with itsworkdir/AGENTS.mdloaded), multi-platform delivery.CLAUDE.md - Invariants: 3-minute hard interrupt per run, file prevents duplicate ticks across processes, cron sessions pass
.tick.lockby default, and cron deliveries are framed with a header/footer instead of being mirrored into the target gateway session (keeps role alternation intact).skip_memory=True
持久化调度器—— + 。通过工具、 CLI(、、、、、、)或斜杠命令操作。
cron/jobs.pycron/scheduler.pycronjobhermes cronlistaddeditpauseresumerunremove/cron- 调度规则: 时长(、
"30m")、“every”短语("2h")、5字段cron表达式("every monday 9am")或ISO时间戳。"0 9 * * *" - 每个任务的配置项: 、
skills/model覆盖、provider(预运行数据收集;script使脚本成为整个任务)、no_agent=True(将任务A的输出传递到任务B)、context_from(在特定目录中运行,加载其workdir/AGENTS.md)、多平台交付。CLAUDE.md - 不变规则: 每次运行有3分钟硬中断,文件防止跨进程重复触发,定时会话默认传递
.tick.lock,定时交付会添加页眉/页脚,而不是镜像到目标网关会话(保持角色交替完整)。skip_memory=True
Curator (skill lifecycle)
技能管理器(Curator)
Background maintenance for agent-created skills. Tracks usage, marks
idle skills stale, archives stale ones, keeps a pre-run tar.gz backup
so nothing is lost.
- CLI: —
hermes curator <verb>,status,run,pause,resume,pin,unpin,archive,restore,prune,backup.rollback - Slash: mirrors the CLI.
/curator <subcommand> - Scope: only touches skills with provenance. Bundled + hub-installed skills are off-limits. Never deletes — max destructive action is archive. Pinned skills are exempt from every auto-transition and every LLM review pass.
created_by: "agent" - Telemetry: sidecar at holds per-skill
~/.hermes/skills/.usage.json,use_count,view_count,patch_count,last_activity_at,state.pinned
Config: (, , ,
, , ).
User docs: https://hermes-agent.nousresearch.com/docs/user-guide/features/curator
curator.*enabledinterval_hoursmin_idle_hoursstale_after_daysarchive_after_daysbackup.*Agent创建的技能的后台维护。跟踪使用情况,标记闲置技能为过时,归档过时技能,保留预运行tar.gz备份,以防数据丢失。
- CLI: ——
hermes curator <verb>、status、run、pause、resume、pin、unpin、archive、restore、prune、backup。rollback - 斜杠命令: 与CLI镜像。
/curator <subcommand> - 范围: 仅处理来源的技能。捆绑包和中心安装的技能不在范围内。永不删除——最大的破坏性操作是归档。固定的技能不受任何自动转换和LLM审查的影响。
created_by: "agent" - 遥测: 辅助文件保存每个技能的
~/.hermes/skills/.usage.json、use_count、view_count、patch_count、last_activity_at、state。pinned
配置:(、、、、、)。
用户文档:https://hermes-agent.nousresearch.com/docs/user-guide/features/curator
curator.*enabledinterval_hoursmin_idle_hoursstale_after_daysarchive_after_daysbackup.*Kanban (multi-agent work queue)
看板(Kanban)
Durable SQLite board for multi-profile / multi-worker collaboration.
Users drive it via ; dispatcher-spawned workers
see a focused toolset gated by , and
orchestrator profiles can opt into the broader toolset. Normal
sessions still have zero schema footprint unless configured.
hermes kanban <verb>kanban_*HERMES_KANBAN_TASKkanbankanban_*- CLI verbs (common): ,
init,create(aliaslist),ls,show,assign,link,unlink,comment,complete,block,unblock,archive. Less common:tail,watch,stats,runs,log,dispatch,daemon.gc - Worker/orchestrator toolset: ,
kanban_show,kanban_complete,kanban_block,kanban_heartbeat,kanban_comment,kanban_create; profiles that explicitly enable thekanban_linktoolset outside a dispatcher-spawned task also getkanbanandkanban_listfor board routing.kanban_unblock - Dispatcher runs inside the gateway by default
() — reclaims stale claims, promotes ready tasks, atomically claims, spawns assigned profiles. Auto-blocks a task after
kanban.dispatch_in_gateway: trueconsecutive spawn failures (default 2; configurable viafailure_limitor per-taskkanban.failure_limit).max_retries - Isolation: board is the hard boundary (workers get
pinned in env); tenant is a soft namespace within a board for workspace-path + memory-key isolation.
HERMES_KANBAN_BOARD
用于多配置文件/多工作者协作的持久化SQLite看板。用户通过操作;调度器生成的工作者看到受限制的工具集,协调器配置文件可以选择启用更广泛的工具集。正常会话在未配置的情况下,架构占用为零。
hermes kanban <verb>HERMES_KANBAN_TASKkanban_*kanbankanban_*- 常用CLI动词: 、
init、create(别名list)、ls、show、assign、link、unlink、comment、complete、block、unblock、archive。不常用:tail、watch、stats、runs、log、dispatch、daemon。gc - 工作者/协调器工具集: 、
kanban_show、kanban_complete、kanban_block、kanban_heartbeat、kanban_comment、kanban_create;在调度器生成的任务之外显式启用kanban_link工具集的配置文件还会获得kanban和kanban_list用于看板路由。kanban_unblock - 调度器默认在网关内运行()——回收过时的任务认领、推进就绪任务、原子化认领、生成分配的配置文件。在连续
kanban.dispatch_in_gateway: true次生成失败后自动阻止任务(默认2;可通过failure_limit或每个任务的kanban.failure_limit配置)。max_retries - 隔离性: 看板是硬边界(工作者的环境中固定);租户是看板内的软命名空间,用于工作区路径和记忆密钥隔离。
HERMES_KANBAN_BOARD
Windows-Specific Quirks
Windows特定问题
Hermes runs natively on Windows (PowerShell, cmd, Windows Terminal, git-bash
mintty, VS Code integrated terminal). Most of it just works, but a handful
of differences between Win32 and POSIX have bitten us — document new ones
here as you hit them so the next person (or the next session) doesn't
rediscover them from scratch.
Hermes可在Windows上原生运行(PowerShell、cmd、Windows Terminal、git-bash mintty、VS Code集成终端)。大多数功能正常工作,但Win32和POSIX之间的一些差异会导致问题——遇到新问题时请在此处记录,以便下一个人(或下一个会话)不必从头重新发现。
Input / Keybindings
输入/按键绑定
Alt+Enter doesn't insert a newline. Windows Terminal intercepts Alt+Enter
at the terminal layer to toggle fullscreen — the keystroke never reaches
prompt_toolkit. Use Ctrl+Enter instead. Windows Terminal delivers
Ctrl+Enter as LF (), distinct from plain Enter ( / CR), and the
CLI binds to newline insertion on only (see
+ the Windows-only binding in ).
Side effect: the raw Ctrl+J keystroke also inserts a newline on Windows —
unavoidable, because Windows Terminal collapses Ctrl+Enter and Ctrl+J to
the same keycode at the Win32 console API layer. No conflicting binding
existed for Ctrl+J on Windows, so this is a harmless side effect.
c-jc-mc-jwin32_bind_prompt_submit_keysc-jcli.pymintty / git-bash behaves the same (fullscreen on Alt+Enter) unless you
disable Alt+Fn shortcuts in Options → Keys. Easier to just use Ctrl+Enter.
Diagnosing keybindings. Run
(repo root) to see exactly how prompt_toolkit identifies each keystroke
in the current terminal. Answers questions like "does Shift+Enter come
through as a distinct key?" (almost never — most terminals collapse it
to plain Enter) or "what byte sequence is my terminal sending for
Ctrl+Enter?" This is how the Ctrl+Enter = c-j fact was established.
python scripts/keystroke_diagnostic.pyAlt+Enter无法插入换行符。 Windows Terminal在终端层拦截Alt+Enter以切换全屏——按键永远无法到达prompt_toolkit。请改用Ctrl+Enter。Windows Terminal将Ctrl+Enter作为LF()传递,与普通Enter( / CR)不同,CLI仅在上将绑定到换行插入(请参阅 + 中Windows专属的绑定)。副作用:在Windows上,原始Ctrl+J按键也会插入换行符——这是不可避免的,因为Windows Terminal在Win32控制台API层将Ctrl+Enter和Ctrl+J合并为相同的键码。Windows上没有与Ctrl+J冲突的绑定,因此这是无害的副作用。
c-jc-mwin32c-j_bind_prompt_submit_keyscli.pyc-jmintty / git-bash的行为相同(Alt+Enter切换全屏),除非在Options → Keys中禁用Alt+Fn快捷键。直接使用Ctrl+Enter更简单。
诊断按键绑定。 运行(仓库根目录),查看prompt_toolkit在当前终端中如何识别每个按键。回答诸如“Shift+Enter是否作为不同的按键传递?”(几乎从不——大多数终端将其合并为普通Enter)或“我的终端为Ctrl+Enter发送什么字节序列?”等问题。这就是Ctrl+Enter = c-j这一事实的确定方式。
python scripts/keystroke_diagnostic.pyConfig / Files
配置/文件
HTTP 400 "No models provided" on first run. was saved
with a UTF-8 BOM (common when Windows apps write it). Re-save as UTF-8
without BOM. writes without BOM; manual edits in
Notepad are the usual culprit.
config.yamlhermes config edit首次运行时出现HTTP 400 "No models provided"错误。 保存时带有UTF-8 BOM(Windows应用程序写入时常见)。重新保存为无BOM的UTF-8格式。写入时不带BOM;手动使用记事本编辑通常是罪魁祸首。
config.yamlhermes config editexecute_code
/ Sandbox
execute_codeexecute_code
/ 沙箱
execute_codeWinError 10106 ("The requested service provider could not be loaded
or initialized") from the sandbox child process — it can't create an
socket, so the loopback-TCP RPC fallback fails before
. Root cause is usually not a broken Winsock LSP; it's
Hermes's own env scrubber dropping / /
from the child env. Python's module needs to locate
. Fixed via the allowlist in
. If you still hit it, echo
inside an block to confirm is set. Full
diagnostic recipe in .
AF_INETconnect()SYSTEMROOTWINDIRCOMSPECsocketSYSTEMROOTmswsock.dll_WINDOWS_ESSENTIAL_ENV_VARStools/code_execution_tool.pyos.environexecute_codeSYSTEMROOTreferences/execute-code-sandbox-env-windows.md沙箱子进程出现WinError 10106(“无法加载或初始化请求的服务提供商”)——它无法创建套接字,因此环回TCP RPC回落在之前失败。根本原因通常不是Winsock LSP损坏;而是Hermes的环境清理器从子环境中删除了 / / 。Python的模块需要来定位。通过中的允许列表修复。如果仍然遇到此问题,在块中回显以确认已设置。完整诊断方法在中。
AF_INETconnect()SYSTEMROOTWINDIRCOMSPECsocketSYSTEMROOTmswsock.dlltools/code_execution_tool.py_WINDOWS_ESSENTIAL_ENV_VARSexecute_codeos.environSYSTEMROOTreferences/execute-code-sandbox-env-windows.mdTesting / Contributing
测试/贡献
scripts/run_tests.sh.venv/bin/activatevenv/Scripts/pytest + pytest-xdist + pyyamlPYTHONPATHbash
"/c/Program Files/Python311/python" -m pip install --user pytest pytest-xdist pyyaml
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/foo/test_bar.py -v --tb=short -n 0Use , not — 's default already
includes , and the wrapper's CI-parity guarantees don't apply off POSIX.
-n 0-n 4pyproject.tomladdopts-nPOSIX-only tests need skip guards. Common markers already in the codebase:
- Symlinks — elevated privileges on Windows
- file modes — POSIX mode bits not enforced on NTFS by default
0o600 - — Unix-only (see
signal.SIGALRM)tests/conftest.py::_enforce_test_timeout - Winsock / Windows-specific regressions —
@pytest.mark.skipif(sys.platform != "win32", ...)
Use the existing skip-pattern style ( or
) to stay consistent with the rest of the
suite.
sys.platform == "win32"sys.platform.startswith("win")scripts/run_tests.sh.venv/bin/activatevenv/Scripts/pytest + pytest-xdist + pyyamlPYTHONPATHbash
"/c/Program Files/Python311/python" -m pip install --user pytest pytest-xdist pyyaml
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/foo/test_bar.py -v --tb=short -n 0使用,而不是——的默认已经包含,并且包装器的CI一致性保证不适用于非POSIX系统。
-n 0-n 4pyproject.tomladdopts-n仅POSIX的测试需要跳过标记。 代码库中已有的常见标记:
- 符号链接——Windows上需要提升权限
- 文件模式——NTFS默认不强制POSIX模式位
0o600 - ——仅Unix可用(请参阅
signal.SIGALRM)tests/conftest.py::_enforce_test_timeout - Winsock / Windows特定回归测试——
@pytest.mark.skipif(sys.platform != "win32", ...)
使用现有的跳过模式(或),与套件的其余部分保持一致。
sys.platform == "win32"sys.platform.startswith("win")Path / Filesystem
路径/文件系统
Line endings. Git may warn . Cosmetic — the repo's normalizes. Don't
let editors auto-convert committed POSIX-newline files to CRLF.
LF will be replaced by CRLF the next time Git touches it.gitattributesForward slashes work almost everywhere. is accepted by
every Hermes tool and most Windows APIs. Prefer forward slashes in code
and logs — avoids shell-escaping backslashes in bash.
C:/Users/...行尾。 Git可能会警告。这只是 cosmetic——仓库的会进行规范化。不要让编辑器自动将提交的POSIX换行文件转换为CRLF。
LF will be replaced by CRLF the next time Git touches it.gitattributes正斜杠几乎在所有地方都有效。 被所有Hermes工具和大多数Windows API接受。在代码和日志中优先使用正斜杠——避免在bash中转义反斜杠。
C:/Users/...Troubleshooting
故障排除
Voice not working
语音功能不工作
- Check in config.yaml
stt.enabled: true - Verify provider: or set API key
pip install faster-whisper - In gateway: . In CLI: exit and relaunch.
/restart
- 检查config.yaml中
stt.enabled: true - 验证提供商:或设置API密钥
pip install faster-whisper - 在网关中:。在CLI中:退出并重新启动。
/restart
Tool not available
工具不可用
- — check if toolset is enabled for your platform
hermes tools - Some tools need env vars (check )
.env - after enabling tools
/reset
- ——检查工具集是否为你的平台启用
hermes tools - 某些工具需要环境变量(检查)
.env - 启用工具后执行
/reset
Model/provider issues
模型/提供商问题
- — check config and dependencies
hermes doctor - — re-authenticate OAuth providers (or
hermes auth)hermes auth add <provider> - Check has the right API key
.env - Copilot 403: tokens do NOT work for Copilot API. You must use the Copilot-specific OAuth device code flow via
gh auth login→ GitHub Copilot.hermes model
- ——检查配置和依赖项
hermes doctor - ——重新认证OAuth提供商(或
hermes auth)hermes auth add <provider> - 检查是否有正确的API密钥
.env - Copilot 403错误:令牌不适用于Copilot API。你必须通过
gh auth login→ GitHub Copilot使用Copilot专属的OAuth设备代码流。hermes model
Changes not taking effect
更改未生效
- Tools/skills: starts a new session with updated toolset
/reset - Config changes: In gateway: . In CLI: exit and relaunch.
/restart - Code changes: Restart the CLI or gateway process
- 工具/技能: 启动带有更新工具集的新会话
/reset - 配置更改: 在网关中:。在CLI中:退出并重新启动。
/restart - 代码更改: 重启CLI或网关进程
Skills not showing
技能未显示
- — verify installed
hermes skills list - — check platform enablement
hermes skills config - Load explicitly: or
/skill namehermes -s name
- ——验证已安装
hermes skills list - ——检查平台启用情况
hermes skills config - 显式加载:或
/skill namehermes -s name
Gateway issues
网关问题
Check logs first:
bash
grep -i "failed to send\|error" ~/.hermes/logs/gateway.log | tail -20Common gateway problems:
- Gateway dies on SSH logout: Enable linger:
sudo loginctl enable-linger $USER - Gateway dies on WSL2 close: WSL2 requires in
systemd=truefor systemd services to work. Without it, gateway falls back to/etc/wsl.conf(dies when session closes).nohup - Gateway crash loop: Reset the failed state:
systemctl --user reset-failed hermes-gateway
首先检查日志:
bash
grep -i "failed to send\|error" ~/.hermes/logs/gateway.log | tail -20常见网关问题:
- SSH注销后网关终止:启用linger:
sudo loginctl enable-linger $USER - WSL2关闭后网关终止:WSL2需要在中设置
/etc/wsl.conf才能让systemd服务工作。没有它,网关会回退到systemd=true(会话关闭时终止)。nohup - 网关崩溃循环:重置失败状态:
systemctl --user reset-failed hermes-gateway
Platform-specific issues
平台特定问题
- Discord bot silent: Must enable Message Content Intent in Bot → Privileged Gateway Intents.
- Slack bot only works in DMs: Must subscribe to event. Without it, the bot ignores public channels.
message.channels - Windows-specific issues (newline, WinError 10106, UTF-8 BOM config, test suite, line endings): see the dedicated Windows-Specific Quirks section above.
Alt+Enter
- Discord机器人无响应:必须在Bot → Privileged Gateway Intents中启用Message Content Intent。
- Slack机器人仅在DM中工作:必须订阅事件。没有它,机器人会忽略公共频道。
message.channels - Windows特定问题(换行、WinError 10106、UTF-8 BOM配置、测试套件、行尾):请参阅上面专门的Windows特定问题部分。
Alt+Enter
Auxiliary models not working
辅助模型不工作
If tasks (vision, compression, session_search) fail silently, the provider can't find a backend. Either set or , or explicitly configure each auxiliary task's provider:
auxiliaryautoOPENROUTER_API_KEYGOOGLE_API_KEYbash
hermes config set auxiliary.vision.provider <your_provider>
hermes config set auxiliary.vision.model <model_name>如果任务(视觉、压缩、会话搜索)静默失败,提供商无法找到后端。要么设置或,要么显式配置每个辅助任务的提供商:
auxiliaryautoOPENROUTER_API_KEYGOOGLE_API_KEYbash
hermes config set auxiliary.vision.provider <your_provider>
hermes config set auxiliary.vision.model <model_name>Where to Find Things
查找资源
| Looking for... | Location |
|---|---|
| Config options | |
| Available tools | |
| Slash commands | |
| Skills catalog | |
| Provider setup | |
| Platform setup | |
| MCP servers | |
| Profiles | |
| Cron jobs | |
| Memory | |
| Env variables | |
| CLI commands | |
| Gateway logs | |
| Session files | |
| Source code | |
| 查找内容 | 位置 |
|---|---|
| 配置选项 | |
| 可用工具 | |
| 斜杠命令 | 会话中输入 |
| 技能目录 | |
| 提供商设置 | |
| 平台设置 | |
| MCP服务器 | |
| 配置文件 | |
| 定时任务 | |
| 记忆 | |
| 环境变量 | |
| CLI命令 | |
| 网关日志 | |
| 会话文件 | |
| 源代码 | |
Contributor Quick Reference
贡献者快速参考
For occasional contributors and PR authors. Full developer docs: https://hermes-agent.nousresearch.com/docs/developer-guide/
面向偶尔贡献者和PR作者。完整开发者文档:https://hermes-agent.nousresearch.com/docs/developer-guide/
Project Layout
项目布局
hermes-agent/
├── run_agent.py # AIAgent — core conversation loop
├── model_tools.py # Tool discovery and dispatch
├── toolsets.py # Toolset definitions
├── cli.py # Interactive CLI (HermesCLI)
├── hermes_state.py # SQLite session store
├── agent/ # Prompt builder, context compression, memory, model routing, credential pooling, skill dispatch
├── hermes_cli/ # CLI subcommands, config, setup, commands
│ ├── commands.py # Slash command registry (CommandDef)
│ ├── config.py # DEFAULT_CONFIG, env var definitions
│ └── main.py # CLI entry point and argparse
├── tools/ # One file per tool
│ └── registry.py # Central tool registry
├── gateway/ # Messaging gateway
│ └── platforms/ # Platform adapters (telegram, discord, etc.)
├── cron/ # Job scheduler
├── tests/ # ~3000 pytest tests
└── website/ # Docusaurus docs siteConfig: (settings), (API keys).
~/.hermes/config.yaml~/.hermes/.envhermes-agent/
├── run_agent.py # AIAgent — 核心对话循环
├── model_tools.py # 工具发现和调度
├── toolsets.py # 工具集定义
├── cli.py # 交互式CLI(HermesCLI)
├── hermes_state.py # SQLite会话存储
├── agent/ # 提示构建器、上下文压缩、记忆、模型路由、凭证池、技能调度
├── hermes_cli/ # CLI子命令、配置、设置、命令
│ ├── commands.py # 斜杠命令注册表(CommandDef)
│ ├── config.py # DEFAULT_CONFIG、环境变量定义
│ └── main.py # CLI入口点和argparse
├── tools/ # 每个工具对应一个文件
│ └── registry.py # 中央工具注册表
├── gateway/ # 消息网关
│ └── platforms/ # 平台适配器(telegram、discord等)
├── cron/ # 任务调度器
├── tests/ # ~3000个pytest测试
└── website/ # Docusaurus文档站点配置:(设置)、(API密钥)。
~/.hermes/config.yaml~/.hermes/.envAdding a Tool (3 files)
添加工具(3个文件)
1. Create :
tools/your_tool.pypython
import json, os
from tools.registry import registry
def check_requirements() -> bool:
return bool(os.getenv("EXAMPLE_API_KEY"))
def example_tool(param: str, task_id: str = None) -> str:
return json.dumps({"success": True, "data": "..."})
registry.register(
name="example_tool",
toolset="example",
schema={"name": "example_tool", "description": "...", "parameters": {...}},
handler=lambda args, **kw: example_tool(
param=args.get("param", ""), task_id=kw.get("task_id")),
check_fn=check_requirements,
requires_env=["EXAMPLE_API_KEY"],
)2. Add to → list.
toolsets.py_HERMES_CORE_TOOLSAuto-discovery: any file with a top-level call is imported automatically — no manual list needed.
tools/*.pyregistry.register()All handlers must return JSON strings. Use for paths, never hardcode .
get_hermes_home()~/.hermes1. 创建:
tools/your_tool.pypython
import json, os
from tools.registry import registry
def check_requirements() -> bool:
return bool(os.getenv("EXAMPLE_API_KEY"))
def example_tool(param: str, task_id: str = None) -> str:
return json.dumps({"success": True, "data": "..."})
registry.register(
name="example_tool",
toolset="example",
schema={"name": "example_tool", "description": "...", "parameters": {...}},
handler=lambda args, **kw: example_tool(
param=args.get("param", ""), task_id=kw.get("task_id")),
check_fn=check_requirements,
requires_env=["EXAMPLE_API_KEY"],
)2. 添加到 → 列表。
toolsets.py_HERMES_CORE_TOOLS自动发现:任何带有顶级调用的文件都会被自动导入——无需手动添加到列表。
registry.register()tools/*.py所有处理程序必须返回JSON字符串。使用获取路径,永远不要硬编码。
get_hermes_home()~/.hermesAdding a Slash Command
添加斜杠命令
- Add to
CommandDefinCOMMAND_REGISTRYhermes_cli/commands.py - Add handler in →
cli.pyprocess_command() - (Optional) Add gateway handler in
gateway/run.py
All consumers (help text, autocomplete, Telegram menu, Slack mapping) derive from the central registry automatically.
- 在的
hermes_cli/commands.py中添加COMMAND_REGISTRYCommandDef - 在的
cli.py中添加处理程序process_command() - (可选)在中添加网关处理程序
gateway/run.py
所有消费端(帮助文本、自动补全、Telegram菜单、Slack映射)都会自动从中央注册表派生。
Agent Loop (High Level)
Agent循环(高级)
run_conversation():
1. Build system prompt
2. Loop while iterations < max:
a. Call LLM (OpenAI-format messages + tool schemas)
b. If tool_calls → dispatch each via handle_function_call() → append results → continue
c. If text response → return
3. Context compression triggers automatically near token limitrun_conversation():
1. 构建系统提示
2. 循环直到迭代次数超过最大值:
a. 调用LLM(OpenAI格式消息 + 工具架构)
b. 如果有tool_calls → 通过handle_function_call()调度每个调用 → 添加结果 → 继续循环
c. 如果是文本响应 → 返回
3. 接近令牌限制时自动触发上下文压缩Testing
测试
bash
python -m pytest tests/ -o 'addopts=' -q # Full suite
python -m pytest tests/tools/ -q # Specific area- Tests auto-redirect to temp dirs — never touch real
HERMES_HOME~/.hermes/ - Run full suite before pushing any change
- Use to clear any baked-in pytest flags
-o 'addopts='
Windows contributors: currently looks for POSIX venvs ( / ) and will error out on Windows where the layout is + . The Hermes-installed venv at also has no or — it's stripped for end-user install size. Workaround: install pytest + pytest-xdist + pyyaml into a system Python 3.11 user site (), then run tests directly:
scripts/run_tests.sh.venv/bin/activatevenv/bin/activatevenv/Scripts/activatepython.exevenv/Scripts/pippytest/c/Program Files/Python311/python -m pip install --user pytest pytest-xdist pyyamlbash
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/tools/test_foo.py -v --tb=short -n 0Use (not ) because 's default already includes , and the wrapper's CI-parity story doesn't apply off-POSIX.
-n 0-n 4pyproject.tomladdopts-nCross-platform test guards: tests that use POSIX-only syscalls need a skip marker. Common ones already in the codebase:
- Symlink creation → (see
@pytest.mark.skipif(sys.platform == "win32", reason="Symlinks require elevated privileges on Windows"))tests/cron/test_cron_script.py - POSIX file modes (0o600, etc.) → (see
@pytest.mark.skipif(sys.platform.startswith("win"), reason="POSIX mode bits not enforced on Windows"))tests/hermes_cli/test_auth_toctou_file_modes.py - → Unix-only (see
signal.SIGALRM)tests/conftest.py::_enforce_test_timeout - Live Winsock / Windows-specific regression tests →
@pytest.mark.skipif(sys.platform != "win32", reason="Windows-specific regression")
Monkeypatching is not enough when the code under test also calls / / . Those functions re-read the real OS independently, so a test that sets on a Windows runner will still see and route through the Windows branch. Patch all three together:
sys.platformplatform.system()platform.release()platform.mac_ver()sys.platform = "linux"platform.system() == "Windows"python
monkeypatch.setattr(sys, "platform", "linux")
monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(platform, "release", lambda: "6.8.0-generic")See for a worked example.
tests/agent/test_prompt_builder.py::TestEnvironmentHintsbash
python -m pytest tests/ -o 'addopts=' -q # 完整套件
python -m pytest tests/tools/ -q # 特定区域- 测试会自动将重定向到临时目录——永远不会触及真实的
HERMES_HOME~/.hermes/ - 推送任何更改前运行完整套件
- 使用清除任何内置的pytest标志
-o 'addopts='
Windows贡献者: 目前查找POSIX虚拟环境( / ),在Windows上会出错,因为Windows的布局是 + 。Hermes安装的虚拟环境在中也没有或——为了减小终端用户安装大小而被剥离。解决方法:将pytest + pytest-xdist + pyyaml安装到系统Python 3.11用户站点(),然后直接运行测试:
scripts/run_tests.sh.venv/bin/activatevenv/bin/activatevenv/Scripts/activatepython.exevenv/Scripts/pippytest/c/Program Files/Python311/python -m pip install --user pytest pytest-xdist pyyamlbash
export PYTHONPATH="$(pwd)"
"/c/Program Files/Python311/python" -m pytest tests/tools/test_foo.py -v --tb=short -n 0使用(不是),因为的默认已经包含,并且包装器的CI一致性不适用于非POSIX系统。
-n 0-n 4pyproject.tomladdopts-n跨平台测试保护: 使用仅POSIX系统调用的测试需要跳过标记。代码库中已有的常见标记:
- 创建符号链接 → (请参阅
@pytest.mark.skipif(sys.platform == "win32", reason="Symlinks require elevated privileges on Windows"))tests/cron/test_cron_script.py - POSIX文件模式(0o600等) → (请参阅
@pytest.mark.skipif(sys.platform.startswith("win"), reason="POSIX mode bits not enforced on Windows"))tests/hermes_cli/test_auth_toctou_file_modes.py - → 仅Unix可用(请参阅
signal.SIGALRM)tests/conftest.py::_enforce_test_timeout - 实时Winsock / Windows特定回归测试 →
@pytest.mark.skipif(sys.platform != "win32", reason="Windows-specific regression")
仅猴子补丁不够,当被测代码也调用 / / 时。这些函数会独立读取真实操作系统,因此在Windows运行器上设置的测试仍然会看到并进入Windows分支。需要同时补丁这三个函数:
sys.platformplatform.system()platform.release()platform.mac_ver()sys.platform = "linux"platform.system() == "Windows"python
monkeypatch.setattr(sys, "platform", "linux")
monkeypatch.setattr(platform, "system", lambda: "Linux")
monkeypatch.setattr(platform, "release", lambda: "6.8.0-generic")请参阅获取示例。
tests/agent/test_prompt_builder.py::TestEnvironmentHintsExtending the system prompt's execution-environment block
扩展系统提示的执行环境块
Factual guidance about the host OS, user home, cwd, terminal backend, and shell (bash vs. PowerShell on Windows) is emitted from . This is also where the WSL hint and per-backend probe logic live. The convention:
agent/prompt_builder.py::build_environment_hints()- Local terminal backend → emit host info (OS, , cwd) + Windows-specific notes (hostname ≠ username,
$HOMEuses bash not PowerShell).terminal - Remote terminal backend (anything in :
_REMOTE_TERMINAL_BACKENDS) → suppress host info entirely and describe only the backend. A livedocker, singularity, modal, daytona, ssh, managed_modal/uname/whoamiprobe runs inside the backend viapwd, cached per process intools.environments.get_environment(...).execute(...), with a static fallback if the probe times out._BACKEND_PROBE_CACHE - Key fact for prompt authoring: when , every file tool (
TERMINAL_ENV != "local",read_file,write_file,patch) runs inside the backend container, not on the host. The system prompt must never describe the host in that case — the agent can't touch it.search_files
Full design notes, the exact emitted strings, and testing pitfalls:
.
references/prompt-builder-environment-hints.mdRefactor-safety pattern (POSIX-equivalence guard): when you extract inline logic into a helper that adds Windows/platform-specific behavior, keep a oracle function in the test file that's a verbatim copy of the old code, then parametrize-diff against it. Example: . This locks in the invariant that POSIX behavior is bit-for-bit identical and makes any future drift fail loudly with a clear diff.
_legacy_<name>tests/tools/test_code_execution_windows_env.py::TestPosixEquivalence关于主机OS、用户主目录、cwd、终端后端和Shell(Windows上的bash vs. PowerShell)的事实指导,从生成。这也是WSL提示和每个后端探测逻辑所在的位置。约定:
agent/prompt_builder.py::build_environment_hints()- 本地终端后端 → 生成主机信息(OS、、cwd) + Windows特定说明(主机名≠用户名,
$HOME使用bash而非PowerShell)。terminal - 远程终端后端(中的任何后端:
_REMOTE_TERMINAL_BACKENDS) → 完全抑制主机信息,仅描述后端。通过docker, singularity, modal, daytona, ssh, managed_modal在后端内部运行实时tools.environments.get_environment(...).execute(...)/uname/whoami探测,每个进程在pwd中缓存,如果探测超时则使用静态回退。_BACKEND_PROBE_CACHE - 提示编写的关键事实:当时,所有文件工具(
TERMINAL_ENV != "local"、read_file、write_file、patch)都在后端容器内运行,而不是在主机上。系统提示在这种情况下绝不能描述主机——Agent无法触及它。search_files
完整设计说明、确切生成的字符串和测试陷阱:
。
references/prompt-builder-environment-hints.md重构安全模式(POSIX等效性保护): 当你将内联逻辑提取到添加Windows/平台特定行为的辅助函数时,在测试文件中保留一个 oracle函数,它是旧代码的逐字副本,然后参数化地与它进行差异比较。示例:。这锁定了POSIX行为完全相同的不变量,任何未来的偏差都会通过清晰的差异明显失败。
_legacy_<name>tests/tools/test_code_execution_windows_env.py::TestPosixEquivalenceCommit Conventions
提交约定
type: concise subject line
Optional body.Types: , , , ,
fix:feat:refactor:docs:chore:type: 简洁的主题行
可选正文。类型:、、、、
fix:feat:refactor:docs:chore:Key Rules
关键规则
- Never break prompt caching — don't change context, tools, or system prompt mid-conversation
- Message role alternation — never two assistant or two user messages in a row
- Use from
get_hermes_home()for all paths (profile-safe)hermes_constants - Config values go in , secrets go in
config.yaml.env - New tools need a so they only appear when requirements are met
check_fn
- 永远不要破坏提示缓存 —— 不要在对话中途更改上下文、工具或系统提示
- 消息角色交替 —— 永远不要连续出现两条助手或两条用户消息
- 使用中的
hermes_constants获取所有路径(支持配置文件)get_hermes_home() - 配置值放在中,机密放在
config.yaml中.env - 新工具需要,以便仅在满足要求时显示
check_fn