Repository navigation
Description
Summary
The built-in curator background task entered a 4-hour loop during its weekly LLM review pass, making 811 API calls and consuming ~91M input tokens before hitting the Kimi Code rate limit. The trigger appears to be a cluster of 26 symlinked lark-* skills that curator tried to consolidate into umbrella skills.
Environment
- Hermes version:
0.16.0(gateway service on Ubuntu 24.04, Tencent Cloud) - Model used by curator:
kimi-k2.6viakimi-coding - Curator config (default):
curator: enabled: true interval_hours: 168 min_idle_hours: 2 stale_after_days: 30 archive_after_days: 90 prune_builtins: true
What happened
On 2026-06-11 at 19:56 CST, curator started an auto review session 20260611_195641_84bd7f. It ran until 23:55 CST, when the provider returned:
HTTP 429: You've reached your usage limit for this period.
During those ~4 hours:
- 811 successful API calls logged in
~/.hermes/logs/agent.log - ~91,400,370 input tokens, ~224,670 output tokens
- Input context grew from ~23K tokens per call to ~106K tokens per call
- Primary tools used:
skill_view(264 times) andterminal(393 times)
Candidate skills
Curator saw 36 agent-created candidates, including 26 lark-* skills that are symlinks from ~/.hermes/skills/lark-* to ~/.agents/skills/lark-*. Examples:
lark-approval, lark-apps, lark-attendance, lark-base, lark-calendar,
lark-contact, lark-doc, lark-drive, lark-event, lark-im, lark-mail,
...
These skills share the lark- prefix, so curator's umbrella-building prompt treated them as a single large cluster and repeatedly inspected each skill's full directory package.
Root cause (observed)
- Curator's review prompt asks it to "scan the full candidate list" and "identify prefix clusters".
- For each cluster, it inspects skills as "complete directory packages" via
skill_view+terminal. - The conversation context accumulates previously viewed skill contents, causing input tokens to grow monotonically.
- There appears to be no per-task token budget or turn limit that would stop this runaway growth.
Related issues
- [Performance] Runaway context growth causes very high latency on multi-tool turns #35113 — Runaway context growth causes very high latency on multi-tool turns
- Bug: symlinked skills under ~/.hermes/skills are omitted from skills_list and bare-name skill_view lookup #8293 — Symlinked skills under
~/.hermes/skillsare omitted from listings/lookups - curator rollback fails on external skill symlinks in snapshots #44658 — Curator rollback fails on external skill symlinks
Suggested fixes
- Add a per-curator-run token/turn budget with graceful shutdown.
- Limit context window for curator review (e.g., summarize already-inspected skills instead of retaining full content).
- Treat symlinked external skills more conservatively during consolidation.
- Expose curator cost/running status to the user before large runs.
Logs available
I can provide ~/.hermes/logs/agent.log and ~/.hermes/logs/gateway.log excerpts for the session 20260611_195641_84bd7f if helpful.
Activity
AIalliAI commentedon Jun 12, 2026
Verified the core of this on main. The curator fork is created with
max_iterations=9999(agent/curator.py,_run_llm_review) — the in-code comment says a pass "typically takes 50-100 API calls" — andIterationBudgetis the only stop condition; there is no token budget on the curator path, so your 811-call/91M-token run was bounded only by the provider 429. The review prompt also pushes long runs explicitly ("Iterate… Don't stop after 3 merges", "fewer than 10 archives → you stopped too early").One correction on the symlink framing: the candidate list is built from
tools/skill_usage.pywhich still usesPath.rglob("SKILL.md")and does not traverse symlinked skill dirs (the #8293 fix migratedskills_list/skill_viewtoiter_skill_index_files/os.walk(followlinks=True)but notskill_usage.py) — so the lark-* symlinks shouldn't appear in the rendered candidate list, though the review agent can still find them viaskills_listmid-run. The runaway doesn't need symlinks: any large prefix cluster triggers it. (Separate latent hazard:os.walk(followlinks=True)inagent/skill_utils.py:639has no cycle protection — a true symlink cycle would hang the tool call itself.)Smallest fix per the contribution rubric: bridge a
curator.max_iterations(orauxiliary.curator.max_iterations) config.yaml key to replace the hardcoded 9999, with a graceful final-summary turn on exhaustion (the_budget_grace_callmachinery already exists).michcu10 commentedon Jul 16, 2026
Another reproduction of this on a different trigger — a bundled-heavy skill library (rather than symlinked clusters), plus a couple of adjacent findings that connect this to #64393 / #53959.
Environment
0.18.2[3f2a389c] (2026-07-16), Python 3.11.15, Linux (DGX Spark, GB10 / aarch64)nvidia/Qwen3.6-35B-A3B-NVFP4viacustom(local vLLM, 256k context,max_model_len=262144)curator.consolidate: true,interval_hours: 168,prune_builtins: trueWhat happened
Two distinct failure modes on the same library, neither of which committed anything (
75 → 75 (+0)):1. Runaway context growth (matches this issue). With curator reasoning on, the review session grows monotonically as it
skill_views full skill packages, then dies:Even a 256k-context model overflows because compression triggers at the global
compression.threshold(0.5 → 131k) and then can't compress back under target. Settingauxiliary.curator.extra_body.reasoning.effort: lowlet the dry-run (analysis) complete with a good plan, but the mutating run still overflowed — so this is not only a reasoning-token issue; it's the "no per-run budget / retain full content" problem described here.2.
same_tool_failure_halton bundled-skill refusals (new angle, ties into #64393). With curator reasoning disabled to cut context, it no longer overflows and reaches the mutation step — but the LLM's umbrella plan targets bundled skills, whichskill_managecorrectly refuses (the #20273 protection), so it loops on refusals until the guardrail hard-stops it:Root cause of this variant: the curator includes bundled/hub skills in the consolidation candidate set (consistent with #64393's provenance-labeling bug), but the execution layer forbids modifying them. On a bundled-heavy library, the LLM's plan is dominated by operations it is structurally unable to perform, so the umbrella pass can never commit and just burns the run (and, with reasoning off, can't adapt →
same_tool_failure_halt, cf #53959).3. Secondary: write to a non-existent parent dir. During the same run the curator attempted to create an umbrella at a doubled path without creating the directory first:
(possibly related to the subfile-handling in #44762.)
Why it matters
On a bundled-heavy library the curator's LLM consolidation is effectively a no-op that still consumes a full multi-minute pass every cycle, because the majority of its candidates are immutable.
Suggestions (in addition to this issue's existing list)
skill_managewill refuse. (Complements [Bug]: curator status labels bundled prune candidates as agent-created skills #64393 and Feature: Declarative Skill Protection Policy for consistent skill safety across all operations #27997.)same_tool_failure_haltin the curator context (cf [Feature Request] same_tool_failure_halt guardrail should support fallback strategies instead of hard stop #53959) so a batch of refusals degrades to "skip and continue" rather than a hard stop.Happy to provide the full per-run
REPORT.md/run.jsonif useful.GottZ commentedon Jul 28, 2026
Summary
Three PRs address #44771: #44887 replaces the 9,999-iteration value with a configurable setting defaulting to 200 and excludes externally resolved skill symlinks, while #44923 and #70669 impose a fixed 200-iteration ceiling; #44923 additionally deduplicates identical resolved skill targets. The iteration bound addresses the contributor-verified absence of any earlier stop condition, whereas the symlink changes cover only one trigger and are not required for the reproduced non-symlink runaway.
Related pull requests
fixes— (+159/-6) — fixes, but closed and superseded: the diff defaults curator reviews to 200 iterations but permits arbitrary configured values, including values above 9,999, and adds external-symlink exclusion plus regression tests. Despite the APPROVED review, its closure notes that external ownership is now handled upstream by skills.external_dirs/is_external_skill_path() and that 9,999 was considered intentional; however, the contributor verification and a non-symlink reproduction show that external symlinks are not the underlying requirement for runaway context growth.fixes— (+17/-1) — fixes, but closed/stale: it hard-caps reviews at 200 and deduplicates candidate directories only when their resolved targets are identical. It overlaps the effective iteration-bound fix but its symlink rationale does not cover distinct targets or non-symlink triggers, and the contributor marked the PR stale.best fix— (+1/-1) — fixes and is the best minimal active patch: it changes the sole curator stop condition from 9,999 to a fixed 200 iterations, directly bounding API calls for symlinked, bundled-heavy, and other large-cluster triggers without coupling the fix to disputed symlink handling.Duplicates
#44887, #44923, and #70669 all overlap on reducing the default 9,999-iteration review path to 200; #44923 and #70669 make the same fixed one-line cap, while #44887 instead makes the value configurable and includes broader symlink handling.
Suggested consolidation
Merge #70669 as the smallest trigger-independent bound on the contributor-verified runaway path. This recommendation acknowledges #44887's closure rationale that 9,999 was intentional and external skills were addressed upstream: those changes resolve ownership of one candidate source, but they do not bound the documented non-symlink runaway, while #70669 does; keep closed #44887 and #44923 as superseded duplicates rather than reopening them.
Complex graph
flowchart LR classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151 classDef best stroke-width:3px,stroke:#b45309 classDef target stroke-width:3px,stroke:#4338ca I44771(["issue #44771 (open)"]) subgraph Dup44887 ["PRs duplicating each other"] P44887["PR #44887 (closed)"] P44923["PR #44923 (closed)"] P70669["PR #70669 (open)"] end P44887 -->|fixes| I44771 P44923 -->|fixes| I44771 P70669 -->|best fix| I44771 class I44771 open class I44771 target class P44887 closed class P44923 closed class P70669 open class P70669 best click I44771 "https://github.com/NousResearch/hermes-agent/issues/44771" click P44887 "https://github.com/NousResearch/hermes-agent/pull/44887" click P44923 "https://github.com/NousResearch/hermes-agent/pull/44923" click P70669 "https://github.com/NousResearch/hermes-agent/pull/70669"Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 10 kB of PR diffs, 5 kB of issue/PR text, 7 kB of discussion (8 comments), 7 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
GottZ commentedon Jul 30, 2026
Delta since our previous triage comment
@teknium1 confirmed the complete enforcement path for #70669: the curator’s
max_iterationsvalue becomes theIterationBudgetused as the conversation loop’s API-call bound. They also identified a missing regression assertion in the existing constructor-kwargs test, so the patch should remain open until that assertion is added.Changed pull requests
best fix— (+1/-1) — best fix, changes requested: The diff directly bounds the verified runaway path at 200 iterations, but the contributor keep_open review requires a regression assertion that the curator review fork passesmax_iterations == 200; add that test before merge.Suggested consolidation
The recommendation remains #70669, but keep it open and merge only after the contributor-requested regression assertion is added.
Complex graph unchanged since our previous triage comment.
Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 10 kB of PR diffs, 5 kB of issue/PR text, 9 kB of discussion (10 comments), 4 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.