Skip to content

The agent that grows with you

test(gateway): accept preserve_prompt_pin in handoff switch_session stubs

teknium172a2271d0ee1
diff --git a/tests/gateway/test_handoff_secondary_profile_adapter.py b/tests/gateway/test_handoff_secondary_profile_adapter.py
index c5ec8241847..26cb436c708 100644
--- a/tests/gateway/test_handoff_secondary_profile_adapter.py
+++ b/tests/gateway/test_handoff_secondary_profile_adapter.py
@@ -67,7 +67,7 @@ def _make_multiplex_runner():
platform=Platform.TELEGRAM, chat_type="dm",
))
- async def _switch(key, sid):
+ async def _switch(key, sid, *, preserve_prompt_pin=True):
captured["session_key"] = key
return SessionEntry(
session_key=key, session_id=sid,
diff --git a/tests/gateway/test_telegram_topic_mode.py b/tests/gateway/test_telegram_topic_mode.py
index 7f7e5de3b64..47882da632b 100644
--- a/tests/gateway/test_telegram_topic_mode.py
+++ b/tests/gateway/test_telegram_topic_mode.py
@@ -111,7 +111,7 @@ def _make_runner(session_db=None):
# Default switch_session impl: returns a SessionEntry carrying the target
# session_id. Mirrors SessionStore.switch_session semantics for tests that
# exercise Telegram topic binding rebinds without a real store.
- def _switch_session(session_key, target_session_id, *, expected_session_id=None):
+ def _switch_session(session_key, target_session_id, *, expected_session_id=None, preserve_prompt_pin=True):
return SessionEntry(
session_key=session_key,
session_id=target_session_id,
@@ -677,7 +677,9 @@ async def test_handoff_to_telegram_dm_topic_uses_dm_lane_not_generic_thread(tmp_
expected_source = _make_source(thread_id="17585")
expected_key = build_session_key(expected_source)
- runner.session_store.switch_session.assert_called_once_with(expected_key, "cli-session")
+ runner.session_store.switch_session.assert_called_once_with(
+ expected_key, "cli-session", preserve_prompt_pin=False,
+ )
assert captured["source"].chat_type == "dm"
assert captured["source"].user_id == "208214988"
assert captured["source"].thread_id == "17585"