tests/gateway/test_session.py::TestSessionSourceRoundtrip::test_full_roundtrip tests/gateway/test_session.py::TestSessionSourceRoundtrip::test_full_roundtrip_with_chat_topic tests/gateway/test_session.py::TestSessionSourceRoundtrip::test_minimal_roundtrip tests/gateway/test_session.py::TestSessionSourceRoundtrip::test_chat_id_coerced_to_string tests/gateway/test_session.py::TestSessionSourceRoundtrip::test_missing_optional_fields tests/gateway/test_session.py::TestSessionSourceRoundtrip::test_unknown_platform_rejected_for_bad_names tests/gateway/test_session.py::TestSessionSourceDescription::test_local_cli tests/gateway/test_session.py::TestSessionSourceDescription::test_dm_with_username tests/gateway/test_session.py::TestSessionSourceDescription::test_dm_without_username_falls_back_to_user_id tests/gateway/test_session.py::TestSessionSourceDescription::test_group_shows_chat_name tests/gateway/test_session.py::TestSessionSourceDescription::test_channel_type tests/gateway/test_session.py::TestSessionSourceDescription::test_thread_id_appended tests/gateway/test_session.py::TestSessionSourceDescription::test_unknown_chat_type_uses_name tests/gateway/test_session.py::TestLocalCliFactory::test_local_cli_defaults tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_telegram_prompt_contains_platform_and_chat tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_bluebubbles_prompt_mentions_short_conversational_i_message_format tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_discord_prompt tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_slack_prompt_includes_platform_notes tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_discord_prompt_with_channel_topic tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_prompt_omits_channel_topic_when_none tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_local_prompt_mentions_machine tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_local_delivery_path_uses_display_hermes_home tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_whatsapp_prompt tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_multi_user_thread_prompt tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_non_thread_group_shows_user tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_shared_non_thread_group_prompt_hides_single_user tests/gateway/test_session.py::TestBuildSessionContextPrompt::test_dm_thread_shows_user_not_multi tests/gateway/test_session.py::TestSenderPrefixWithBackfill::test_plain_message_gets_prefix tests/gateway/test_session.py::TestSenderPrefixWithBackfill::test_backfill_prefix_only_on_trigger tests/gateway/test_session.py::TestSenderPrefixWithBackfill::test_backfill_preserves_context_block tests/gateway/test_session.py::TestSessionStoreRewriteTranscript::test_rewrite_replaces_transcript tests/gateway/test_session.py::TestSessionStoreRewriteTranscript::test_rewrite_with_empty_list tests/gateway/test_session.py::TestLoadTranscriptDBOnly::test_db_only_returns_empty_for_nonexistent tests/gateway/test_session.py::TestLoadTranscriptDBOnly::test_db_only_returns_messages tests/gateway/test_session.py::TestSessionStoreSwitchSession::test_switch_session_reopens_target_session_in_db tests/gateway/test_session.py::TestSessionStoreLookupBySessionId::test_returns_active_entry_for_persisted_session_id tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_whatsapp_dm_uses_canonical_identifier tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_whatsapp_dm_aliases_share_one_session_key tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_whatsapp_group_participant_aliases_share_session_key tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_whatsapp_group_shared_sessions_untouched_by_canonicalisation tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_store_delegates_to_build_session_key tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_store_creates_distinct_group_sessions_per_user tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_store_shares_group_sessions_when_disabled_in_config tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_telegram_dm_includes_chat_id tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_distinct_dm_chat_ids_get_distinct_session_keys tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_dm_without_chat_id_falls_back_to_user_id tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_dm_without_chat_id_distinct_users_do_not_collide tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_dm_without_chat_id_prefers_user_id_alt tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_dm_without_chat_id_or_user_id_falls_back_to_thread_then_sink tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_discord_group_includes_chat_id tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_group_sessions_are_isolated_per_user_when_user_id_present tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_group_sessions_can_be_shared_when_isolation_disabled tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_group_thread_includes_thread_id tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_group_thread_sessions_are_shared_by_default tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_group_thread_sessions_can_be_isolated_per_user tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_non_thread_group_sessions_still_isolated_per_user tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_discord_thread_sessions_shared_by_default tests/gateway/test_session.py::TestWhatsAppSessionKeyConsistency::test_dm_thread_sessions_not_affected tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_normalize_strips_jid_suffix tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_normalize_strips_lid_suffix tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_normalize_strips_device_suffix tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_normalize_strips_leading_plus tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_normalize_handles_bare_numeric tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_normalize_handles_empty_and_none tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_canonical_without_mapping_returns_normalized tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_canonical_walks_lid_mapping tests/gateway/test_session.py::TestWhatsAppIdentifierPublicHelpers::test_canonical_empty_input tests/gateway/test_session.py::TestSessionStoreEntriesAttribute::test_entries_attribute_exists tests/gateway/test_session.py::TestHasAnySessions::test_uses_database_count_when_available tests/gateway/test_session.py::TestHasAnySessions::test_first_session_ever_returns_false tests/gateway/test_session.py::TestHasAnySessions::test_fallback_without_database tests/gateway/test_session.py::TestLastPromptTokens::test_session_entry_default tests/gateway/test_session.py::TestLastPromptTokens::test_session_entry_roundtrip tests/gateway/test_session.py::TestLastPromptTokens::test_session_entry_from_old_data tests/gateway/test_session.py::TestLastPromptTokens::test_update_session_sets_last_prompt_tokens tests/gateway/test_session.py::TestLastPromptTokens::test_update_session_none_does_not_change tests/gateway/test_session.py::TestLastPromptTokens::test_update_session_zero_resets tests/gateway/test_session.py::TestRewriteTranscriptPreservesReasoning::test_reasoning_survives_rewrite tests/gateway/test_session.py::TestRewriteTranscriptPreservesReasoning::test_db_rewrite_is_atomic_on_insert_failure