-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Add environment variable support for AI agent configuration #2956
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
feat: Add environment variable support for AI agent configuration #2956
Conversation
This commit adds support for configuring the AI agent via environment variables, following the same pattern used for other dashboard configurations. Two configuration methods are supported: 1. Full JSON configuration via PARSE_DASHBOARD_AGENT_CONFIG - Allows complex multi-model setups - Accepts a JSON string with the complete agent configuration 2. Individual environment variables for simple single-model setups: - PARSE_DASHBOARD_AGENT_MODEL_NAME - PARSE_DASHBOARD_AGENT_MODEL_PROVIDER - PARSE_DASHBOARD_AGENT_MODEL - PARSE_DASHBOARD_AGENT_API_KEY This enhancement makes it easier to deploy Parse Dashboard in containerized environments and improves security by allowing API keys to be stored as environment variables rather than in configuration files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🚀 Thanks for opening this pull request! |
📝 WalkthroughWalkthroughThe change adds support for an Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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 (
|
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
README.md (1)
1313-1338
: Excellent documentation with minor formatting improvement needed.The AI agent environment variable documentation is comprehensive and well-structured. The two configuration methods are clearly explained with practical examples, and the precedence rules are clearly stated.
Consider adding language specification to the fenced code blocks for better syntax highlighting:
-``` +```bash PARSE_DASHBOARD_AGENT_CONFIG='{"models":[{"name":"ChatGPT 4.1","provider":"openai","model":"gpt-4.1","apiKey":"YOUR_API_KEY"}]}'-
+
bash
PARSE_DASHBOARD_AGENT_MODEL_NAME="ChatGPT 4.1"
PARSE_DASHBOARD_AGENT_MODEL_PROVIDER="openai"
PARSE_DASHBOARD_AGENT_MODEL="gpt-4.1"
PARSE_DASHBOARD_AGENT_API_KEY="YOUR_API_KEY"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Parse-Dashboard/server.js
(2 hunks)README.md
(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
README.md (1)
Learnt from: mtrezza
PR: parse-community/parse-dashboard#0
File: :0-0
Timestamp: 2025-05-11T16:43:27.354Z
Learning: The bcryptjs library is used in Parse Dashboard for password encryption and validation in three files: Parse-Dashboard/Authentication.js (compareSync), Parse-Dashboard/CLI/mfa.js (genSaltSync, hashSync), and src/dashboard/Settings/DashboardSettings/DashboardSettings.react.js (genSaltSync, hashSync).
🪛 markdownlint-cli2 (0.17.2)
README.md
1321-1321: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
1329-1329: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🔇 Additional comments (3)
README.md (1)
216-221
: Clear and comprehensive environment variable documentation.The new AI agent environment variables are well-documented and follow the established documentation pattern. The variable names are descriptive and the comments provide helpful context for both simple and complex configuration approaches.
Parse-Dashboard/server.js (2)
42-46
: LGTM! Consistent variable declarations.The new agent configuration variables follow the established pattern and naming conventions. The precedence of CLI options over environment variables is correctly maintained.
91-108
: Excellent implementation with proper error handling.The agent configuration logic is well-implemented with several strong points:
- Proper precedence: JSON config takes priority over individual variables
- Robust error handling for JSON parsing with clear error messages
- Validation that all required individual parameters are present
- Clean object construction following the expected schema
- Appropriate placement within the CLI configuration path
The implementation correctly matches the behavior documented in the README.
The agent configuration is designed to support multiple models, so having individual environment variables for a single model doesn't align with the feature's multi-model design. This commit keeps only PARSE_DASHBOARD_AGENT_CONFIG which accepts a JSON string with the full agent configuration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
README.md (1)
1309-1320
: Specify a language for the fenced code block and show the single-var example
markdownlint
flags this snippet because the fenced block lacks a language identifier (MD040).
Addingbash
(orenv
) improves readability and lint compliance, and you could append the individual-variable example for completeness.-``` +```bash PARSE_DASHBOARD_AGENT_CONFIG='{"models":[{"name":"ChatGPT 4.1","provider":"openai","model":"gpt-4.1","apiKey":"YOUR_API_KEY"}]}' ```bash +# Alternatively for a single-model setup: +export PARSE_DASHBOARD_AGENT_MODEL_NAME="ChatGPT 4.1" +export PARSE_DASHBOARD_AGENT_MODEL_PROVIDER="openai" +export PARSE_DASHBOARD_AGENT_MODEL="gpt-4.1" +export PARSE_DASHBOARD_AGENT_API_KEY="YOUR_API_KEY" +```
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Parse-Dashboard/server.js
(2 hunks)README.md
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- Parse-Dashboard/server.js
🧰 Additional context used
🧠 Learnings (1)
README.md (1)
Learnt from: mtrezza
PR: parse-community/parse-dashboard#0
File: :0-0
Timestamp: 2025-05-11T16:43:27.354Z
Learning: The bcryptjs library is used in Parse Dashboard for password encryption and validation in three files: Parse-Dashboard/Authentication.js (compareSync), Parse-Dashboard/CLI/mfa.js (genSaltSync, hashSync), and src/dashboard/Settings/DashboardSettings/DashboardSettings.react.js (genSaltSync, hashSync).
🪛 markdownlint-cli2 (0.17.2)
README.md
1315-1315: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
- Change configAgentConfig to configAgent for naming consistency - Handle both JS config objects and JSON strings properly - Remove separate env var chapter, integrate into existing table - Add environment variable column to AI Agent configuration table 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove the Environment Variable column from the AI Agent config table - Keep environment variable information as a note below the table - Properly align table columns for better readability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Adjust column widths for better visual consistency and readability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
# [7.3.0-alpha.44](7.3.0-alpha.43...7.3.0-alpha.44) (2025-07-31) ### Features * Add environment variable support for AI agent configuration ([#2956](#2956)) ([2ac9e7e](2ac9e7e))
🎉 This change has been released in version 7.3.0-alpha.44 |
# [7.3.0](7.2.1...7.3.0) (2025-08-01) ### Bug Fixes * Changing "Relative dates" option of saved filter does not enable save button ([#2947](#2947)) ([4f4977d](4f4977d)) * Class object counters in sidebar not updating ([#2950](#2950)) ([0f1920b](0f1920b)) * Clicking linked pointer with Cmd key in view table doesn't open page in new browser tab ([#2902](#2902)) ([101b194](101b194)) * Fails to generate MFA code with CLI command `parse-dashboard --createMFA` ([#2883](#2883)) ([544df1f](544df1f)) * Gracefully fail when trying to get new features in latest version of dashboard ([#2880](#2880)) ([1969a0e](1969a0e)) * Header checkbox in data browser does not indicate when a few rows are selected ([#2957](#2957)) ([e4ab666](e4ab666)) * Hyperlink in Views table ignores `urlQuery` key ([#2926](#2926)) ([c5eedf4](c5eedf4)) * Incorrect table cell width in App Settings table ([#2933](#2933)) ([d46765b](d46765b)) * Info panel scroll-to-top setting not persistent across dashboard sessions ([#2938](#2938)) ([2b78087](2b78087)) * Invalid clipboard content for multi-cell copy in data browser ([#2882](#2882)) ([22a2065](22a2065)) * Legacy filters without `filterId` cannot be deleted in data browser ([#2946](#2946)) ([65df9d6](65df9d6)) * Legacy filters without `filterId` do not appear in sidebar ([#2945](#2945)) ([fde3769](fde3769)) * Modal text input can be resized smaller than its cell in Safari browser ([#2930](#2930)) ([82a0cdc](82a0cdc)) * Move settings button on data browser toolbar for better UI ([#2940](#2940)) ([c473ce6](c473ce6)) * Pagination footer bar hides rows in data browser ([#2879](#2879)) ([6bc2da8](6bc2da8)) * Race condition on info panel request shows info panel data not corresponding to selected cell ([#2909](#2909)) ([6f45bb3](6f45bb3)) * Saved legacy filter in data browser cannot be deleted or cloned ([#2944](#2944)) ([15da90d](15da90d)) * Saved legacy filter with classname in query cannot be deleted ([#2948](#2948)) ([05ee5b3](05ee5b3)) * Selected text in info panel cannot be copied using Ctrl+C ([#2951](#2951)) ([0164c19](0164c19)) * Views not sorted alphabetically in sidebar ([#2943](#2943)) ([4c81fe4](4c81fe4)) * Warning dialog is shown after executing script on selected rows ([#2899](#2899)) ([027f1ed](027f1ed)) ### Features * Add additional values in info panel key-value element ([#2904](#2904)) ([a8f110e](a8f110e)) * Add AI agent for natural language interaction with Parse Server ([#2954](#2954)) ([32bd6e8](32bd6e8)) * Add clipboard icon to copy value of key-value element in info panel ([#2871](#2871)) ([7862c42](7862c42)) * Add Cloud Function as data source for views with optional text or file upload ([#2939](#2939)) ([f5831c7](f5831c7)) * Add column freezing in data browser ([#2877](#2877)) ([29f4a88](29f4a88)) * Add custom data views with aggregation query ([#2888](#2888)) ([b1679db](b1679db)) * Add environment variable support for AI agent configuration ([#2956](#2956)) ([2ac9e7e](2ac9e7e)) * Add hyperlink support in Views table ([#2925](#2925)) ([06cfc11](06cfc11)) * Add inclusive date filters "is on or after", "is on or before" in data browser ([#2929](#2929)) ([c8d621b](c8d621b)) * Add quick-add button to array parameter in Cloud Config ([#2866](#2866)) ([e98ccb2](e98ccb2)) * Add row number column to data browser ([#2878](#2878)) ([c0aa407](c0aa407)) * Add Settings menu to scroll info panel to top when browsing through rows ([#2937](#2937)) ([f339cb8](f339cb8)) * Add support for "not equal to" filter for Boolean values in data browser and analytics explorer ([#2914](#2914)) ([d55b89c](d55b89c)) * Add support for `Image` type in View table to display images ([#2952](#2952)) ([6a6b1f0](6a6b1f0)) * Add type mismatch warning when quick-adding entry to Cloud Config array parameter ([#2875](#2875)) ([bb1837f](bb1837f)) * Add view edit icon to views list in sidebar ([#2901](#2901)) ([96e33b9](96e33b9)) * Allow editing filter without loading data in data browser ([#2949](#2949)) ([9623580](9623580)) * Allow editing saved filters in data browser ([#2942](#2942)) ([daaccaa](daaccaa)) * Allow freeform text view resizing in modal dialogs ([#2910](#2910)) ([1399162](1399162)) * Persist info panel visibility when navigating across classes in data browser ([#2908](#2908)) ([1a3610a](1a3610a)) * Prefetch info panel data with config options `prefetchObjects` and `prefetchStale` ([#2915](#2915)) ([54a8156](54a8156)) * Warn when leaving data browser page with selected rows ([#2887](#2887)) ([206ead1](206ead1)) ### Performance Improvements * Add config option `enableResourceCache` to cache dashboard resources locally for faster loading in additional browser tabs ([#2920](#2920)) ([41a4963](41a4963))
* release: (124 commits) chore(release): 7.3.0 [skip ci] empty commit to trigger CI refactor: Bump prettier from 3.5.3 to 3.6.2 (parse-community#2955) chore(release): 7.3.0-alpha.44 [skip ci] feat: Add environment variable support for AI agent configuration (parse-community#2956) chore(release): 7.3.0-alpha.43 [skip ci] fix: Header checkbox in data browser does not indicate when a few rows are selected (parse-community#2957) refactor: Bump jest-environment-jsdom from 30.0.4 to 30.0.5 (parse-community#2941) chore(release): 7.3.0-alpha.42 [skip ci] feat: Add AI agent for natural language interaction with Parse Server (parse-community#2954) chore(release): 7.3.0-alpha.41 [skip ci] feat: Add support for `Image` type in View table to display images (parse-community#2952) chore(release): 7.3.0-alpha.40 [skip ci] fix: Selected text in info panel cannot be copied using Ctrl+C (parse-community#2951) chore(release): 7.3.0-alpha.39 [skip ci] fix: Class object counters in sidebar not updating (parse-community#2950) chore(release): 7.3.0-alpha.38 [skip ci] feat: Allow editing filter without loading data in data browser (parse-community#2949) chore(release): 7.3.0-alpha.37 [skip ci] fix: Saved legacy filter with classname in query cannot be deleted (parse-community#2948) ...
Summary
PARSE_DASHBOARD_AGENT_CONFIG
Motivation
The AI agent feature currently only supports configuration through the JSON config file. This PR adds environment variable support to:
Implementation Details
Users can provide the complete agent configuration as a JSON string via the
PARSE_DASHBOARD_AGENT_CONFIG
environment variable:PARSE_DASHBOARD_AGENT_CONFIG='{"models":[{"name":"ChatGPT 4.1","provider":"openai","model":"gpt-4.1","apiKey":"YOUR_API_KEY"}]}'
This supports the same multi-model configuration structure as the JSON config file, allowing users to define multiple AI models in the array.
Changes
Parse-Dashboard/server.js
to read agent configuration fromPARSE_DASHBOARD_AGENT_CONFIG
environment variableREADME.md
with documentation for the new environment variable in the AI Agent configuration tablePARSE_DASHBOARD_AGENT_CONFIG
Test plan
PARSE_DASHBOARD_AGENT_CONFIG
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation