-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EVM Plugin can't run any action #735
Comments
This happens when the Agent is run outside of a browser in a node environment, I have actually been messing with the code and have basic operations working. This happens because private key wallets don't require the wallet_switchEthereumChain RPC which DeFi apps use in the browser. If one of the maintainers wants to let me know the intent here I could probably contribute this back upstream. I am thinking it might be neat to add some settings that allow for it to be switchable between node/browser. |
Made some changes in a branch on my fork here in case anyone wants to do some copy-pasta: https://github.com/yourbuddyconner/eliza/tree/conner/evm/packages/plugin-evm/src I properly set up the LiFi SDK as well as arbitrary ERC20 operations. |
Hey @yourbuddyconner Your changes don't solve the problem for the transfer and bridge actions which still assume that options will automagically include all the needed params. Seems like you fixed swap and the ones you added do correctly aim to extract the parameters from the message, which is what all the actions should do. Maybe you can fix transfer and bridge too and submit a PR? I have a few comments on the changes but easier to do that on a PR. |
I can look into that this weekend! |
wait, how do you run this in browser, I done see any info on running this AI in browser, just CLI |
Using CLI, I cant even get this action to fire and it says its loaded. All I get is any help? |
@n00b21337 What is your use-case for running in a browser? I can't imagine why I would do that atm... |
@0xaguspunk -- I added basic working (CLI) functionality to a draft PR here: #952 I only got it to the point where my basic cli tests worked ("send yourself 0.001 ETH on sepolia", "bridge 0.001 ETH from ethereum to base") This is a bridge tx initiated by my local agent with this code: https://etherscan.io/tx/0x17405e4caf0b93d8eddbd2c3c9f3dc0d7158225ef261f74a304fe178fc3285d8 Needs test coverage, and generally more guidance from the maintainers/users RE: what they'd like to see here (it does what I need it to do right now). |
because you said so I was assuming I am doing something wrong as I cant get my agent to run any wallet actions, so thought maybe I need to run it in browser env somehow ?! :) guess its not that. |
what i realized now is that default trump char and all of his lore and knowledge made him somehow not even check the Actions, he would just ignore them, when I deleted it all now I at least get the regular "TypeError: Cannot read properties of undefined (reading 'chainId')"] " which is where most other were I guess. this is some other issue then. at least I know how to debug basic action now. |
Yeah testing actions with the default trump setup is a pain in the butt haha
Yes, that error is the one that should be fixed! |
why is that? its interesting he skips them even if perfectly "matched" with keywords. he doesn't even try, just says no match and tries to match with some knowledge... seems like something is bad with setup then? |
when I removed knowledge from trump file, then wallet works, somehow knowledge "trumps" actions |
From what I see there are many problems with the transfer code. First, there is no processing of content in transfer.ts so it can get any parameters. Something like this is needed
|
hey @n00b21337! i see we're working on the same plugin, what do you think about the fix in the pr above^ #864 |
ohh I missed it, let me check. thnx for tip |
Facing error when revoking swap_token action: ◎ LOGS ["✓ Normalized action: swaptokens"] ["ℹ Executing handler for action: swap"] Swap action handler called |
Part of character.json file: { |
Describe the bug
The EVM Plugin actions do not work, they probably never worked.
The code assumes that the options object passed to the handler of the action has all the parameters of the action parsed automagically. It's assuming a tool calling pattern like the one AI SDK offers.
To Reproduce
EVM_PUBLIC_KEY
and anEVM_PRIVATE_KEY
to run the evmPluginplugin-evm
withpnpm build
Transfer 1 ETH to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
["⛔ TypeError: Cannot read properties of undefined (reading 'chainId')"]
You can also add a
console.log
when transfer is called with the params and you will see the content is empty.Expected behavior
Agent should fail because transaction failed.
Screenshots
The text was updated successfully, but these errors were encountered: