Files
agent-estate-wiki/concepts/persistent-shells.md
T

41 lines
1.8 KiB
Markdown

---
title: Persistent Shells
type: concept
status: active
created: 2026-07-22
updated: 2026-10-20
verified_on: 2026-10-20
confidence: high
tags: [concept, terminal]
sources: [raw/configs/hermes-config-sanitized.txt]
---
# Persistent Shells
## Idea
A background shell session that survives across separate Hermes turns/requests, instead of spawning and tearing down a fresh shell each time — so state (working directory, exported variables, long-running processes) carries over.
## How this install implements it
- **Verified (`~/.hermes/config.yaml`):** `terminal.persistent_shell: true`
- **Backend:** local (not containerized separately from the agent process)
- **Working directory:** `/home/hermes/workspace`
- **Timeout:** 180s
- **Home mode:** auto
- **Container CPU:** 1
> **Full `terminal:` block re-read 2026-10-20 — the above still holds, plus more.**
> Live values: `backend: local`, `persistent_shell: true`, `timeout: 180`, `home_mode: auto`,
> `container_cpu: 1`, `container_memory: 5120`, `container_disk: 51200`,
> `container_persistent: true`, `lifetime_seconds: 300`,
> `docker_mount_cwd_to_workspace: false`, `docker_run_as_host_user: true`.
> The container-* keys are inert while `backend: local` — the shell is not containerised on this
> box, so `container_memory`/`container_disk` describe a path that isn't taken.
## Why it matters here
Enables multi-step CLI workflows (e.g. a long `git` operation, a build, a watch process) to be resumed across turns without Hermes re-establishing context each time. The tradeoff is a shell can be left in a bad state (stuck process, wrong directory) that silently affects the *next* turn — see [[runbooks/troubleshoot-tool-loop]] for the related tool-loop guardrails that catch some of this.
## Related
- [[systems/terminal-backend]]
- [[systems/hermes-agent]]
- [[concepts/tool-calling]]