fix(gateway): /stop no longer resets the session#9224
Merged
Conversation
/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.
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.
2 tasks
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>
4 tasks
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/stopwas callingsuspend_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
suspend_session()calls from both/stopcode paths (early intercept + normal handler)/stopnow just interrupts the agent and cleans the session lock — the session stays intactWhy this is safe
The
suspend_sessionbehavior was introduced in #7536 to break stuck session resume loops on gateway restart. That scenario is already handled bysuspend_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/stopdoesn't regress that fix.Files changed
gateway/run.py— removed 3suspend_session()calls, updated messages and docstringtests/gateway/test_session_race_guard.py— updated assertions for new messaging