hermes - ✅(Solved) Fix [Bug]: Linux: hermes crashes at startup — Invalid key c-S-c [2 pull requests, 2 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#19896Fetched 2026-05-05 06:04:29
View on GitHub
Comments
2
Participants
2
Timeline
13
Reactions
4
Timeline (top)
labeled ×4referenced ×3commented ×2cross-referenced ×2

Error Message

Error: Invalid key: c-S-c

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fix / Workaround

--- full gateway.log --- 2026-05-01 13:49:57,986 INFO gateway.run: Starting Hermes Gateway... 2026-05-01 13:49:57,987 INFO gateway.run: Session storage: /home/jt/.hermes/sessions 2026-05-01 13:49:57,994 WARNING gateway.run: No user allowlists configured. All unauthorized users will be denied. Set GATEWAY_ALLOW_ALL_USERS=true in ~/.hermes/.env to allow open access, or configure platform allowlists (e.g., TELEGRAM_ALLOWED_USERS=your_id). 2026-05-01 13:49:57,998 WARNING gateway.run: No messaging platforms enabled. 2026-05-01 13:49:57,999 INFO gateway.run: Gateway will continue running for cron job execution. 2026-05-01 13:49:58,052 INFO gateway.run: Channel directory built: 0 target(s) 2026-05-01 13:49:58,054 INFO gateway.run: Press Ctrl+C to stop 2026-05-01 13:49:58,273 INFO gateway.run: Cron ticker started (interval=60s) 2026-05-01 13:50:03,061 INFO gateway.run: kanban dispatcher: embedded in gateway (interval=60.0s) 2026-05-01 14:28:30,464 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown 2026-05-01 14:28:30,535 INFO gateway.run: Shutdown diagnostic — no other hermes processes found 2026-05-01 14:28:30,536 INFO gateway.run: Stopping gateway... 2026-05-01 14:28:31,442 INFO gateway.run: Gateway stopped 2026-05-01 14:28:31,443 INFO gateway.run: Cron ticker stopped 2026-05-01 14:28:31,443 INFO gateway.run: Exiting with code 1 (signal-initiated shutdown without restart request) so systemd Restart=on-failure can revive the gateway. 2026-05-01 15:33:39,649 INFO gateway.run: Starting Hermes Gateway... 2026-05-01 15:33:39,650 INFO gateway.run: Session storage: /home/jt/.hermes/sessions 2026-05-01 15:33:39,653 WARNING gateway.run: No user allowlists configured. All unauthorized users will be denied. Set GATEWAY_ALLOW_ALL_USERS=true in ~/.hermes/.env to allow open access, or configure platform allowlists (e.g., TELEGRAM_ALLOWED_USERS=your_id). 2026-05-01 15:33:39,656 INFO gateway.run: Previous gateway exited cleanly — skipping session suspension 2026-05-01 15:33:39,656 WARNING gateway.run: No messaging platforms enabled. 2026-05-01 15:33:39,657 INFO gateway.run: Gateway will continue running for cron job execution. 2026-05-01 15:33:39,722 INFO gateway.run: Channel directory built: 0 target(s) 2026-05-01 15:33:39,724 INFO gateway.run: Press Ctrl+C to stop 2026-05-01 15:33:39,767 INFO gateway.run: Cron ticker started (interval=60s) 2026-05-01 15:33:44,732 INFO gateway.run: kanban dispatcher: embedded in gateway (interval=60.0s) 2026-05-01 16:13:52,079 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown 2026-05-01 16:13:52,692 WARNING gateway.run: Shutdown diagnostic — other hermes processes running: jt 35997 5.3 3.7 864460 294708 pts/2 Sl+ 15:56 0:54 /home/jt/.hermes/hermes-agent/venv/bin/python3 /home/jt/.local/bin/hermes 2026-05-01 16:13:52,772 INFO gateway.run: Stopping gateway... 2026-05-01 16:13:57,105 INFO gateway.run: Gateway stopped 2026-05-01 16:13:57,183 INFO gateway.run: Cron ticker stopped 2026-05-01 16:13:57,189 INFO gateway.run: Exiting with code 1 (signal-initiated shutdown without restart request) so systemd Restart=on-failure can revive the gateway. 2026-05-01 16:13:57,200 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown 2026-05-01 16:13:57,235 WARNING gateway.run: Shutdown diagnostic — other hermes processes running: jt 35997 5.2 3.7 864460 294708 pts/2 Sl+ 15:56 0:54 /home/jt/.hermes/hermes-agent/venv/bin/python3 /home/jt/.local/bin/hermes

PR fix notes

PR #19895: fix(cli): guard c-S-c key binding with try/except to prevent startup crash

Description (problem / solution / changelog)

What does this PR do?

PR #19884 added @kb.add('c-S-c') unconditionally. prompt_toolkit raises ValueError("Invalid key: c-S-c") during HermesCLI.__init__ on platforms where this key spec is not recognised — the process exits before reaching the prompt loop.

Reported on macOS (#19894) and Linux (#19896) immediately after #19884 landed.

Root cause: prompt_toolkit.key_binding.KeyBindings.add() calls _parse_key('c-S-c') which raises ValueError: Invalid key: c-S-c on the current platform/version. The exception propagates through HermesCLI.__init__ and aborts startup.

Fix: Wrap the @kb.add('c-S-c') registration in try/except ValueError. Where the spec is accepted the binding is registered normally as a no-op; where it fails, startup continues cleanly and Ctrl+Shift+C falls through to the terminal's native handler.

Verified locally:

from prompt_toolkit.key_binding import KeyBindings
kb = KeyBindings()
try:
    @kb.add('c-S-c')
    def f(e): pass
except ValueError as ex:
    print(ex)  # "Invalid key: c-S-c"

Related Issue

Fixes #19894 (macOS crash) Fixes #19896 (Linux crash)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests
  • ♻️ Refactor
  • 🎯 New skill

Changes Made

  • cli.py: wrap @kb.add('c-S-c') in try/except ValueError (+13/-14)

How to Test

On affected macOS or Linux: run hermes. Before this fix: Error: Invalid key: c-S-c and immediate exit. After: clean startup.

Checklist

Code

  • Contributing Guide read
  • Conventional Commits
  • No duplicate PR
  • This fix only
  • pytest run (no tests added — interactive TUI binding, not unit-testable)
  • Platform: macOS + Linux (regression from #19884, same day)

Documentation & Housekeeping

  • Docs — N/A
  • cli-config.yaml.example — N/A
  • CONTRIBUTING.md/AGENTS.md — N/A
  • Cross-platform impact — fixes both macOS (#19894) and Linux (#19896)
  • Tool descriptions — N/A

Changed files

  • cli.py (modified, +13/-14)

PR #19907: fix(cli): remove invalid ctrl-shift-c keybinding

Description (problem / solution / changelog)

What does this PR do?

Removes the @kb.add('c-S-c') prompt_toolkit binding that crashes Hermes startup with Error: Invalid key: c-S-c.

The handler was a no-op intended to let terminals handle Ctrl+Shift+C. Because prompt_toolkit rejects that key spec on affected installs, registering it aborts CLI startup before the prompt opens. Removing it preserves terminal-native copy behavior and avoids registering an invalid key.

This is an alternative to #19895. That PR keeps the binding behind try/except; this PR removes the no-op binding entirely and adds a regression test that validates literal CLI keybindings against prompt_toolkit.

Related Issue

Fixes #19894 Fixes #19896 Fixes #19903

Related: #19895 Regression introduced by #19884

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • cli.py: removed the invalid no-op c-S-c binding.
  • tests/cli/test_cli_keybindings.py: added a regression test that parses literal @kb.add(...) decorators in cli.py and verifies prompt_toolkit can register them.

How to Test

  1. On an affected checkout, run hermes; before this fix it exits during startup with Error: Invalid key: c-S-c.
  2. Run .venv/bin/python -m py_compile cli.py.
  3. Run scripts/run_tests.sh tests/cli/test_cli_keybindings.py -q.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux / WSL

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Validation run locally:

.venv/bin/python -m py_compile cli.py
scripts/run_tests.sh tests/cli/test_cli_keybindings.py -q

1 passed in 2.96s

Changed files

  • cli.py (modified, +0/-15)
  • tests/cli/test_cli_keybindings.py (added, +51/-0)

Code Example

============================================================
FULL gateway.log
============================================================

[hermes debug share: log content redacted at upload time. run with --no-redact to disable]
--- hermes dump ---
version:          0.12.0 (2026.4.30) [8fabef9d]
os:               Linux 6.17.0-22-generic x86_64
python:           3.11.15
openai_sdk:       2.32.0
profile:          default
hermes_home:      ~/.hermes
model:            inclusionai/ling-2.6-1t:free
provider:         openrouter
terminal:         local

api_keys:
  openrouter           set
  openai               not set
  anthropic            not set
  anthropic_token      not set
  nous                 not set
  google/gemini        not set
  gemini               not set
  glm/zai              not set
  zai                  not set
  kimi                 not set
  minimax              not set
  deepseek             not set
  dashscope            not set
  huggingface          not set
  nvidia               not set
  ai_gateway           not set
  opencode_zen         not set
  opencode_go          not set
  kilocode             not set
  firecrawl            not set
  tavily               not set
  browserbase          not set
  fal                  not set
  elevenlabs           not set
  github               not set

features:
  toolsets:           hermes-cli
  mcp_servers:        0
  memory_provider:    built-in
  gateway:            stopped (systemd (user))
  platforms:          none
  cron_jobs:          0
  skills:             134

config_overrides:
  display.streaming: True
--- end dump ---


--- full gateway.log ---
2026-05-01 13:49:57,986 INFO gateway.run: Starting Hermes Gateway...
2026-05-01 13:49:57,987 INFO gateway.run: Session storage: /home/jt/.hermes/sessions
2026-05-01 13:49:57,994 WARNING gateway.run: No user allowlists configured. All unauthorized users will be denied. Set GATEWAY_ALLOW_ALL_USERS=true in ~/.hermes/.env to allow open access, or configure platform allowlists (e.g., TELEGRAM_ALLOWED_USERS=your_id).
2026-05-01 13:49:57,998 WARNING gateway.run: No messaging platforms enabled.
2026-05-01 13:49:57,999 INFO gateway.run: Gateway will continue running for cron job execution.
2026-05-01 13:49:58,052 INFO gateway.run: Channel directory built: 0 target(s)
2026-05-01 13:49:58,054 INFO gateway.run: Press Ctrl+C to stop
2026-05-01 13:49:58,273 INFO gateway.run: Cron ticker started (interval=60s)
2026-05-01 13:50:03,061 INFO gateway.run: kanban dispatcher: embedded in gateway (interval=60.0s)
2026-05-01 14:28:30,464 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown
2026-05-01 14:28:30,535 INFO gateway.run: Shutdown diagnostic — no other hermes processes found
2026-05-01 14:28:30,536 INFO gateway.run: Stopping gateway...
2026-05-01 14:28:31,442 INFO gateway.run: Gateway stopped
2026-05-01 14:28:31,443 INFO gateway.run: Cron ticker stopped
2026-05-01 14:28:31,443 INFO gateway.run: Exiting with code 1 (signal-initiated shutdown without restart request) so systemd Restart=on-failure can revive the gateway.
2026-05-01 15:33:39,649 INFO gateway.run: Starting Hermes Gateway...
2026-05-01 15:33:39,650 INFO gateway.run: Session storage: /home/jt/.hermes/sessions
2026-05-01 15:33:39,653 WARNING gateway.run: No user allowlists configured. All unauthorized users will be denied. Set GATEWAY_ALLOW_ALL_USERS=true in ~/.hermes/.env to allow open access, or configure platform allowlists (e.g., TELEGRAM_ALLOWED_USERS=your_id).
2026-05-01 15:33:39,656 INFO gateway.run: Previous gateway exited cleanly — skipping session suspension
2026-05-01 15:33:39,656 WARNING gateway.run: No messaging platforms enabled.
2026-05-01 15:33:39,657 INFO gateway.run: Gateway will continue running for cron job execution.
2026-05-01 15:33:39,722 INFO gateway.run: Channel directory built: 0 target(s)
2026-05-01 15:33:39,724 INFO gateway.run: Press Ctrl+C to stop
2026-05-01 15:33:39,767 INFO gateway.run: Cron ticker started (interval=60s)
2026-05-01 15:33:44,732 INFO gateway.run: kanban dispatcher: embedded in gateway (interval=60.0s)
2026-05-01 16:13:52,079 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown
2026-05-01 16:13:52,692 WARNING gateway.run: Shutdown diagnostic — other hermes processes running:
  jt         35997  5.3  3.7 864460 294708 pts/2   Sl+  15:56   0:54 /home/jt/.hermes/hermes-agent/venv/bin/python3 /home/jt/.local/bin/hermes
2026-05-01 16:13:52,772 INFO gateway.run: Stopping gateway...
2026-05-01 16:13:57,105 INFO gateway.run: Gateway stopped
2026-05-01 16:13:57,183 INFO gateway.run: Cron ticker stopped
2026-05-01 16:13:57,189 INFO gateway.run: Exiting with code 1 (signal-initiated shutdown without restart request) so systemd Restart=on-failure can revive the gateway.
2026-05-01 16:13:57,200 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown
2026-05-01 16:13:57,235 WARNING gateway.run: Shutdown diagnostic — other hermes processes running:
  jt         35997  5.2  3.7 864460 294708 pts/2   Sl+  15:56   0:54 /home/jt/.hermes/hermes-agent/venv/bin/python3 /home/jt/.local/bin/hermes

---
RAW_BUFFERClick to expand / collapse

Bug Description

Summary

On Linux, Hermes Agent v0.12.0 crashes immediately after the welcome banner with:

Error: Invalid key: c-S-c

The TUI never reaches the prompt. Reproduces with both bare hermes and hermes -s

Reproduce: Everytime I startup hermes. Just started with today when I updated

Steps to Reproduce

Run hermes Crash

Expected Behavior

It should boot normally

Actual Behavior

Crashes instead

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

============================================================
FULL gateway.log
============================================================

[hermes debug share: log content redacted at upload time. run with --no-redact to disable]
--- hermes dump ---
version:          0.12.0 (2026.4.30) [8fabef9d]
os:               Linux 6.17.0-22-generic x86_64
python:           3.11.15
openai_sdk:       2.32.0
profile:          default
hermes_home:      ~/.hermes
model:            inclusionai/ling-2.6-1t:free
provider:         openrouter
terminal:         local

api_keys:
  openrouter           set
  openai               not set
  anthropic            not set
  anthropic_token      not set
  nous                 not set
  google/gemini        not set
  gemini               not set
  glm/zai              not set
  zai                  not set
  kimi                 not set
  minimax              not set
  deepseek             not set
  dashscope            not set
  huggingface          not set
  nvidia               not set
  ai_gateway           not set
  opencode_zen         not set
  opencode_go          not set
  kilocode             not set
  firecrawl            not set
  tavily               not set
  browserbase          not set
  fal                  not set
  elevenlabs           not set
  github               not set

features:
  toolsets:           hermes-cli
  mcp_servers:        0
  memory_provider:    built-in
  gateway:            stopped (systemd (user))
  platforms:          none
  cron_jobs:          0
  skills:             134

config_overrides:
  display.streaming: True
--- end dump ---


--- full gateway.log ---
2026-05-01 13:49:57,986 INFO gateway.run: Starting Hermes Gateway...
2026-05-01 13:49:57,987 INFO gateway.run: Session storage: /home/jt/.hermes/sessions
2026-05-01 13:49:57,994 WARNING gateway.run: No user allowlists configured. All unauthorized users will be denied. Set GATEWAY_ALLOW_ALL_USERS=true in ~/.hermes/.env to allow open access, or configure platform allowlists (e.g., TELEGRAM_ALLOWED_USERS=your_id).
2026-05-01 13:49:57,998 WARNING gateway.run: No messaging platforms enabled.
2026-05-01 13:49:57,999 INFO gateway.run: Gateway will continue running for cron job execution.
2026-05-01 13:49:58,052 INFO gateway.run: Channel directory built: 0 target(s)
2026-05-01 13:49:58,054 INFO gateway.run: Press Ctrl+C to stop
2026-05-01 13:49:58,273 INFO gateway.run: Cron ticker started (interval=60s)
2026-05-01 13:50:03,061 INFO gateway.run: kanban dispatcher: embedded in gateway (interval=60.0s)
2026-05-01 14:28:30,464 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown
2026-05-01 14:28:30,535 INFO gateway.run: Shutdown diagnostic — no other hermes processes found
2026-05-01 14:28:30,536 INFO gateway.run: Stopping gateway...
2026-05-01 14:28:31,442 INFO gateway.run: Gateway stopped
2026-05-01 14:28:31,443 INFO gateway.run: Cron ticker stopped
2026-05-01 14:28:31,443 INFO gateway.run: Exiting with code 1 (signal-initiated shutdown without restart request) so systemd Restart=on-failure can revive the gateway.
2026-05-01 15:33:39,649 INFO gateway.run: Starting Hermes Gateway...
2026-05-01 15:33:39,650 INFO gateway.run: Session storage: /home/jt/.hermes/sessions
2026-05-01 15:33:39,653 WARNING gateway.run: No user allowlists configured. All unauthorized users will be denied. Set GATEWAY_ALLOW_ALL_USERS=true in ~/.hermes/.env to allow open access, or configure platform allowlists (e.g., TELEGRAM_ALLOWED_USERS=your_id).
2026-05-01 15:33:39,656 INFO gateway.run: Previous gateway exited cleanly — skipping session suspension
2026-05-01 15:33:39,656 WARNING gateway.run: No messaging platforms enabled.
2026-05-01 15:33:39,657 INFO gateway.run: Gateway will continue running for cron job execution.
2026-05-01 15:33:39,722 INFO gateway.run: Channel directory built: 0 target(s)
2026-05-01 15:33:39,724 INFO gateway.run: Press Ctrl+C to stop
2026-05-01 15:33:39,767 INFO gateway.run: Cron ticker started (interval=60s)
2026-05-01 15:33:44,732 INFO gateway.run: kanban dispatcher: embedded in gateway (interval=60.0s)
2026-05-01 16:13:52,079 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown
2026-05-01 16:13:52,692 WARNING gateway.run: Shutdown diagnostic — other hermes processes running:
  jt         35997  5.3  3.7 864460 294708 pts/2   Sl+  15:56   0:54 /home/jt/.hermes/hermes-agent/venv/bin/python3 /home/jt/.local/bin/hermes
2026-05-01 16:13:52,772 INFO gateway.run: Stopping gateway...
2026-05-01 16:13:57,105 INFO gateway.run: Gateway stopped
2026-05-01 16:13:57,183 INFO gateway.run: Cron ticker stopped
2026-05-01 16:13:57,189 INFO gateway.run: Exiting with code 1 (signal-initiated shutdown without restart request) so systemd Restart=on-failure can revive the gateway.
2026-05-01 16:13:57,200 INFO gateway.run: Received SIGTERM/SIGINT — initiating shutdown
2026-05-01 16:13:57,235 WARNING gateway.run: Shutdown diagnostic — other hermes processes running:
  jt         35997  5.2  3.7 864460 294708 pts/2   Sl+  15:56   0:54 /home/jt/.hermes/hermes-agent/venv/bin/python3 /home/jt/.local/bin/hermes

Operating System

Linux Mint 22.3

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue is likely caused by an invalid key binding, and removing or updating the problematic key binding may resolve the crash.

Guidance

  • Check the Hermes configuration files for any custom key bindings that may be causing the issue, specifically the "c-S-c" binding.
  • Try running Hermes with the --no-config flag to disable any custom configurations and see if the issue persists.
  • If the issue is resolved, gradually re-enable configurations to identify the problematic key binding.
  • Consider updating Hermes to a newer version if available, as the issue may have been fixed in a later release.

Example

No code snippet is provided as the issue is likely related to a configuration or key binding rather than a code error.

Notes

The provided debug report and logs do not indicate a clear cause for the crash, but the error message "Invalid key: c-S-c" suggests a key binding issue. Further investigation into the Hermes configuration and key bindings is necessary to resolve the issue.

Recommendation

Apply a workaround by checking and updating the key bindings, as the root cause is likely related to an invalid key binding.

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 - ✅(Solved) Fix [Bug]: Linux: hermes crashes at startup — Invalid key c-S-c [2 pull requests, 2 comments, 2 participants]