hermes - ✅(Solved) Fix [Bug]: using DNS for local provider is not addressed in recent fix [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#20346Fetched 2026-05-06 06:37:18
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #20359: fix(agent): treat mDNS/.lan/unqualified hostnames as local endpoints (#20346)

Description (problem / solution / changelog)

Summary

  • Reporter (#20346) noted that is_local_endpoint ignored DNS hostnames that resolve to RFC-1918 addresses, so a base_url like http://nas.local:11434 or http://homeassistant:8123 was treated as cloud — disabling the local-provider timeout and num_ctx auto-bumps.
  • The previous logic only matched IP literals plus three Docker/Podman/Lima container suffixes.
  • This PR extends is_local_endpoint with three new branches:
    1. Static suffix list for de-facto private TLDs: .local (RFC 6762 mDNS), .lan, .home/.home.arpa (RFC 8375), .internal, .intranet, .localdomain, .private.
    2. Bare single-label hostnames (no dots) — those resolve via /etc/hosts, NetBIOS, or local DHCP, never via public DNS.
    3. Opt-in DNS resolution via HERMES_LOCAL_ENDPOINT_RESOLVE_DNS=1 for environments where the operator wants the lookup but doesn't want it as a default behaviour.
  • Adds 25 parametrized regression tests in tests/agent/test_local_stream_timeout.py covering each new branch plus negative cases (local.example.com, my-local.cloud-provider.com, etc. must remain remote).

Closes #20346.

Testing

  • scripts/run_tests.sh tests/agent/test_local_stream_timeout.py -q
  • scripts/run_tests.sh tests/agent/test_model_metadata.py tests/agent/test_model_metadata_local_ctx.py -q (downstream callers)
  • scripts/run_tests.sh tests/hermes_cli/test_custom_provider_context_length.py tests/hermes_cli/test_model_switch_context_display.py -q (call sites that mock is_local_endpoint)
  • Verified the new tests fail on origin/main (15 failures) and pass after the patch.

Test output

▶ running pytest with 4 workers, hermetic env, in /tmp/hermes-20346-fix
  (TZ=UTC LANG=C.UTF-8 PYTHONHASHSEED=0; all credential env vars unset)
bringing up nodes...
bringing up nodes...

............................................................             [100%]
60 passed in 1.68s

Broader run:

........................................................................ [ 41%]
........................................................................ [ 82%]
...............................                                          [100%]
175 passed in 1.52s

Changed files

  • agent/model_metadata.py (modified, +91/-6)
  • tests/agent/test_local_stream_timeout.py (modified, +94/-0)

Code Example

Debug report uploaded:
  Report     https://paste.rs/8FOUt
  agent.log  https://paste.rs/kCsYj

---
RAW_BUFFERClick to expand / collapse

Bug Description

Hello,

The fix addressed in this PR 6368 ( https://github.com/NousResearch/hermes-agent/pull/6368 ) does not address DNS entries therefore DNS in local is getting ignored by is_local_endpoint() even if it resolves into an RFC1918 address.

Steps to Reproduce

use local hostname or DNS in "base_url" .

Expected Behavior

when hostname or DNS resolves into RFC1918 address, it should be regarded as local endpoint.

Actual Behavior

all DNS entries getting treated as cloud based service.

Affected Component

Agent Core (conversation loop, context compression, memory)

Messaging Platform (if gateway-related)

No response

Debug Report

Debug report uploaded:
  Report     https://paste.rs/8FOUt
  agent.log  https://paste.rs/kCsYj

Operating System

Ubuntu 24.04

Python Version

3.11.2

Hermes Version

2.31.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The is_local_endpoint() function may need to be updated to correctly handle DNS entries that resolve to RFC1918 addresses.

Guidance

  • Review the is_local_endpoint() function to ensure it properly checks if a DNS entry resolves to a private IP address (RFC1918).
  • Verify that the DNS resolution is correctly implemented and returns the expected IP address.
  • Check the base_url configuration to ensure it is correctly set to use the local hostname or DNS.
  • Test the is_local_endpoint() function with different DNS entries and IP addresses to identify any potential issues.

Example

No code snippet is provided as the issue does not contain sufficient information about the is_local_endpoint() function implementation.

Notes

The issue seems to be related to the is_local_endpoint() function not correctly handling DNS entries that resolve to private IP addresses. However, without more information about the function implementation, it is difficult to provide a precise fix.

Recommendation

Apply workaround: Update the is_local_endpoint() function to correctly handle DNS entries that resolve to RFC1918 addresses, as this is the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING