-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: Goat Plugin + AWS S3 Service error when env vars absent #985
fix: Goat Plugin + AWS S3 Service error when env vars absent #985
Conversation
- NodePlugin is now only created when all required AWS credentials are present (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_S3_BUCKET) - GoatPlugin is now only created when ALCHEMY_API_KEY is present - Added type annotations for plugins to handle undefined cases These changes prevent unnecessary plugin initialization when required credentials are missing and improve type safety. Issues introduced in: elizaOS#941 and elizaOS#898
Ugh nodePlugin provided a lot of services, we need to fix it by not requiring those. |
it might be wise to split out the AWS S3 into a separate plugin. |
Yes I’ll have to go over the history and see what changed it. It didn’t used to be this way |
I believe this was introduced in PR: #941 |
ok, @odilitime -- I updated the change to load the node plugin (so all the other services can be accessed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently broken on main, it'd be nice to merge this PR to have it fixed :D
let goatPlugin: any | undefined; | ||
if (getSecret(character, "ALCHEMY_API_KEY")) { | ||
goatPlugin = await createGoatPlugin((secret) => | ||
getSecret(character, secret) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: In order to not duplicate the secret check, you could do
let goatPlugin: any | undefined; | |
if (getSecret(character, "ALCHEMY_API_KEY")) { | |
goatPlugin = await createGoatPlugin((secret) => | |
getSecret(character, secret) | |
); | |
} | |
const getGoatPlugin = async () => await createGoatPlugin((secret) => | |
getSecret(character, secret) | |
); |
and then later on line 440 do
getSecret(character, "ALCHEMY_API_KEY") ? getGoatPlugin() : null,
Relates to:
#941 and #898
Errors when running agent were:
TypeError: Cannot read properties of null (reading 'getChain')
Risks
Background
What does this PR do?
What kind of change is this?
Bug fixes (non-breaking change which fixes an issue)
Why are we doing this? Any context or related work?
These changes prevent unnecessary plugin initialization when required credentials are missing and improve type safety.
Issues introduced in: #941 and #898
Documentation changes needed?
none
Testing
Where should a reviewer start?
Detailed testing steps
None, automated tests are fine.
Discord username
@crypto__john