Skip to content

fix(hermes): is_available() must not do network calls#377

Open
eleboucher wants to merge 1 commit into
rohitg00:mainfrom
eleboucher:feat/hermes
Open

fix(hermes): is_available() must not do network calls#377
eleboucher wants to merge 1 commit into
rohitg00:mainfrom
eleboucher:feat/hermes

Conversation

@eleboucher
Copy link
Copy Markdown

@eleboucher eleboucher commented May 14, 2026

As written in the is available shouldn't do any network call

Summary by CodeRabbit

  • Bug Fixes
    • Availability checks no longer perform network calls, making status detection faster and more reliable.
    • URL validation tightened so malformed or incomplete URLs are treated as unavailable, preventing erroneous availability reports.

Review Change Stack

@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

@eleboucher is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 015acfec-e265-49f9-88cd-e1b84fd0239b

📥 Commits

Reviewing files that changed from the base of the PR and between 383bb24 and ea9cef2.

📒 Files selected for processing (1)
  • integrations/hermes/__init__.py

📝 Walkthrough

Walkthrough

AgentMemoryProvider now performs only strengthened local URL validation to determine availability; the prior /agentmemory/health HTTP probe and its network I/O were removed.

Changes

Hermes Health Check Optimization

Layer / File(s) Summary
URL syntactic validation tightened
integrations/hermes/__init__.py
_validate_url now requires a non-empty URL, a parseable port (no ValueError), an http/https scheme, and a hostname.
Availability check avoids network I/O
integrations/hermes/__init__.py
AgentMemoryProvider.is_available() returns _validate_url(AGENTMEMORY_URL or DEFAULT_BASE_URL) and no longer issues the /agentmemory/health request.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I am a rabbit checking the burrow's gate,
No knocking on doors or a far-off wait,
I parse the address, the scheme and the port,
A quick hop of logic—no network report,
Safe, swift, and local, the check is complete. 🐇✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(hermes): is_available() must not do network calls' clearly and specifically summarizes the main change: refactoring is_available() to eliminate network calls.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@integrations/hermes/__init__.py`:
- Line 172: The _validate_url function currently accepts bare schemes like
"http://" and causes is_available() to return true for invalid endpoints; update
_validate_url to parse the URL (e.g., via urllib.parse.urlparse), require
parsed.scheme be 'http' or 'https' and require a non-empty parsed.hostname (or
parsed.netloc) so URLs like "http://" are rejected; modify _validate_url
accordingly and leave is_available() logic intact so only URLs with a valid host
are considered available.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98dfff1e-99aa-41c2-88da-656feda7664a

📥 Commits

Reviewing files that changed from the base of the PR and between 4b354b7 and 383bb24.

📒 Files selected for processing (1)
  • integrations/hermes/__init__.py

Comment thread integrations/hermes/__init__.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant