Skip to content

Retry transient local provider connection failures (ECONNREFUSED) in session loop #15851

Description

@pkellyuk

Describe the bug\nWhen using local OpenAI-compatible providers (for example llama.cpp), transient connection failures like ECONNREFUSED can appear during long-running sessions.\n\nThese failures are currently treated as non-retryable in some paths, so the session stops instead of recovering automatically.\n\n### Steps to reproduce\n1. Configure a local provider endpoint (for example http://127.0.0.1:8080/v1).\n2. Start a long session and trigger intermittent local server availability/connectivity interruptions.\n3. Observe that some connection failures abort the turn instead of retrying.\n\n### Expected behavior\nTransient local connectivity errors should be marked retryable so the existing session retry loop can recover automatically.\n\n### Additional context\nThis especially affects local/self-hosted flows where temporary restarts and socket hiccups are expected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions