-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: bootstrap action/provide format change fix + initPromise fix #6261
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
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
|
Claude finished @odilitime's task —— View job PR Review CompleteTodo List:
Review SummaryThis PR makes two key improvements:
✅ Passes All Critical Checks
💡 Technical AnalysisChange 1: Expose
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Pull request overview
This PR makes two main improvements to the codebase: it exposes the initPromise property in the IAgentRuntime interface to make it available for plugins, and it corrects the usage of deprecated field names by replacing serverId with messageServerId throughout test utilities and refactoring the plugin-bootstrap code to work directly with world objects instead of making redundant database calls.
- Adds
initPromise: Promise<void>to theIAgentRuntimeinterface and updates all mock runtime implementations - Refactors plugin-bootstrap to use
worldIddirectly and access settings from world objects already in memory instead of making additional database queries - Updates test mocks to use
messageServerIdinstead of deprecatedserverIdfield
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/runtime.ts | Adds initPromise property to IAgentRuntime interface |
| packages/test-utils/src/mocks/runtime.ts | Updates mock runtime to include initPromise with override support |
| packages/project-tee-starter/src/tests/utils/core-test-utils.ts | Adds initPromise to mock runtime implementation |
| packages/project-starter/src/tests/utils/core-test-utils.ts | Adds initPromise to mock runtime implementation |
| packages/plugin-starter/src/tests/test-utils.ts | Adds initPromise to mock runtime implementation |
| packages/plugin-quick-starter/src/tests/test-utils.ts | Adds initPromise to mock runtime implementation |
| packages/plugin-bootstrap/src/providers/settings.ts | Refactors to read settings directly from world objects; removes unused getWorldSettings import; fixes apostrophes |
| packages/plugin-bootstrap/src/providers/roles.ts | Changes from using serverId with UUID generation to using worldId directly; removes unused import |
| packages/plugin-bootstrap/src/actions/settings.ts | Updates function signatures and usage to accept worldId instead of serverId; removes unnecessary database calls |
| packages/plugin-bootstrap/src/tests/test-utils.ts | Updates mock objects to use messageServerId instead of deprecated serverId; adds initPromise to mock runtime |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
|
Claude finished @odilitime's task —— View job PR Review CompleteTodo List:
Review SummaryThis PR makes two key improvements:
✅ Passes All Critical Checks
💡 Technical AnalysisChange 1: Expose
|
|
Claude finished @odilitime's task —— View job PR Review CompleteTodo List:
Review SummaryThis PR makes two key improvements:
✅ Passes All Critical Checks
💡 Technical AnalysisChange 1: Expose
|
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.
Bug: Settings saved without encryption causing security issue
The updateWorldSettings function in plugin-bootstrap saves settings directly without encrypting them first. The function assigns world.metadata.settings = worldSettings but the incoming worldSettings parameter has already been decrypted via unsaltWorldSettings. Unlike the core version which calls saltWorldSettings before saving, this implementation stores secret settings in plaintext. The saltWorldSettings import is missing and the encryption step is completely absent, causing sensitive data to be stored unencrypted in the database.
packages/plugin-bootstrap/src/actions/settings.ts#L279-L281
eliza/packages/plugin-bootstrap/src/actions/settings.ts
Lines 279 to 281 in 6088455
| // Update settings state | |
| world.metadata.settings = worldSettings; |
|
Claude finished @odilitime's task —— View job PR Review CompleteTodo List:
Review SummaryThis PR makes two key improvements:
✅ Passes All Critical Checks
💡 Technical AnalysisChange 1: Expose
|
Risks
Low, just fixes
Background
What does this PR do?
What kind of change is this?
Improvements (misc. changes to existing features)
Why are we doing this? Any context or related work?
Why wouldn't we
Documentation changes needed?
My changes do not require a change to the project documentation.
Note
Exposes runtime initPromise and refactors settings/roles to use worldId with salted (encrypted) world settings, updating providers, actions, and tests accordingly.
initPromise: Promise<void>toIAgentRuntime(packages/core/src/types/runtime.ts).actions/settings.ts):serverId/createUniqueUuidusage withworldId.WorldSettingsviagetSalt,saltWorldSettings,unsaltWorldSettings.getWorldSettings/updateWorldSettingsnow operate onworldIdand handle salted settings.worldId.providers/roles.ts: useroom.worldIddirectly; dropcreateUniqueUuid/serverIddependency.providers/settings.ts: read settings from world metadata; decrypt withunsaltWorldSettings(getSalt()); improved onboarding/non-onboarding handling and messages.initPromiseto mock runtimes across test utilities.worldIdandmessageServerId(replacingserverId), and adjust role/settings tests accordingly.Written by Cursor Bugbot for commit 30692e9. This will update automatically on new commits. Configure here.