lark-cli enters Hermes context when HERMES_HOME is inherited, then bind ignores HERMES_HOME path
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17.3k
- Forks
- 1.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 105
Description
Summary
After installing Hermes, unrelated CLI/automation processes that happen to inherit HERMES_HOME start failing when running lark-cli.
lark-cli detects a Hermes context and refuses to use the existing local lark-cli config, returning:
{
"ok": false,
"error": {
"type": "config",
"subtype": "not_configured",
"message": "hermes context detected but lark-cli is not bound to it",
"hint": "read `lark-cli config bind --help`, then ask the user to confirm intent and identity preset..."
}
}
However, when trying to bind Hermes explicitly, lark-cli does not appear to use the HERMES_HOME path that triggered Hermes detection. Instead, it looks for a different default path:
{
"ok": false,
"error": {
"type": "config",
"subtype": "invalid_config",
"message": "failed to read Hermes config: open C:\\Users\\example\\.hermes\\.env: The system cannot find the path specified.",
"hint": "verify Hermes is installed and configured at C:\\Users\\example\\.hermes\\.env"
}
}
In this environment, HERMES_HOME points somewhere else, for example:
HERMES_HOME=C:\Users\example\AppData\Local\hermes
Expected behavior
If lark-cli detects Hermes because HERMES_HOME is present, then one of the following should happen:
config bind --source hermesshould read Hermes config fromHERMES_HOME, orlark-clishould not enter Hermes context unless Hermes config can actually be resolved, or- there should be a documented way to force normal local config mode, e.g. an env var or flag like
--ignore-agent-context.
Actual behavior
Any unrelated process that inherits HERMES_HOME is treated as Hermes context.
This breaks existing lark-cli usage in non-Hermes automation tasks. Commands such as:
lark-cli auth status
lark-cli config show
lark-cli im +chat-messages-list --as user ...
fail before using the existing local config.
If HERMES_HOME is removed from the current shell, the same commands work again and use the normal local config:
Remove-Item Env:HERMES_HOME -ErrorAction SilentlyContinue
lark-cli auth status
Reproduction
- Have a working local
lark-cliconfig. - Install Hermes or otherwise set
HERMES_HOMEto a Hermes data directory. - In a non-Hermes shell or automation process that inherits
HERMES_HOME, run:
lark-cli auth status
- Observe
hermes context detected but lark-cli is not bound to it. - Try:
lark-cli config bind --source hermes --identity user-default
- Observe that bind looks for
C:\Users\example\.hermes\.envinstead of the path fromHERMES_HOME.
Impact
This causes unrelated automation jobs that use lark-cli to fail after Hermes is installed, even though those jobs are not Hermes jobs and already have a valid local lark-cli config.
Version
lark-cli version 1.0.51
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with HERMES_HOME set, then trace the lark-cli Hermes context detection and the config bind --source hermes entry points. Compare the path used for detection with the path used when reading Hermes config. Done means unrelated commands retain local-config behavior or explicit Hermes binding uses HERMES_HOME, with the chosen behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100