Problem
PR #9224 removed suspend_session() calls from the /stop command to prevent users from losing their conversation history. The updated tests in that PR only check message text ("stopped" instead of "force-stopped") — they never verify that suspend_session is NOT called.
If someone reverts the fix or re-adds suspend_session() to any of the three /stop code paths, all existing tests still pass because none of them assert on session store state.
Proposed fix
Add test_stop_does_not_suspend_session to tests/gateway/test_session_race_guard.py that covers all three /stop paths:
- Sentinel set (agent still starting)
- Real agent running
- No agent running (no-op)
Each path asserts session_store.suspend_session.assert_not_called().
Context
Problem
PR #9224 removed
suspend_session()calls from the/stopcommand to prevent users from losing their conversation history. The updated tests in that PR only check message text ("stopped" instead of "force-stopped") — they never verify thatsuspend_sessionis NOT called.If someone reverts the fix or re-adds
suspend_session()to any of the three/stopcode paths, all existing tests still pass because none of them assert on session store state.Proposed fix
Add
test_stop_does_not_suspend_sessiontotests/gateway/test_session_race_guard.pythat covers all three/stoppaths:Each path asserts
session_store.suspend_session.assert_not_called().Context
/stopwas wiping conversation historysuspend_sessionbehavior was originally added in [Gateway] Stuck session resumes on restart — creates unrecoverable loop #7536 to handle stuck sessionssuspend_recently_active()at gateway startup already handles the stuck-session case