Skip to content

fix(hermes/marmot): accept is_reconnect kwarg in connect()#839

Merged
jgmontoya merged 1 commit into
marmot-protocol:masterfrom
jooray:fix/hermes-connect-is-reconnect
Jul 17, 2026
Merged

fix(hermes/marmot): accept is_reconnect kwarg in connect()#839
jgmontoya merged 1 commit into
marmot-protocol:masterfrom
jooray:fix/hermes-connect-is-reconnect

Conversation

@jooray

@jooray jooray commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #836.

hermes-agent connects platform adapters via await adapter.connect(is_reconnect=...), and the base adapter plus the bundled SimpleX plugin both use the keyword-only signature async def connect(self, *, is_reconnect: bool = False) -> bool. The Marmot adapter's override was async def connect(self), so every connect raised:

✗ marmot error: MarmotPlatformAdapter.connect() got an unexpected keyword argument 'is_reconnect'

and the platform never came up (no socket opened to wn-agent).

This widens the signature to match; the body doesn't need the argument. One line.

Verified on a live deployment: after this change the adapter connects and the platform reaches connected.


Open in Stage

Summary by CodeRabbit

  • Refactor
    • Updated the connection interface to support reconnect scenarios via an optional keyword parameter.
    • Existing connection behavior remains unchanged.
    • Added/expanded adapter tests to verify the new reconnect keyword is accepted and returns expected results for both cold start and reconnect.

@stage-review

stage-review Bot commented Jul 12, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 2 individual chapters for you:

Title
1 Update Marmot adapter connect signature
2 Verify connect signature in tests
Open in Stage

Chapters generated by Stage for commit 9b8a06d on Jul 17, 2026 2:20am UTC.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jgmontoya, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b206c93-20f3-4c7f-993f-5683e9ef74ad

📥 Commits

Reviewing files that changed from the base of the PR and between 8726d80 and 9b8a06d.

📒 Files selected for processing (2)
  • integrations/hermes/marmot/adapter.py
  • integrations/hermes/marmot/tests/test_adapter.py

Walkthrough

The Marmot adapter’s connect method now accepts the keyword-only is_reconnect flag. Test shims and coverage verify successful cold and reconnect calls, listener-task creation, and cleanup.

Changes

Marmot connection compatibility

Layer / File(s) Summary
Update Marmot connect signature and validation
integrations/hermes/marmot/adapter.py, integrations/hermes/marmot/tests/test_adapter.py
MarmotPlatformAdapter.connect accepts the optional keyword-only reconnect flag, while tests cover both flag values and verify connection state and listener cleanup.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: accepting the is_reconnect kwarg in MarmotPlatformAdapter.connect().
Linked Issues check ✅ Passed The PR matches issue #836 by widening connect() to accept is_reconnect and adding a test for the contract.
Out of Scope Changes check ✅ Passed The added test support is directly related to the connect() signature fix and no unrelated changes are apparent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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.

The hermes-agent gateway connects adapters via connect(is_reconnect=...)
on cold boot and reconnect alike, so the override must accept the
keyword-only argument even though wn-agent owns reconnect/resync and the
flag is intentionally unused. Includes a regression test pinning the
gateway calling convention against both the adapter and the base-class
test stub.

Closes marmot-protocol#836

Co-authored-by: Javier G. Montoya S <jgmontoya@pm.me>
@jgmontoya
jgmontoya force-pushed the fix/hermes-connect-is-reconnect branch from 8726d80 to 9b8a06d Compare July 17, 2026 02:20
@jgmontoya
jgmontoya merged commit 609e27d into marmot-protocol:master Jul 17, 2026
1 check passed
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.

Hermes plugin: MarmotPlatformAdapter.connect() missing is_reconnect kwarg → platform never connects

3 participants