feat: add KeeperHub action provider - #1504
Open
scientivan wants to merge 2 commits into
Open
scientivan wants to merge 2 commits into
scientivan wants to merge 2 commits into
Conversation
🟡 Heimdall Review Status
|
MVPuknowme
approved these changes
Sep 18, 2026
|
Review Error for MVPuknowme @ 2026-09-18 06:48:21 UTC |
Author
|
Pushed a follow-up: status reads now retry (timeout, network error, 429, 5xx) behind an enforced deadline, and a 409 "already being processed" is retried with the same key. Also added an LLM agent run through |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
keeperhubaction provider that routes transfers through KeeperHub instead of signing them with the local wallet. Two actions:transfer: simulates through KeeperHub and aborts before broadcast if the simulation predicts a revert, then executes once under an idempotency key derived from ataskIdplus the fields that decide the onchain effect. Returns anexecutionId.get_execution_status: answers "did the money move?" for anexecutionId, with receipts re-read from chain (succeeded, reverted, or not yet known).Why: when a transfer is broadcast but the confirmation is lost,
erc20.transferreturnsError transferring the asset: ${error}with no identifier to ask about again, so the agent cannot tell "never sent" from "sent, answer lost", and a retry pays twice. This is the situation described in #1483. With this provider, retrying the sametaskIdis replayed rather than resent, and the outcome can always be asked for.Design notes:
simulateflag.simulate: trueis written by code, so it cannot be switched off through input.KEEPERHUB_API_KEYis read from the environment whenapiKeyis not passed. No new dependencies.get_execution_statusretries on timeout, network error, 429 and 5xx behind a deadline that holds even if fetch ignores its abort signal; with no answer it reports "not yet known", never "failed". A transfer answered with 409 "already being processed" is retried with the same key.Measured on Base Sepolia with
eth_getTransactionReceiptrejected on purpose, 100 trials per arm, against@coinbase/agentkit@0.10.4: outcome determinable 0/100 viaerc20.transfervs 99/100 via this provider; duplicate transfers 47/47 vs 0/100. Method, raw attempts and every transaction hash: https://github.com/scientivan/resi (the same code is published standalone asagentkit-keeperhubon npm).Tests
29 unit tests in
keeperhub/(fetch is faked, so the real client runs: headers, body shape, response parsing), plus lint and typecheck:LLM agent run on Base Sepolia, through
AgentKit.getActions()(Gemini function calling; source: https://github.com/scientivan/resi/blob/main/harness/scripts/agent-demo.ts). The first transfer executes, but its response is replaced with a timeout before the model sees it:Direct script run on Base Sepolia: a script calls the actions directly with a
CdpEvmWalletProvider(source: https://github.com/scientivan/resi/blob/main/harness/scripts/demo.ts).Checklist