Skip to content

fix(local): recognize unqualified hostnames as local endpoints#9248

Merged
benbarclay merged 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/is-local-endpoint-docker-dns
Jun 5, 2026
Merged

fix(local): recognize unqualified hostnames as local endpoints#9248
benbarclay merged 2 commits into
NousResearch:mainfrom
Tranquil-Flow:fix/is-local-endpoint-docker-dns

Conversation

@Tranquil-Flow

@Tranquil-Flow Tranquil-Flow commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Unqualified hostnames (no dots) are now recognized as local endpoints by is_local_endpoint().

Docker Compose service names (e.g. ollama, litellm, hermes-litellm) are unqualified hostnames that resolve via Docker DNS, /etc/hosts, or mDNS. Without this fix, the stale stream timeout fires on local LLM proxies, causing infinite reconnect loops.

Approach: added a check after the existing container suffix matching — if host and "." not in host: return True.

Related Issue

Closes #7905

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • is_local_endpoint() (in agent local endpoint detection): added unqualified-hostname check after the existing container suffix matching
  • 4 parametrized regression tests in tests/agent/test_local_stream_timeout.py::TestIsLocalEndpoint covering realistic Docker Compose service names

How to Test

  1. pytest tests/agent/test_local_stream_timeout.py::TestIsLocalEndpoint -v — all 20 tests pass (4 new + 16 existing)
  2. Verify with Docker Compose service names: ollama, litellm, hermes-litellm

Platform: all platforms (primarily Docker/Podman environments).

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15 (Darwin 24.6.0)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

pytest tests/agent/test_local_stream_timeout.py::TestIsLocalEndpoint -v
20 passed (4 new + 16 existing)

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists area/docker Docker image, Compose, packaging comp/agent Core agent loop, run_agent.py, prompt builder labels Apr 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #7906 — same fix for is_local_endpoint() missing Docker/Podman DNS names. Both close #7905.

Docker Compose service names (e.g. ollama, litellm, hermes-litellm)
are unqualified hostnames with no dots. These are always local — they
resolve via Docker DNS, /etc/hosts, or mDNS. Without this fix, the
stale stream timeout fires on local LLM proxies, causing infinite
reconnect loops.

Closes NousResearch#7905
@Tranquil-Flow Tranquil-Flow force-pushed the fix/is-local-endpoint-docker-dns branch from 8d467c1 to b9a7e8b Compare May 25, 2026 11:07
@benbarclay benbarclay merged commit 4690bbc into NousResearch:main Jun 5, 2026
21 checks passed
davidgut1982 pushed a commit to davidgut1982/hermes-agent that referenced this pull request Jun 5, 2026
…esearch#9248)

Docker Compose service names (e.g. ollama, litellm, hermes-litellm)
are unqualified hostnames with no dots. These are always local — they
resolve via Docker DNS, /etc/hosts, or mDNS. Without this fix, the
stale stream timeout fires on local LLM proxies, causing infinite
reconnect loops.

Closes NousResearch#7905
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
…esearch#9248)

Docker Compose service names (e.g. ollama, litellm, hermes-litellm)
are unqualified hostnames with no dots. These are always local — they
resolve via Docker DNS, /etc/hosts, or mDNS. Without this fix, the
stale stream timeout fires on local LLM proxies, causing infinite
reconnect loops.

Closes NousResearch#7905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker Docker image, Compose, packaging comp/agent Core agent loop, run_agent.py, prompt builder 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.

is_local_endpoint misses Docker/Podman DNS names — stale timeout fires on local LLM proxies

3 participants