Skip to content

fix(gateway): cron cleanup on failure + session finalize guard#12184

Open
jjjojoj wants to merge 4 commits into
NousResearch:mainfrom
jjjojoj:main
Open

fix(gateway): cron cleanup on failure + session finalize guard#12184
jjjojoj wants to merge 4 commits into
NousResearch:mainfrom
jjjojoj:main

Conversation

@jjjojoj

@jjjojoj jjjojoj commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Two small bug fixes for the gateway runner:

#12175 — Cron ticker leaks on failure shutdown

start_gateway() returned early on should_exit_with_failure before calling cron_stop.set() / cron_thread.join(), leaking the daemon cron thread. Moved cleanup into a finally block so it always runs.

#12176/new emits on_session_finalize(session_id=None) with no prior session

_handle_reset_command() always fired on_session_finalize, even when old_entry was None (first session). Added a guard so the finalize hook only fires when there is an actual old session to finalize.

Test plan

  • Verify cron thread is joined on failure exit path
  • Verify /new on first session does not emit on_session_finalize
  • Verify /new on existing session still emits on_session_finalize with correct session_id

jjjojoj and others added 4 commits April 18, 2026 22:51
…esearch#12175)

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.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/cron Cron scheduler and job management labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants