Skip to content

fix+feat: bug fixes, auto session titles, .hermes.md project config#1712

Merged
teknium1 merged 5 commits intomainfrom
hermes/hermes-86b9e927
Mar 17, 2026
Merged

fix+feat: bug fixes, auto session titles, .hermes.md project config#1712
teknium1 merged 5 commits intomainfrom
hermes/hermes-86b9e927

Conversation

@teknium1
Copy link
Contributor

@teknium1 teknium1 commented Mar 17, 2026

Summary

Batch of bug fixes, feature implementations, and issue triage.

Bug Fixes

1. Missing subprocess import in setup.py (Fixes #1698)
_install_neutts_deps() used subprocess.run() without importing the module. 1-line fix.

2. Docker container_persistent=false not respected (Fixes #1679)
When container_persistent=false, cleanup() now runs docker rm -f to fully remove the container.
Salvaged from PR #1691 by @crazywriter1 — original authorship preserved.

3. Pre-existing test fixes

  • test_model_metadata: gpt-4.1 models have 1M context
  • test_setup / test_setup_model_provider: account for TTS provider step
  • MockInnerDocker.cleanup() stub added

Features

4. Auto-generated session titles (Implements #1426)
After the first user→assistant exchange, Hermes generates a short descriptive session title via auxiliary LLM. Runs in a background thread — never delays the response. Works in both CLI and gateway. /title (no args) now also shows session ID.

5. .hermes.md per-repository project config (Closes #681)
Discovers .hermes.md / HERMES.md by walking from cwd to git root. Strips YAML frontmatter and injects markdown body as project context.
Salvaged from PR #1200 by @ch3ronsa — original authorship preserved.

Issues Closed (already resolved on main)

Test plan

  • pytest tests/tools/test_docker_environment.py — 10 passed
  • pytest tests/agent/test_title_generator.py — 15 passed
  • pytest tests/agent/test_prompt_builder.py — 87 passed
  • Full suite: 4957+ passed

teknium1 and others added 4 commits March 17, 2026 03:53
The function uses subprocess.run() and subprocess.CalledProcessError but
never imported the module. This caused a NameError crash during setup
when users selected NeuTTS as their TTS provider.

Fixes #1698
When container_persistent=false, the inner mini-swe-agent cleanup only
runs 'docker stop' in the background, leaving containers in Exited state.
Now cleanup() also runs 'docker rm -f' to fully remove the container.

Also fixes pre-existing test failures in model_metadata (gpt-4.1 1M context),
setup tests (TTS provider step), and adds MockInnerDocker.cleanup().

Original fix by crazywriter1. Cherry-picked and adapted for current main.

Fixes #1679
After the first user→assistant exchange, Hermes now generates a short
descriptive session title via the auxiliary LLM (compression task config).
Title generation runs in a background thread so it never delays the
user-facing response.

Key behaviors:
- Fires only on the first 1-2 exchanges (checks user message count)
- Skips if a title already exists (user-set titles are never overwritten)
- Uses call_llm with compression task config (cheapest/fastest model)
- Truncates long messages to keep the title generation request small
- Cleans up LLM output: strips quotes, 'Title:' prefixes, enforces 80 char max
- Works in both CLI and gateway (Telegram/Discord/etc.)

Also updates /title (no args) to show the session ID alongside the title
in both CLI and gateway.

Implements #1426
Adds .hermes.md / HERMES.md discovery for per-project agent configuration.
When the agent starts, it walks from cwd to the git root looking for
.hermes.md (preferred) or HERMES.md, strips any YAML frontmatter, and
injects the markdown body into the system prompt as project context.

- Nearest-first discovery (subdirectory configs shadow parent)
- Stops at git root boundary (no leaking into parent repos)
- YAML frontmatter stripped (structured config deferred to Phase 2)
- Same injection scanning and 20K truncation as other context files
- 22 comprehensive tests

Original implementation by ch3ronsa. Cherry-picked and adapted for current main.

Closes #681 (Phase 1)
@teknium1 teknium1 changed the title fix: subprocess import + docker container cleanup (Fixes #1698, #1679) fix+feat: bug fixes, auto session titles, .hermes.md project config Mar 17, 2026
@teknium1 teknium1 merged commit 867a96c into main Mar 17, 2026
@teknium1 teknium1 deleted the hermes/hermes-86b9e927 branch March 17, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants