Skip to content

fix(gateway): /stop no longer resets the session#9224

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-ab99ae69
Apr 13, 2026
Merged

fix(gateway): /stop no longer resets the session#9224
teknium1 merged 1 commit into
mainfrom
hermes/hermes-ab99ae69

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

/stop was calling suspend_session() on every use, which marked the session for auto-reset on the next message. Users lost their entire conversation history every time they stopped a running agent.

Reported by: @uttertard — "why is the /stop command resetting the session now? I'm losing a lot of work because most sessions are untitled and can't be resumed by ID"

What changed

  • Removed suspend_session() calls from both /stop code paths (early intercept + normal handler)
  • /stop now just interrupts the agent and cleans the session lock — the session stays intact
  • Updated response messages: "Stopped. You can continue this session." instead of "Force-stopped. Your next message will start fresh."
  • Updated tests to match new messaging

Why this is safe

The suspend_session behavior was introduced in #7536 to break stuck session resume loops on gateway restart. That scenario is already handled by suspend_recently_active() which runs at gateway startup — it suspends sessions that were updated within the last 2 minutes (likely in-flight at shutdown). Removing suspend from /stop doesn't regress that fix.

Files changed

  • gateway/run.py — removed 3 suspend_session() calls, updated messages and docstring
  • tests/gateway/test_session_race_guard.py — updated assertions for new messaging

/stop was calling suspend_session() which marked the session for auto-reset
on the next message. This meant users lost their conversation history every
time they stopped a running agent — especially painful for untitled sessions
that can't be resumed by name.

Now /stop just interrupts the agent and cleans the session lock. The session
stays intact so users can continue the conversation.

The suspend behavior was introduced in #7536 to break stuck session resume
loops on gateway restart. That case is already handled by
suspend_recently_active() which runs at gateway startup, so removing it from
/stop doesn't regress the original fix.
@teknium1 teknium1 merged commit 952a885 into main Apr 13, 2026
3 of 4 checks passed
@teknium1 teknium1 deleted the hermes/hermes-ab99ae69 branch April 13, 2026 21:59
r266-tech added a commit to r266-tech/hermes-agent that referenced this pull request Apr 13, 2026
…ousResearch#9241)

PR NousResearch#9224 removed suspend_session() from /stop but existing tests only
check message text. Add test_stop_does_not_suspend_session covering
all three code paths (sentinel, running agent, no-op) to prevent
accidental revert.
ccross2 added a commit to ccross2/hermes-agent that referenced this pull request Apr 14, 2026
Brings ccross2/hermes-agent up to NousResearch/hermes-agent@ac80bd61
(v0.9.0 release "the everywhere release").

Merge highlights from upstream:
- Pluggable Context Engine slot (NousResearch#7464)
- Local web dashboard, Termux/Android, iMessage/WeChat platforms
- Fast Mode (/fast) for OpenAI/Anthropic priority queues
- Background process monitoring (watch_patterns, NousResearch#7635)
- Comprehensive security hardening (Twilio signature, SSRF, path
  traversal, git injection, shell injection in sandbox writes)
- Dead code cleanup (1,784 lines across 77 files, NousResearch#9180)
- CANONICAL_PROVIDERS consolidation (NousResearch#9237)
- gateway /stop no longer resets session (NousResearch#9224)

Conflict resolution summary (7 hunks across 3 files):

1-4. cli.py _build_compact_banner — took upstream.
   Upstream added skin-aware colors + version label + tiny_line for
   narrow terminals. ccross2 had added word-wrapping for narrow
   terminals (commit 5b32504). The skin engine integration is
   foundational (affects several other surfaces); the word-wrapping
   improvement can be re-added as a follow-up on top of skin-aware.

5. cli.py _reset_stream_state — kept BOTH.
   ccross2 added _stream_in_code_fence; upstream added
   _deferred_content. Different features in the same reset hook,
   both needed.

6. tools/transcription_tools.py get_stt_model_from_config — took ccross2.
   ccross2 added provider-aware model resolution (local/groq/openai
   with per-provider model overrides). Upstream restructured but
   didn't provide an equivalent; the function coexists with upstream's
   _load_stt_config() which returns the raw dict.

7. tests/tools/test_transcription_tools.py — took ccross2.
   Tests for the provider-aware function we kept in (6).

Post-merge state: 5 local ccross2 commits preserved on top of
upstream 0.9. Backup of pre-merge state at
ccross2/cc-fusion-09-rebase-backup (Claude Code's rebase attempt
with 4 of the 5 patches, before this proper merge).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
/stop was calling suspend_session() which marked the session for auto-reset
on the next message. This meant users lost their conversation history every
time they stopped a running agent — especially painful for untitled sessions
that can't be resumed by name.

Now /stop just interrupts the agent and cleans the session lock. The session
stays intact so users can continue the conversation.

The suspend behavior was introduced in NousResearch#7536 to break stuck session resume
loops on gateway restart. That case is already handled by
suspend_recently_active() which runs at gateway startup, so removing it from
/stop doesn't regress the original fix.
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
/stop was calling suspend_session() which marked the session for auto-reset
on the next message. This meant users lost their conversation history every
time they stopped a running agent — especially painful for untitled sessions
that can't be resumed by name.

Now /stop just interrupts the agent and cleans the session lock. The session
stays intact so users can continue the conversation.

The suspend behavior was introduced in NousResearch#7536 to break stuck session resume
loops on gateway restart. That case is already handled by
suspend_recently_active() which runs at gateway startup, so removing it from
/stop doesn't regress the original fix.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
/stop was calling suspend_session() which marked the session for auto-reset
on the next message. This meant users lost their conversation history every
time they stopped a running agent — especially painful for untitled sessions
that can't be resumed by name.

Now /stop just interrupts the agent and cleans the session lock. The session
stays intact so users can continue the conversation.

The suspend behavior was introduced in NousResearch#7536 to break stuck session resume
loops on gateway restart. That case is already handled by
suspend_recently_active() which runs at gateway startup, so removing it from
/stop doesn't regress the original fix.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
/stop was calling suspend_session() which marked the session for auto-reset
on the next message. This meant users lost their conversation history every
time they stopped a running agent — especially painful for untitled sessions
that can't be resumed by name.

Now /stop just interrupts the agent and cleans the session lock. The session
stays intact so users can continue the conversation.

The suspend behavior was introduced in NousResearch#7536 to break stuck session resume
loops on gateway restart. That case is already handled by
suspend_recently_active() which runs at gateway startup, so removing it from
/stop doesn't regress the original fix.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
/stop was calling suspend_session() which marked the session for auto-reset
on the next message. This meant users lost their conversation history every
time they stopped a running agent — especially painful for untitled sessions
that can't be resumed by name.

Now /stop just interrupts the agent and cleans the session lock. The session
stays intact so users can continue the conversation.

The suspend behavior was introduced in NousResearch#7536 to break stuck session resume
loops on gateway restart. That case is already handled by
suspend_recently_active() which runs at gateway startup, so removing it from
/stop doesn't regress the original fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant