Skip to content

fix: 4337/session tools resolve custom chains (base-sepolia) — unblocks the live loop#80

Merged
ceoguy merged 2 commits into
mainfrom
fix/4337-custom-chains
Jun 11, 2026
Merged

fix: 4337/session tools resolve custom chains (base-sepolia) — unblocks the live loop#80
ceoguy merged 2 commits into
mainfrom
fix/4337-custom-chains

Conversation

@ceoguy

@ceoguy ceoguy commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The new session/4337/userOpHash tools used the built-in-only resolveChain, so a registered testnet like base-sepolia wouldn't resolve — which would block the v1.21 live verification loop. Switched to resolveChainWithCustom / rpcEndpointsWithCustom (the same helpers the EVM agent-wallet tools already use). 3 files, 428 tests, 8/8 layers.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Refactor
    • Updated chain and RPC endpoint resolution to support custom chain configurations across account abstraction tools.
    • Improved error messages now provide guidance on registering custom chains when resolution fails.

…ase-sepolia) — required for the live testnet loop

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ceoguy, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes and 39 seconds. Learn how PR review limits work.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5bc8983a-0381-4519-96b3-fe5e302f765e

📥 Commits

Reviewing files that changed from the base of the PR and between 3e3972f and 10e73e1.

⛔ Files ignored due to path filters (1)
  • docs/social/og-card.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • docs/social/og-card.html

Walkthrough

This PR migrates three ERC-4337 tool files from standard chain resolution to custom-chain resolution helpers, enabling support for user-registered custom chains. Each file replaces resolveChain/rpcEndpoints with resolveChainWithCustom/rpcEndpointsWithCustom, with updated error messages and consistent behavior preservation.

Changes

Custom Chain Resolution Migration

Layer / File(s) Summary
Core chain resolution helper update
mcp-server/src/tools/aa.ts
Import resolveChainWithCustom and update chainIdFor to call the custom resolver with an error message suggesting custom chain registration.
RPC configuration integration
mcp-server/src/tools/aa_sessions.ts
Import and apply resolveChainWithCustom and rpcEndpointsWithCustom in chainRpcs to derive chain and RPC data for session handling.
Agent wallet chain resolution
mcp-server/src/tools/agent_wallet_4337.ts
Import custom helpers and use resolveChainWithCustom in the account kind preparation path to resolve chains and RPC endpoints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Custom chains are on the way,
Three files dance in sync today,
Resolvers swap with graceful care,
Custom chains now everywhere!

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 and specifically identifies the main change: updating 4337/session tools to resolve custom chains like base-sepolia, which directly addresses the core purpose of the changeset across all three modified files.
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.
Api Keys ✅ Passed No literal API keys detected in the modified files. The PR only changes chain resolution imports and function calls without introducing any hardcoded credentials, passwords, tokens, or secrets.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/4337-custom-chains

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.

…L source)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ceoguy ceoguy merged commit 46f485c into main Jun 11, 2026
13 checks passed
@ceoguy ceoguy deleted the fix/4337-custom-chains branch June 11, 2026 06:52
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