Skip to content

test(gateway): regression test for /stop not suspending session (#9241)#9242

Open
r266-tech wants to merge 2 commits into
NousResearch:mainfrom
r266-tech:test/stop-no-suspend-regression
Open

test(gateway): regression test for /stop not suspending session (#9241)#9242
r266-tech wants to merge 2 commits into
NousResearch:mainfrom
r266-tech:test/stop-no-suspend-regression

Conversation

@r266-tech

Copy link
Copy Markdown
Contributor

Summary

PR #9224 removed suspend_session() from /stop to prevent users from losing their conversation history. The updated tests only check message text — none verify that suspend_session() is not called on the session store.

This adds test_stop_does_not_suspend_session covering all three /stop code paths:

  1. Sentinel set (agent still starting) — asserts no suspend + sentinel cleanup
  2. Real agent running — asserts no suspend + agent removal
  3. No agent (no-op) — asserts no suspend

If suspend_session() is ever re-added to any /stop path, this test fails immediately.

Fixes #9241

Known limitations (from adversarial review)

  • This test focuses specifically on the suspend_session guard. Agent interrupt and session unlock behaviors are already covered by Tests 6, 6b, 6c in the same file.
  • The three paths share a single runner instance (consistent with the file's existing test patterns). State is properly cleaned between paths via reset_mock() + _running_agents mutations.

Test plan

  • pytest tests/gateway/test_session_race_guard.py -k test_stop_does_not_suspend_session -v
  • Verify the test fails if suspend_session() is re-added to any /stop path

…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.
…n each /stop path

Codex adversarial review (confidence 0.91): path 1 did not verify
sentinel removal after /stop, could mask regression. Added explicit
assertions for _running_agents cleanup in paths 1 and 2.
@alt-glitch alt-glitch added type/test Test coverage or test infrastructure P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery labels Apr 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #9457 — both add the same suspend_session regression test for /stop, fixing #9241.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/test Test coverage or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: /stop regression test missing suspend_session guard (post-#9224)

2 participants