fix(hermes): apply saved plugin config at runtime#663
Conversation
Signed-off-by: msnandhis <45960035+msnandhis@users.noreply.github.com>
|
@msnandhis is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe Hermes integration resolves AgentMemory base URL and auth secret from preloaded dotenv/env or a saved ~/.hermes/agentmemory.json, stores the resolved secret on the provider instance, and forwards that secret into all synchronous and background API calls; tests validate resolution, override, HTTPS guard, and malformed-config fallback. ChangesHermes saved config resolution and secret propagation
Sequence Diagram(s)sequenceDiagram
participant Client as Hermes Client
participant Provider as AgentMemoryProvider
participant EnvVars as Environment / preloaded dotenv
participant ConfigFile as ~/.hermes/agentmemory.json
participant API as _api/_api_bg
participant Server as AgentMemory Server
Client->>Provider: initialize()
Provider->>EnvVars: check AGENTMEMORY_URL/SECRET
alt env vars/dotenv present
EnvVars-->>Provider: env/dotenv values
else env vars absent
Provider->>ConfigFile: read agentmemory.json
ConfigFile-->>Provider: saved url + secret (if valid)
end
Provider->>Provider: store resolved _base and self._secret
Provider->>Provider: apply HTTPS/plaintext guard using self._secret
Provider->>API: _api(endpoint, secret=self._secret)
API->>Server: HTTP request with Authorization header (if secret present)
Server-->>API: response
API-->>Provider: return result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
There was a problem hiding this comment.
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`:
- Around line 228-231: is_available() currently calls _resolve_base_url() which
reads the process HOME and ignores the provider's saved hermes home; update
is_available() to honor the provider's saved value (self._hermes_home) by
passing it into the resolver or by resolving the base URL using
self._hermes_home before calling _validate_url; reference the methods
is_available, _resolve_base_url, save_config and initialize and ensure the same
hermes_home used by initialize/save_config is used for the availability check.
🪄 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: 884554dc-186b-4c29-a99d-f8439d48000b
📒 Files selected for processing (2)
integrations/hermes/__init__.pytest/integration-plaintext-http.test.ts
Signed-off-by: msnandhis <45960035+msnandhis@users.noreply.github.com>
Summary
agentmemory.jsonconfig when the provider initializesFixes #658.
Validation
python3 -m py_compile integrations/hermes/__init__.pynpm test -- test/integration-plaintext-http.test.ts test/hermes-plugin.test.tsnpm run buildnpm testgit diff --checkSummary by CodeRabbit
New Features
Improvements
Tests