tests/gateway/test_restart_resume_pending.py::test_resume_pending_is_cleared_only_after_successful_turn tests/gateway/test_restart_resume_pending.py::TestSessionEntryResumeFields::test_defaults tests/gateway/test_restart_resume_pending.py::TestSessionEntryResumeFields::test_roundtrip_with_resume_fields tests/gateway/test_restart_resume_pending.py::TestSessionEntryResumeFields::test_from_dict_legacy_without_resume_fields tests/gateway/test_restart_resume_pending.py::TestSessionEntryResumeFields::test_malformed_timestamp_is_tolerated tests/gateway/test_restart_resume_pending.py::TestMarkResumePending::test_marks_existing_session tests/gateway/test_restart_resume_pending.py::TestMarkResumePending::test_custom_reason_persists tests/gateway/test_restart_resume_pending.py::TestMarkResumePending::test_returns_false_for_unknown_key tests/gateway/test_restart_resume_pending.py::TestMarkResumePending::test_does_not_override_suspended tests/gateway/test_restart_resume_pending.py::TestMarkResumePending::test_survives_roundtrip_through_json tests/gateway/test_restart_resume_pending.py::TestClearResumePending::test_clears_flag tests/gateway/test_restart_resume_pending.py::TestClearResumePending::test_returns_false_when_not_pending tests/gateway/test_restart_resume_pending.py::TestClearResumePending::test_returns_false_for_unknown_key tests/gateway/test_restart_resume_pending.py::TestGetOrCreateResumePending::test_resume_pending_preserves_session_id tests/gateway/test_restart_resume_pending.py::TestGetOrCreateResumePending::test_suspended_still_creates_new_session tests/gateway/test_restart_resume_pending.py::TestGetOrCreateResumePending::test_suspended_overrides_resume_pending tests/gateway/test_restart_resume_pending.py::TestSuspendRecentlyActiveSkipsResumePending::test_resume_pending_entries_not_suspended tests/gateway/test_restart_resume_pending.py::TestSuspendRecentlyActiveSkipsResumePending::test_non_resume_pending_gets_resume_pending tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_resume_pending_restart_note_mentions_restart tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_resume_pending_shutdown_note_mentions_shutdown tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_resume_pending_fires_without_tool_tail tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_resume_pending_subsumes_tool_tail_note tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_no_resume_pending_preserves_tool_tail_note tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_stale_resume_pending_does_not_inject_restart_note tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_fresh_tool_tail_preserves_auto_continue_note tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_stale_tool_tail_does_not_inject_auto_continue_note tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_stale_tool_tail_with_production_data_shape tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_freshness_gate_disabled_via_zero_window tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_legacy_history_without_timestamps_still_injects tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_no_note_when_nothing_to_resume tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_resume_pending_note_warns_against_reexecuting_restart tests/gateway/test_restart_resume_pending.py::TestResumePendingSystemNote::test_resume_pending_empty_message_reports_recovery tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_coerce_datetime tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_coerce_epoch_seconds tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_coerce_epoch_milliseconds tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_coerce_iso_string tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_coerce_iso_string_with_z_suffix tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_coerce_numeric_string tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_coerce_rejects_garbage tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_is_fresh_unknown_is_fresh tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_is_fresh_window_bounds tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_is_fresh_zero_window_always_fresh tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_last_transcript_timestamp_skips_meta tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_last_transcript_timestamp_empty tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_last_transcript_timestamp_row_without_timestamp tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_auto_continue_freshness_window_reads_env tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_auto_continue_freshness_window_default_when_unset tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_auto_continue_freshness_window_malformed_falls_back tests/gateway/test_restart_resume_pending.py::TestFreshnessHelpers::test_auto_continue_freshness_window_empty_falls_back tests/gateway/test_restart_resume_pending.py::test_drain_timeout_marks_resume_pending tests/gateway/test_restart_resume_pending.py::test_drain_timeout_uses_restart_reason_when_restarting tests/gateway/test_restart_resume_pending.py::test_drain_timeout_skips_pending_sentinel_sessions tests/gateway/test_restart_resume_pending.py::test_startup_auto_resume_schedules_fresh_pending_sessions tests/gateway/test_restart_resume_pending.py::test_startup_auto_resume_includes_crash_recovery tests/gateway/test_restart_resume_pending.py::test_startup_auto_resume_skips_stale_entries tests/gateway/test_restart_resume_pending.py::test_startup_auto_resume_skips_suspended_and_originless tests/gateway/test_restart_resume_pending.py::test_startup_auto_resume_skips_disallowed_reasons tests/gateway/test_restart_resume_pending.py::test_startup_auto_resume_skips_when_adapter_unavailable tests/gateway/test_restart_resume_pending.py::test_reconnect_reschedules_pending_after_late_platform_connect tests/gateway/test_restart_resume_pending.py::test_reconnect_reschedule_is_platform_scoped tests/gateway/test_restart_resume_pending.py::test_auto_resume_skips_sessions_with_running_agent tests/gateway/test_restart_resume_pending.py::test_startup_restore_gate_queues_real_inbound_messages tests/gateway/test_restart_resume_pending.py::test_startup_restore_waits_for_resume_before_draining_inbound tests/gateway/test_restart_resume_pending.py::test_restart_banner_uses_try_to_resume_wording tests/gateway/test_restart_resume_pending.py::test_restart_notifies_home_channel_even_without_active_sessions tests/gateway/test_restart_resume_pending.py::test_restart_home_channel_notification_dedupes_active_chat tests/gateway/test_restart_resume_pending.py::test_restart_home_channel_notification_not_deduped_across_threads tests/gateway/test_restart_resume_pending.py::test_restart_home_channel_notification_ignores_false_send_result tests/gateway/test_restart_resume_pending.py::TestStuckLoopEscalation::test_escalation_via_stuck_loop_counter_overrides_resume_pending tests/gateway/test_restart_resume_pending.py::TestStuckLoopEscalation::test_successful_turn_flow_clears_both_counter_and_resume_pending tests/gateway/test_restart_resume_pending.py::TestStuckLoopEscalation::test_increment_restart_failure_counts_uses_atomic_json_write tests/gateway/test_restart_resume_pending.py::TestStuckLoopEscalation::test_clear_restart_failure_count_uses_atomic_json_write_when_entries_remain tests/gateway/test_restart_resume_pending.py::test_auto_resume_sets_sentinel_before_task_execution tests/gateway/test_restart_resume_pending.py::test_auto_resume_sentinel_cleaned_on_task_failure tests/gateway/test_restart_resume_pending.py::test_auto_resume_runs_agent_exactly_once_through_full_path