Hermes target: invalid toolset name in `platform_toolsets.cli` + refresh overwrites an existing `mcp_servers.codegraph` block
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- tooling
Direzione di ricerca
Start in src/installer/targets/hermes.ts, at upsertCodeGraphToolset (which writes the invalid mcp-codegraph line) and upsertCodeGraphMcpServer with renderCodeGraphMcpChild (which overwrites an existing mcp_servers.codegraph block). Check the existing contract tests in tests/installer-targets.test.ts. Done means a refresh adds only missing keys, leaves user-set values intact, and no longer writes the mcp-codegraph platform_toolsets entry; the platform_toolsets approach still needs a maintainer decision.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
- codegraph 1.5.0 → 1.6.2 on Linux (Debian), installed via the official installer; upgrade via
codegraph upgrade. - Hermes Agent v0.21.6 (git install), config file
~/.hermes/config.yaml(YAML, 43 top-level keys). codegraph upgradeprinted:Hermes Agent: refreshed <config>.yaml.
Both problems below come from that refresh step. They are independent: one is a wrong key value, one is a destructive write.
1. platform_toolsets.cli gets a toolset name Hermes does not know
upsertCodeGraphToolset() (src/installer/targets/hermes.ts, compiled lib/dist/installer/targets/hermes.js:322/326/334) adds - mcp-codegraph to platform_toolsets.cli. Every Hermes CLI start then prints:
Warning: Unknown toolsets: mcp-codegraph
Hermes-side reason: the startup check accepts a name only if validate_toolset(name) is true, or the name is a key of mcp_servers (bare server name), or it is a plugin toolset key (hermes_cli/cli_init_mixin.py). For an MCP server registered as codegraph, the bare name codegraph passes — it is an mcp_servers key, and tools/mcp_tool_registration.py:366 registers it as a toolset alias to mcp-codegraph (validate_toolset() accepts registry aliases, toolsets.py:476-478). The literal mcp-codegraph matches none of the three checks.
The comment at the top of the target file says the entry is required, otherwise "the MCP server can be configured and connected but its tools may still be filtered out". In current Hermes that is not the case, and the naive fix is not safe either. _merge_mcp_servers() (hermes_cli/tools_config.py:694-706) has allowlist semantics:
- platform list contains no MCP server name → every globally enabled MCP server is enabled for that platform;
- platform list names at least one MCP server → the list becomes an allowlist, and only the named servers survive.
Verified against a config with three enabled servers (agentmail, codegraph, donsetch) in Hermes v0.21.6:
platform_toolsets.cli |
MCP toolsets resolved for the session |
|---|---|
[…] , mcp-codegraph, … (target's current output) |
agentmail, codegraph, donsetch (+ the inert literal) |
[…] , codegraph, … (the "write the bare name" fix) |
codegraph only — agentmail and donsetch silently dropped |
[…] with no MCP name at all |
agentmail, codegraph, donsetch |
So writing the bare server name would introduce a silent regression: it hides every other configured MCP server from that platform. The minimal correct behaviour is to not write a platform_toolsets entry at all (and to not re-add one the user deleted — see below).
2. The refresh rewrites an existing, valid MCP block
upsertCodeGraphMcpServer() (hermes.js:281-299) reads the existing mcp_servers.codegraph: child block, compares it to the hardcoded template renderCodeGraphMcpChild() (hermes.js:261-272) and, when they differ, splice()s the template over the user's block. Any adaptation is destroyed — including a working absolute command path:
# before the upgrade (working, produced by an earlier install)
mcp_servers:
codegraph:
command: /home/<user>/.local/bin/codegraph
args: [serve, --mcp]
timeout: 120
connect_timeout: 60
enabled: true
# after `codegraph upgrade` — command reverted to the bare name
mcp_servers:
codegraph:
command: codegraph
...
Reproducer: set mcp_servers.codegraph.command to an absolute path, run any install/refresh, diff the file — exactly one line changed, back to codegraph. The same applies to args, timeout, connect_timeout, enabled.
For an agent config, a bare command is a real risk: MCP stdio servers are spawned by the agent's process environment, and Hermes runs in contexts whose PATH does not always contain the user bin directory. A hand-set absolute path is the deliberate fix for that; the refresh silently undoes it.
Expectation, and consistent with the installer's own contract tests for the other targets (__tests__/installer-targets.test.ts: install idempotency, sibling preservation, byte-equal re-runs returning unchanged): a refresh should add missing keys and leave existing, valid values alone. Deleting a key the user removed is also part of that: platform_toolsets entries are added when missing (hermes.js:331-334), so a user who removes the invalid mcp-codegraph line to silence the warning gets it back on the next refresh — the warning is not fixable from the config side as long as the target keeps writing it.
Versions / evidence
src/installer/targets/hermes.tsis byte-identical betweenv1.5.0andv1.6.2, so none of this changed in the current release:- v1.5.0: sha256
410c9b67183c455a9cd19e99aa62c911e6522b38bfde97a024a9269d47c9bec5 - v1.6.2: sha256
410c9b67183c455a9cd19e99aa62c911e6522b38bfde97a024a9269d47c9bec5
- v1.5.0: sha256
- Hermes-side references:
hermes_cli/cli_init_mixin.py(unknown-toolset startup check),toolsets.py:476-478(validate_toolsetaccepts registry aliases),tools/mcp_tool_registration.py:366(registers<server>→mcp-<server>alias),hermes_cli/tools_config.py:694-706(_merge_mcp_serversallowlist behaviour).
Suggested fix
- Stop writing
platform_toolsetsfor Hermes (no entry = all enabled MCP servers, which is what the config had before the installer touched it), or make it conditional on the user not having a saved list for that platform. - Make the MCP-block upsert additive: fill in keys that are missing, leave present keys untouched (the same "preserve siblings / byte-equal re-run = unchanged" contract the other targets already test).
- If a
platform_toolsetsentry is kept for older Hermes versions, at least use the bare server name and never overwrite a value the user set.
- Lingua principale
- C
- Stelle
- 73.2k
- Fork
- 4.7k
- Merge medio
- 4h 46m
- PR unite (30g)
- 478
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di colbymchenry/codegraph
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
colbymchenry/codegraph#2634 ·
I maintainer di solito rispondono entro 1 giorno
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Forse già presa @Ancienttwo l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
colbymchenry/codegraph#2617 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Invalid regular expression: /\boperator++\s*(?:<[^<>()]*>)?\s*\(/: Nothing to repeat (v1.6.2)Aperta
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 72/100
colbymchenry/codegraph#2482 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
codegraph ui - does not workAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
colbymchenry/codegraph#1900 · 2 commenti · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
colbymchenry/codegraph#1700 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di colbymchenry/codegraph
Issue simili
-
Go device SDK: Whisper transcriber keeps buffering and transcribing audio appended after Stop()Forse già presa @apoorvdarshan l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
BasedHardware/omi#22770 ·
I maintainer di solito rispondono entro 1 giorno
-
severity: low
Difficoltà 1/5 1-3 ore Idoneità per principianti 89/100
luainkernel/lunatik#1980 ·
I maintainer di solito rispondono entro 1 giorno
-
Investigation-Finding Issue-Bug Needs-Author-Feedback Needs-Triage Product-Command Palette
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/PowerToys#51421 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
EchoTools/nevr-runtime#698 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
FujiNetWIFI/fujinet-firmware#2079 ·
I maintainer di solito rispondono entro 1 giorno