Skip to content

fix(gateway): recover stale pid files and release evicted clients#14609

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/gateway-stale-pid-and-agent-eviction-14598
Open

fix(gateway): recover stale pid files and release evicted clients#14609
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/gateway-stale-pid-and-agent-eviction-14598

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Summary

  • recover startup when a stale gateway.pid is still present after the runtime lock is acquired
  • release provider clients when _evict_cached_agent() drops a cached agent
  • add regression coverage for both recovery paths

Testing

  • python3 -m pytest -o addopts='' -q tests/gateway/test_agent_cache.py -k 'evict' tests/gateway/test_runner_startup_failures.py -k 'stale_pid or start_gateway'
  • python3 -m pytest -o addopts='' -q tests/tools/test_zombie_process_cleanup.py -k 'evict_does_not_call_close' tests/gateway/test_session_model_reset.py -k 'evict'

Closes #14598

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/gateway Gateway runner, session dispatch, delivery labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway run.py: PID file race condition and httpx connection leak on cache eviction

2 participants