Bump to 0.1.18#112
Conversation
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request introduces dynamic local TCP host resolution for the PeerAgent to prevent remote peers from receiving unroutable 0.0.0.0 addresses, and adds connection reuse for TCP. It also improves connection failure handling during handshakes, adds a new two-process TCP read example, and bumps the project version to 0.1.18. Feedback was provided to remove a duplicate @staticmethod decorator and optimize _local_ip_for_remote by passing the resolved address tuple directly to sock.connect to avoid redundant DNS lookups.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
I am having trouble creating individual review comments. Click here to see my feedback.
dlslime/dlslime/peer_agent/_agent.py (428-441)
There is a duplicate @staticmethod decorator on _local_ip_for_remote. Additionally, when calling sock.connect, we can pass the already resolved address tuple gai[0][4] directly instead of re-resolving remote_host inside connect(). This avoids redundant DNS lookups and is more robust.
@staticmethod
def _local_ip_for_remote(remote_host: str) -> str:
if not remote_host:
return ""
try:
# Resolve the family dynamically to support both IPv4 and IPv6
gai = socket.getaddrinfo(remote_host, 80, type=socket.SOCK_DGRAM)
if not gai:
return ""
family = gai[0][0]
with socket.socket(family, socket.SOCK_DGRAM) as sock:
sock.connect(gai[0][4])
return sock.getsockname()[0]
except OSError:
return ""
No description provided.