hermes - 💡(How to fix) Fix [Bug]: Role directory sync is extremely slow with hundreds of roles

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…

Root Cause

Root Cause Analysis / 根本原因分析 (if known)

RAW_BUFFERClick to expand / collapse

Bug Description / Bug 描述

When the roles directory contains a large number of roles (hundreds), every role sync operation becomes extremely slow. The system appears to scan and synchronize the entire roles directory on every update, causing significant delays and poor user experience.

当 roles 角色目录包含大量角色(数百个)时,每次角色同步操作都变得极其缓慢。系统似乎在每次更新时都扫描和同步整个角色目录,导致严重延迟和糟糕的用户体验。

角色目录包含大量角色时,每次更新都同步整个角色目录和技能,体验非常差,速度太慢。

Steps to Reproduce / 复现步骤

  1. Have 300+ roles in the roles directory / 在 roles 目录中放置 300+ 个角色
  2. Perform any role update operation (add, modify, delete) / 执行任何角色更新操作(添加、修改、删除)
  3. Observe the long sync time (can take 30+ seconds with hundreds of roles) / 观察漫长的同步时间(数百个角色可能需要 30+ 秒)

Expected Behavior / 期望行为

  • Role sync should only process the changed role(s), not the entire directory / 角色同步应该只处理已更改的角色,而不是整个目录
  • Incremental sync: only scan and update modified files / 增量同步:只扫描和更新已修改的文件
  • Skills sync should also be incremental / 技能同步也应该是增量的

Actual Behavior / 实际行为

  • Full directory scan on every role update / 每次角色更新都进行全目录扫描
  • All skills are re-synchronized on every operation / 每次操作都重新同步所有技能
  • Performance degrades linearly with number of roles / 性能随角色数量线性下降

Affected Component / 受影响组件

  • Agent Core (conversation loop, context compression, memory)
  • Skills (skill loading, skill hub, skill guard)
  • Configuration (config.yaml, .env, hermes setup)

Operating System / 操作系统

Windows 10/11, Linux, macOS

Proposed Fix / 建议修复方案

  1. Incremental sync: Use file system watchers or timestamps to only process changed files / 增量同步:使用文件系统监视器或时间戳只处理已更改的文件
  2. Lazy loading: Load roles on-demand rather than preloading all at startup / 延迟加载:按需加载角色,而不是启动时预加载所有角色
  3. Index caching: Maintain an index of roles/skills and only update when files change / 索引缓存:维护角色/技能索引,只在文件更改时更新
  4. Parallel sync: Use concurrent processing for independent role files / 并行同步:对独立的角色文件使用并发处理

Root Cause Analysis / 根本原因分析 (if known)

The current implementation likely loads all roles from disk on each sync operation, which does not scale well with large numbers of roles. / 当前实现可能在每次同步操作时从磁盘加载所有角色,不能很好地扩展到大量角色。

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]: Role directory sync is extremely slow with hundreds of roles