Skip to content

fix(cli): show correct config file path in /config command - #89

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/cli-show-config-wrong-path
Feb 27, 2026
Merged

fix(cli): show correct config file path in /config command#89
teknium1 merged 1 commit into
NousResearch:mainfrom
0xbyt4:fix/cli-show-config-wrong-path

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • /config command always checked cli-config.yaml in the project directory (cli.py:1142)
  • But load_cli_config() first looks at ~/.hermes/config.yaml (cli.py:140)
  • When user config existed at ~/.hermes/config.yaml, /config would display cli-config.yaml (not found) even though configuration was loaded successfully
  • Fix: use the same lookup order as load_cli_config() and display the actual resolved path

Reproduction

  1. Create ~/.hermes/config.yaml with any config
  2. Run the CLI and type /config
  3. Before fix: Config File: cli-config.yaml (not found)
  4. After fix: Config File: /home/user/.hermes/config.yaml (loaded)

show_config() always checked cli-config.yaml in the project directory,
but load_cli_config() first looks at ~/.hermes/config.yaml. When the
user config existed, /config would display "cli-config.yaml (not found)"
even though configuration was loaded successfully from ~/.hermes/.

Use the same lookup order as load_cli_config and display the actual
resolved path.
@teknium1

Copy link
Copy Markdown
Contributor

You're becoming my favorite contributor ^_^

@teknium1
teknium1 merged commit 1362f92 into NousResearch:main Feb 27, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ong-path

fix(cli): show correct config file path in /config command
dizhaky referenced this pull request in dizhaky/hermes-agent Jun 23, 2026
…AN-1385) (#26)

baileys 7.0.0-rc.9->rc13 (clears #43 critical) + protobufjs 7.6.4 (#59,#58) in whatsapp-bridge; esbuild+tsx (#46,#61) in ui-tui; @babel/core (#84) in web; joi+http-proxy-middleware (#51,#89) in website. js-yaml #86 accepted (no in-range fix via gray-matter). Bridge startup verified. #93/#94 (code fixes) separate.

Co-Authored-By: Claude <noreply@anthropic.com>
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
…ousResearch#89)

An incomplete plugin-migration refactor removed the telegram, slack,
matrix, whatsapp, email, and sms entries from `_PLATFORMS` in
hermes_cli/gateway.py, with comments claiming they had "moved to
plugins/platforms/<name>/". Those plugin directories were never created,
and the adapters for all six still live as built-in modules under
gateway/platforms/. The result: these platforms silently vanished from
`hermes setup gateway` and `_all_platforms()`, and
tests/hermes_cli/test_gateway_platform_gating.py went red on main
(matrix/telegram missing from the picker).

Restore the six entries alongside the other still-built-in adapters
(mattermost, signal, weixin, bluebubbles, qqbot, yuanbao), recovered from
the pre-refactor history, and drop the now-stale "moved to plugins"
comments. Windows host-gating for matrix (no python-olm wheel) is
preserved by the existing filter in `_all_platforms()`.

Fixes the 3 failing TestMatrixHiddenOnWindows cases; no other test
behavior changes (verified: identical pass/fail set on the surrounding
gateway/setup suites with and without this change).


Claude-Session: https://claude.ai/code/session_01Bym5HhKPQ3CWb5r9bCvBq4

Co-authored-by: Claude <noreply@anthropic.com>
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
…sResearch#97)

* fix(gateway): honor explicit platform disable in env auto-enable

Generalize the _enabled_explicit marker from Slack-only to every platform:
any 'enabled' key set in config.yaml is now recorded as an explicit user
choice, and _apply_env_overrides skips its auto-enable pass (env token
detection / plugin env-enablement) when the user deliberately set
enabled: false. Fixes the Discord adapter retry-looping at boot despite
discord.enabled: false (DAN-2140).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(gateway): regression tests for explicit platform disable

Covers the _enabled_explicit flow end-to-end: explicit enabled:false in
config.yaml survives env-token auto-enable and plugin env-enablement;
implicit disabled platforms still auto-enable. The Slack setup-menu
restore originally in this commit was superseded by the broader NousResearch#89
(all built-in platforms restored to the picker) already on main.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(gateway): explicit disable survives direct env token-detection passes

Codex review P1 on NousResearch#97: _apply_env_overrides has ~23 per-platform blocks
that set enabled = True unconditionally when a token env var is present,
running before the guarded plugin env-enablement pass — so an explicit
enabled: false was still overridden whenever a token existed. Snapshot
explicitly-disabled platforms at function entry and re-assert the flag
at exit; tokens/extras seeded by env remain (harmless while disabled).

Regression tests: DISCORD_BOT_TOKEN + explicit disable stays disabled
(verified failing before this fix); token without explicit choice still
auto-enables.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
…ousResearch#93)

* fix(gateway): restore remaining platforms dropped from setup picker

PR NousResearch#89 restored telegram/slack/matrix/whatsapp/email/sms after an
incomplete plugin-migration refactor (e39b468) dropped them from
_PLATFORMS with comments claiming they'd "moved to plugins/platforms/
<name>/" -- directories that were never created. Re-auditing _PLATFORMS
against its pre-refactor history found four more casualties of the same
refactor that PR NousResearch#89 didn't cover: dingtalk, feishu, wecom, and
wecom_callback.

- Restored _PLATFORMS entries for all four, recovered verbatim from
  history (e39b468~1), following PR NousResearch#89's precedent of using the
  generic vars-schema-driven _setup_standard_platform() flow.
- Feishu needed more: its bespoke _setup_feishu() interactive function
  (QR-code bot registration via gateway/platforms/feishu.qr_register())
  was deleted outright, not just its picker metadata. Restored it
  verbatim and wired it back into _builtin_setup_fn() -- this is what
  tests/gateway/test_setup_feishu.py (pre-existing, unrelated to either
  fix) actually exercises; the generic vars flow can't reproduce its
  QR-registration UX or save_env_value() call sequence.
- Cleaned up the now-stale "moved to plugins" comments for dingtalk/
  wecom/wecom_callback and the telegram/slack/matrix/mattermost block
  in _builtin_setup_fn() (mattermost was never plugin-registered
  either -- only discord genuinely is).
- tests/hermes_cli/test_setup.py: two tests needed gateway_mod's own
  prompt_yes_no mocked too -- Matrix is now pre-selected as "already
  configured" in the picker, so _configure_platform() reaches
  _setup_standard_platform()'s "Reconfigure Matrix?" prompt, which
  gateway.py answers via its own imported prompt_yes_no reference
  (separate from hermes_cli.setup's).

Updates .plans/missing-platform-plugin-shims.md to Closed.

* fix(gateway): resolve ty type-checker warnings in restored _setup_feishu

Two issues the ty diagnostic bot flagged on the recovered function:
- qr_register was bound only inside the try block, so the except
  branch's `qr_register = None` fallback widened the type after ty had
  already inferred it from the successful import. Pre-declare it as
  None before the try so the union type is established up front.
- credentials["app_id"]/["app_secret"]/.get("domain", ...) all read as
  `Unknown | str | None` from the plain (untyped) dict merge across the
  QR-registration and manual-entry code paths, even though app_id/
  app_secret are guaranteed non-empty strings by construction (both
  paths early-return before reaching this point if either is falsy).
  Explicit str() coercion satisfies the checker without changing
  behavior.

* docs: record CodeQL false-positive decision on restored Feishu secret storage

The clear-text-storage alert on save_env_value("FEISHU_APP_SECRET", ...) in
the restored _setup_feishu() matches the identical, unflagged pattern used
for every other credential in gateway.py -- dismissed on GitHub's Security
tab rather than changed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PTSqxb1h9MRkvGvVJqSuQh

* fix(gateway): address Codex review findings on restored dingtalk/wecom setup

Fixes five issues Codex flagged on PR NousResearch#93's restored platform-picker entries:

- gateway/config.py: WECOM_CALLBACK_PORT crashed the entire gateway on
  startup (not just WeCom Callback) if set to a non-integer value, since
  int(os.getenv(...)) was unguarded. Now falls back to 8645 with a warning.
- hermes_cli/gateway.py _setup_standard_platform():
  - Password-type vars (WECOM_CALLBACK_CORP_SECRET, WECOM_CALLBACK_TOKEN,
    WECOM_CALLBACK_ENCODING_AES_KEY, DINGTALK_CLIENT_SECRET, WECOM_SECRET)
    were echoed in cleartext via "Current: {existing}" during reconfiguration.
  - DingTalk/WeCom/WeCom Callback's secret fields were treated as optional
    (only token_var was enforced), so the wizard could report a platform
    "configured!" while gateway/config.py's enablement check (which requires
    both the ID and secret) left it silently disabled. Added a "required"
    var flag, enforced alongside token_var.
  - The "Enable open access" choice wrote the global GATEWAY_ALLOW_ALL_USERS
    instead of the platform-specific {KEY}_ALLOW_ALL_USERS that
    gateway/run.py's authorization check already reads per-platform for
    every one of these platforms -- opening one bot to all users silently
    opened every other unconfigured-allowlist platform too.
  - Added a "numeric" var flag, used by WECOM_CALLBACK_PORT, so a
    non-numeric port is rejected at prompt time instead of persisted.
- DingTalk's _PLATFORMS entry was missing an allowed-users field entirely
  (unlike Feishu/WeCom/WeCom Callback), so group messages were silently
  dropped with no pairing code after setup reported success. Added
  DINGTALK_ALLOWED_USERS with is_allowlist, matching the other three.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PTSqxb1h9MRkvGvVJqSuQh

* fix(gateway): address second round of Codex findings on setup wizard

Four more issues from Codex's re-review of the earlier fixes:

- _setup_standard_platform(): the "Enable open access" choice wrote
  {PLATFORM}_ALLOW_ALL_USERS=true but the DM-pairing and skip branches never
  cleared it back to false. Reconfiguring a previously-open platform to a
  restricted policy left it silently open, since gateway/run.py checks that
  flag before pairing/allowlist logic. Now every branch writes an explicit
  true/false, matching the bespoke Feishu setup's existing convention.
- Required secret fields (DingTalk/WeCom/WeCom Callback) aborted the whole
  wizard on blank input even when a value was already stored -- contradicting
  the "leave blank to keep it" message shown one line above. Now only aborts
  when both the prompt and the existing stored value are empty.
- The WECOM_CALLBACK_PORT numeric check accepted any digit string (e.g.
  70000), which passes int() but fails to bind a real TCP listener,
  silently leaving the adapter disconnected. Now validates the 1-65535
  range, not just numeric syntax.
- _setup_feishu(): webhook mode could be enabled with neither
  FEISHU_ENCRYPT_KEY nor FEISHU_VERIFICATION_TOKEN set, which
  gateway/platforms/feishu.py's webhook handler treats as "skip both auth
  checks" -- letting anyone who can reach the public endpoint forge events
  as any user, including allowlisted ones. Now collects a verification
  credential during setup and falls back to WebSocket mode (no public
  listener) if neither is provided.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PTSqxb1h9MRkvGvVJqSuQh

---------

Co-authored-by: Claude <noreply@anthropic.com>
Meraniya pushed a commit to Meraniya/hermes-agent that referenced this pull request Aug 6, 2026
…2141) (NousResearch#108)

The Tests workflow's status badge on main is stuck red on run
29596109244 (commit b763acc, 2026-07-17). That commit predates the
restoration of _setup_feishu (PR NousResearch#93) and the other test-suite repairs
(NousResearch#89/NousResearch#94/NousResearch#97/NousResearch#104/NousResearch#107), so its slice 5 fails on tests/gateway/
test_setup_feishu.py — ImportError: cannot import name '_setup_feishu'.

The fixes are all on current main (verified locally: agent.json pins
0.15.0 matching pyproject; systemd unit renders WorkingDirectory; the
issue's named tests — test_registry_manifest, test_gateway_service
TestGatewayStopCleanup/TestSystemUnitPathRemapping, test_setup_feishu
— all pass). PR NousResearch#107's CI run (29763092727) was fully green across all
six slices on Linux, proving current main is green.

The badge never refreshed because the fix-bearing PRs were squash-
merged by GitHub's auto-merge bot; those pushes are performed with the
repository GITHUB_TOKEN, which GitHub will not use to spawn new
push-triggered workflow runs. The CI Auto-Healer can only List, view, and watch recent workflow runs from GitHub Actions.

USAGE
  gh run <command> [flags]

AVAILABLE COMMANDS
  cancel:        Cancel a workflow run
  delete:        Delete a workflow run
  download:      Download artifacts generated by a workflow run
  list:          List recent workflow runs
  rerun:         Rerun a run
  view:          View a summary of a workflow run
  watch:         Watch a run until it completes, showing its progress

FLAGS
  -R, --repo [HOST/]OWNER/REPO   Select another repository using the [HOST/]OWNER/REPO format

INHERITED FLAGS
  --help   Show help for command

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual
  Learn about exit codes using `gh help exit-codes`
  Learn about accessibility experiences using `gh help accessibility` the frozen red commit (now at run_attempt 3/3), so it cannot
repair a stale badge on a newer HEAD.

Add  so a fresh Tests run can be triggered on main's
current HEAD (Actions tab or ), refreshing
the badge once the code is already green. No test or source change
needed — the underlying failures are already fixed on main.

Fixes DAN-2141

Co-authored-by: Claude <noreply@anthropic.com>
sijav added a commit to sijav/sijav-agent that referenced this pull request Aug 7, 2026
…nd file the 47 pre-existing failures (NousResearch#89)

The ledger's headline number was four committed slices stale (62.1% for
conversation_loop, which now measures 99.33%). Replaced guesswork with a full
measured run.

Backend baseline: 64.09% statements (178,713/268,279), branches 56,530/98,800.
Full suite: 2834 files, 29,419 tests passed, 47 failed, 950s at 8 workers,
3.4GB peak. tests/agent (534 files / 7428 tests) and tests/run_agent (190 files
/ 1708 tests) are both 100% green; all 47 failures live in tests/plugins,
tests/tools and two root files, and are pre-existing — spot-checked two that are
a repo-hygiene lint tripping on the gitignored .hermes-sandbox artifact dir and
an unrelated regex test. Filed as NousResearch#89 rather than left as ambient red.

Also corrected the measurement recipe in the worklist: --coverage is NOT an
argparse option on run_tests_parallel.py (it is passed through to pytest, which
rejects it and reports every file as failed); the only switch is
SIJAV_TEST_COVERAGE=1, and coverage must be installed IN THE VENV because the
runner spawns subprocesses with the venv interpreter.

Recorded the lowest-coverage large modules as the NousResearch#35 roadmap.
sijav added a commit to sijav/sijav-agent that referenced this pull request Aug 7, 2026
…inventory

Two things, both from the same hunt.

1. conftest now converts 'optional package not installed' failures into skips.
   tools/lazy_deps raises FeatureUnavailable with one unique sentinel when
   installs are disabled by config (security.allow_lazy_installs=false), and
   callers re-raise it as ImportError. Those surfaced as hard FAILURES on a
   stock dev box, drowning real breakage. Matched on that single sentinel
   string, generated in exactly one place, so a genuine ImportError still fails
   loudly. Verified: 47 failing -> 23 correctly skipped.

2. My published classification was WRONG and is corrected in the board rather
   than quietly amended. I reported '45 of 47 are optional-dep' from a signature
   tally; re-running shows 23 convert, 24 remain. Several tests CATCH the
   ImportError and re-assert on its text, so they surface as AssertionError and
   never match the sentinel — still dependency-caused, but they need to skip
   rather than assert. The genuinely real failures are a handful: evict-at-
   deadline, prefetch-recall, a regex multiline test, and a hygiene lint that
   scans the gitignored .hermes-sandbox artifact dir.

Counting error signatures is a hypothesis about causes, not a classification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants