hermes - ✅(Solved) Fix Guardrail: warn before /new chat when subagents or background tasks are still running [1 pull requests, 1 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#28547Fetched 2026-05-20 04:03:26
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×6commented ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #28596: fix(cli): warn before resetting with active work (#28547)

Description (problem / solution / changelog)

What does this PR do?

Summary

This adds an active-work guardrail to destructive session commands in the CLI.

When /new or /reset is about to discard the current conversation while delegated subagents or background tasks are still running, Hermes now keeps the confirmation prompt on screen even if the user previously disabled the global destructive-slash confirmation gate.

Problem

Right now it is easy to start a fresh session while work from the current one is still in flight.

That creates an awkward failure mode:

  • delegated subagents keep running
  • background terminal jobs keep running
  • the user loses the immediate connection between the old conversation and the work that is still producing results

The existing confirmation gate helps in the general case, but once a user opts out of that prompt entirely, there is no last checkpoint when active work is still attached to the current session.

What this changes

  • counts active delegated children before destructive slash commands proceed
  • counts active background tasks tracked by the CLI
  • augments the confirmation detail with a short active-work summary
  • forces the prompt to stay enabled whenever active work is present, even if the global destructive-slash confirmation setting is off

This keeps the existing UX for normal idle-session resets, while adding a sharper warning exactly in the cases that can detach ongoing work from the conversation the user was watching.

Why this shape

I kept this as a narrow CLI-side follow-up instead of adding a larger workflow branch.

That lets Hermes reuse the existing destructive-slash confirmation flow, preserves the current opt-out behavior for ordinary resets, and only introduces the extra friction when there is active work that could be abandoned accidentally.

Tests

  • python -m pytest tests/cli/test_destructive_slash_confirm.py -q -n 4
  • python -m pytest tests/cli/test_cli_new_session.py -q -n 4

Fixes #28547.

Solution Sketch

  • fix the root cause in the touched subsystem instead of layering a broad workaround around the symptom
  • keep surrounding behavior stable and avoid unrelated refactors while the area is under review
  • prove the change with focused checks on the exact path that regressed

Related Issue

Fixes #28547.

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

  • preserved the existing technical rationale and validation notes inside the template body
  • scoped this PR description to the implementation already present on the branch
  • aligned the delivery format with .github/PULL_REQUEST_TEMPLATE.md

How to Test

  1. Review the existing validation notes preserved in this PR body.
  2. Run the focused checks for the touched area.
  3. Confirm the scoped change still behaves as described above.

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: <!-- e.g. Ubuntu 24.04, macOS 15.2, Windows 11 -->

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

  • N/A.

Changed files

  • cli.py (modified, +38/-1)
  • tests/cli/test_destructive_slash_confirm.py (modified, +101/-40)
RAW_BUFFERClick to expand / collapse

Problem

Users can start a fresh chat/session while delegated subagents or background tasks are still active, which can cause accidental context detachment and confusion about where results will land.

Requested behavior

Before creating a new chat/session (CLI /new//reset, or equivalent UI action), check for active work and require confirmation if any are running.

Confirmation prompt (proposed)

"Subagents/background tasks are still running. Starting a new chat may detach this context. Continue?"

Options:

  1. Cancel
  2. Wait for completion
  3. Continue anyway

Scope candidates

  • Active delegate_task subagents
  • Background terminal(..., background=true) processes
  • (Optional) pending queued tasks if relevant to current runtime

Why

This prevents accidental abandonment of active autonomous work and makes session transitions safer for multi-agent workflows.

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