|
SSH connection pooling: per-session, 20-minute TTL
- Pool keyed by session_id:host:port:username — parallel sessions share no state even when targeting the same server - Per-key asyncio.Lock prevents concurrent connection creation races - TTL (20 min) and is_closing() checked on every access; expired/closed connections are evicted and replaced transparently - On disconnect error during command execution: evict + retry once with fresh connection - current_session_id ContextVar (set by Agent before tool calls) is read in ssh_exec to build the pool key without changing tool signatures Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
|---|
|
|
| .env.example |
|---|
| navi/core/agent.py |
|---|
| navi/tools/base.py |
|---|
| navi/tools/ssh_exec.py |
|---|