-
Notifications
You must be signed in to change notification settings - Fork 5.3k
chore: update agent secrets when they are empty with local vars #5329
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
base: develop
Are you sure you want to change the base?
chore: update agent secrets when they are empty with local vars #5329
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 ✨ Finishing Touches🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
364d4d7
to
14903da
Compare
Summary
Add automatic synchronization of secrets from local
.env
file for characters that don't have secrets configured.Context
When characters are stored in the database or loaded from files, they often lack secrets for security reasons. However, agents need these secrets (API keys, tokens, etc.) to function properly. This change implements an automatic fallback mechanism.
Problem
Solution
Implemented automatic secret synchronization that:
.env
fileTechnical Details
New Functions in
config-utils.ts
:hasCharacterSecrets(character)
- Validates if secrets existensureCharacterSettings(character)
- Ensures settings object existsloadLocalEnvSecrets()
- Loads secrets from.env
filesetDefaultSecretsFromEnv(character)
- Main sync functionIntegration Point:
agent-start.ts
beforeAgentRuntime
creationBenefits
.env
files, not in stored characters.env
)Testing
.env
.env
file → should handle gracefully