hermes - ✅(Solved) Fix No startup reconciliation: sandboxes orphaned by a gateway restart are never reaped [1 pull requests, 1 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#28807Fetched 2026-05-20 04:01:47
View on GitHub
Comments
0
Participants
1
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
labeled ×6cross-referenced ×1referenced ×1

Fix Action

Fixed

PR fix notes

PR #15: feat(terminal): add reconcile_orphaned_sandboxes() for startup sweep (#28807)

Description (problem / solution / changelog)

🔴 Merge order: 12 / 12 — new feature, 67 lines, external process calls

Closes #28807 (P2)

Problem

After a gateway restart, the in-process _active_environments dict is empty so running Docker containers / Daytona sandboxes are invisible to the idle reaper.

Fix

Add reconcile_orphaned_sandboxes() — a one-shot startup sweep:

  • Docker: docker ps --filter name=hermes- → stop + rm
  • Daytona: client.list() → delete stale hermes-* sandboxes

Risk assessment

FactorRating
Lines changed67 (all new)
New codeEntire function + Daytona SDK interaction
Side effects⚠️ Will stop/remove Docker containers named hermes-* on startup. If any containers are intentionally running from other tools, they will be killed.
Revert complexityEasy — delete the function

Concerns

  1. Daytona sb.delete() — untested against real Daytona SDK (the method name may differ)
  2. Docker subprocess calls — needs find_docker() to resolve the binary
  3. No integration test — this is runtime infrastructure

Recommendation

Review carefully. Consider testing on a staging setup before merging.

Files changed

  • tools/terminal_tool.py (+67)

Changed files

  • tools/terminal_tool.py (modified, +67/-0)
RAW_BUFFERClick to expand / collapse

Version: v0.14.0

Summary: In v0.14.0, the idle reaper _cleanup_inactive_envs() (tools/terminal_tool.py) only iterates the in-process _active_environments dict. Containers / Daytona sandboxes left running by a previous gateway process (after a restart or crash) are not tracked and never reaped — there is no startup sweep of docker ps / Daytona list() for stale hermes-* sandboxes.

Impact: Every gateway restart can permanently orphan running sandboxes, leaking host disk (docker) or Daytona credits/quota.

Ask: On gateway startup, reconcile and reap stale hermes-* sandboxes from the active backend(s).

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 No startup reconciliation: sandboxes orphaned by a gateway restart are never reaped [1 pull requests, 1 participants]