fix(gateway): cron cleanup on failure + session finalize guard - #12184
fix(gateway): cron cleanup on failure + session finalize guard#12184jjjojoj wants to merge 4 commits into
Conversation
…esearch#12175) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ousResearch#12176) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2294) build_skills_system_prompt() loaded disabled set AFTER the cache check, so config changes to skills.disabled silently had no effect until restart. Move get_disabled_skill_names() before cache check and add sorted disabled tuple to cache key so any change invalidates the cache.
NousResearch#12064) Background task media delivery unpacked the (path, is_voice) tuple but discarded the is_voice flag, sending all audio via send_document. Now routes voice files through send_voice() when the adapter supports it.
|
Thanks for the contribution @jjjojoj. This PR is effectively superseded and can be closed. Here's why: All three unrelated fixes have already landed on
The cron cleanup fix (Fix 4) is stale: The diff does not incorporate the additional cleanup steps now present on A clean replacement PR exists: PR #55031 applies the same core idea (running cleanup before returning on failure) as a minimal reorder of existing code — no new logic, no new patterns. The diagnosis work here was useful for identifying the issue. |
|
Thanks for identifying the failure-path lifecycle gap. The cron diagnosis is still valid on current Problems
Suggested changes
Automated hermes-sweeper review. |
Summary
Two small bug fixes for the gateway runner:
#12175 — Cron ticker leaks on failure shutdown
start_gateway()returned early onshould_exit_with_failurebefore callingcron_stop.set()/cron_thread.join(), leaking the daemon cron thread. Moved cleanup into afinallyblock so it always runs.#12176 —
/newemitson_session_finalize(session_id=None)with no prior session_handle_reset_command()always firedon_session_finalize, even whenold_entrywasNone(first session). Added a guard so the finalize hook only fires when there is an actual old session to finalize.Test plan
/newon first session does not emiton_session_finalize/newon existing session still emitson_session_finalizewith correct session_id