hermes-agent/tests/gateway
Teknium e9e7fb0683
fix(gateway): track background task references in GatewayRunner (#3254)
Asyncio tasks created with create_task() but never stored can be
garbage collected mid-execution. Add self._background_tasks set to
hold references, with add_done_callback cleanup. Tracks:
- /background command task
- session-reset memory flush task
- session-resume memory flush task
Cancel all pending tasks in stop().

Update test fixtures that construct GatewayRunner via object.__new__()
to include the new _background_tasks attribute.

Cherry-picked from PR #3167 by memosr. The original PR also deleted
the DM topic auto-skill loading code — that deletion was excluded
from this salvage as it removes a shipped feature (#2598).

Co-authored-by: memosr.eth <96793918+memosr@users.noreply.github.com>
2026-03-26 14:33:48 -07:00
..
__init__.py
…
test_agent_cache.py fix(gateway): fingerprint full auth token in agent cache signature (#3247) 2026-03-26 13:19:43 -07:00
test_api_server.py fix(api_server): streaming breaks when agent makes tool calls (#2985) 2026-03-25 09:56:20 -07:00
test_api_server_jobs.py fix(api-server): harden jobs API — input limits, field whitelist, startup check, tests 2026-03-22 04:18:18 -07:00
test_approve_deny_commands.py
…
test_async_memory_flush.py
…
test_background_command.py fix(gateway): track background task references in GatewayRunner (#3254) 2026-03-26 14:33:48 -07:00
test_background_process_notifications.py
…
test_base_topic_sessions.py
…
test_channel_directory.py
…
test_config.py
…
test_config_cwd_bridge.py
…
test_delivery.py
…
test_dingtalk.py
…
test_discord_bot_filter.py
…
test_discord_document_handling.py feat(discord): add document caching and text-file injection (#2503) 2026-03-22 07:38:14 -07:00
test_discord_free_response.py
…
test_discord_imports.py
…
test_discord_media_metadata.py
…
test_discord_opus.py
…
test_discord_send.py
…
test_discord_slash_commands.py fix(discord): properly route slash event handling in threads 2026-03-22 04:25:19 -07:00
test_discord_system_messages.py fix(discord): ignore system messages in on_message handler (#2618) 2026-03-23 06:50:09 -07:00
test_discord_thread_persistence.py
…
test_dm_topics.py feat(telegram): Private Chat Topics with functional skill binding (#2598) 2026-03-26 02:04:11 -07:00
test_document_cache.py
…
test_email.py
…
test_extract_local_files.py
…
test_flush_memory_stale_guard.py fix(gateway): prevent stale memory overwrites by flush agent (#2670) 2026-03-23 16:08:38 -07:00
test_gateway_shutdown.py fix(gateway): track background task references in GatewayRunner (#3254) 2026-03-26 14:33:48 -07:00
test_homeassistant.py
…
test_honcho_lifecycle.py
…
test_hooks.py
…
test_interrupt_key_match.py
…
test_matrix.py
…
test_mattermost.py fix(tests): resolve all consistently failing tests 2026-03-22 05:58:26 -07:00
test_media_extraction.py
…
test_mirror.py
…
test_pairing.py
…
test_pii_redaction.py
…
test_plan_command.py
…
test_platform_base.py
…
test_platform_reconnect.py feat: auto-reconnect failed gateway platforms with exponential backoff (#2584) 2026-03-22 23:48:24 -07:00
test_queue_consumption.py fix(gateway): process /queue'd messages after agent completion (#2469) 2026-03-22 04:56:13 -07:00
test_reasoning_command.py fix: MCP toolset resolution for runtime and config (#3252) 2026-03-26 13:39:41 -07:00
test_resume_command.py
…
test_retry_replacement.py
…
test_retry_response.py
…
test_run_progress_topics.py feat(gateway): cache AIAgent per session for prompt caching 2026-03-21 16:21:06 -07:00
test_runner_fatal_adapter.py feat: auto-reconnect failed gateway platforms with exponential backoff (#2584) 2026-03-22 23:48:24 -07:00
test_runner_startup_failures.py
…
test_send_image_file.py fix(gateway): pass message_thread_id in send_image_file, send_document, send_video 2026-03-21 09:49:33 -07:00
test_session.py fix(state): SQLite concurrency hardening + session transcript integrity (#3249) 2026-03-26 13:47:14 -07:00
test_session_env.py
…
test_session_hygiene.py refactor(gateway): remove broken 1.4x hygiene multiplier entirely 2026-03-22 15:21:18 -07:00
test_session_race_guard.py fix(gateway): track background task references in GatewayRunner (#3254) 2026-03-26 14:33:48 -07:00
test_session_reset_notify.py feat(gateway): notify users when session auto-resets (#2519) 2026-03-22 09:33:39 -07:00
test_signal.py fix(tests): resolve all consistently failing tests 2026-03-22 05:58:26 -07:00
test_slack.py fix(gateway/slack): send progress messages to correct thread (#3063) 2026-03-25 15:51:15 -07:00
test_sms.py
…
test_ssl_certs.py
…
test_status.py
…
test_status_command.py
…
test_sticker_cache.py
…
test_stt_config.py
…
test_telegram_conflict.py fix(gateway): retry Telegram 409 polling conflicts before giving up 2026-03-21 07:11:06 -07:00
test_telegram_documents.py fix(gateway): pass message_thread_id in send_image_file, send_document, send_video 2026-03-21 09:49:33 -07:00
test_telegram_format.py Merge pull request #2199 from llbn/fix/telegram-markdownv2-features 2026-03-20 12:45:47 -07:00
test_telegram_photo_interrupts.py
…
test_telegram_reply_mode.py feat(gateway): configurable Telegram reply threading mode (#2907) 2026-03-24 19:56:00 -07:00
test_telegram_text_batching.py
…
test_title_command.py
…
test_transcript_offset.py
…
test_unauthorized_dm_behavior.py
…
test_update_command.py
…
test_voice_command.py fix(voice): enable TTS voice reply when streaming is active (#2322) 2026-03-21 08:08:37 -07:00
test_webhook_adapter.py feat(gateway): add webhook platform adapter for external event triggers 2026-03-20 06:33:36 -07:00
test_webhook_integration.py feat(gateway): add webhook platform adapter for external event triggers 2026-03-20 06:33:36 -07:00
test_whatsapp_connect.py fix(gateway): restart on whatsapp bridge child exit (#2334) 2026-03-21 09:38:52 -07:00
test_whatsapp_reply_prefix.py
…