AutoGPT
AutoGPT copied to clipboard
fix: persist Agent Executor title after save/reload
- Save agent name + version into
hardcodedValues.agent_name - Display
agent_nameon load (fallback to live agent) - Uses existing backend schema field
- Fixes #11041
Changes
- Modified
CustomNode.tsxto:- Save computed title (
agent.name vX.Y) intohardcodedValues.agent_namewhen agent is selected - Display
agent_namefirst on load, with fallback to live agent data - Use existing
agent_namefield in backend schema — no backend changes required
- Save computed title (
- Added
react-useforuseDebounce(already installed via--legacy-peer-deps)
Why This Change Is Needed
When an Agent Executor block is added and an agent with a version is selected (e.g., Researcher v2.1), the title updates correctly in the UI.
However, after saving the project and reloading, the title reverts to the generic "Agent Executor".
This happens because the title is computed at render time but never persisted in the block’s saved data. This PR fixes it by using the already-existing agent_name field in the backend schema to store and restore the full title.
Checklist
For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [ ] I have tested my changes according to the test plan:
Test Plan (for maintainers):
- [ ] Add Agent Executor block to a new project
- [ ] Select an agent with a version (e.g.,
Researcher v2.1) - [ ] Confirm block title shows
Researcher v2.1 - [ ] Save the project
- [ ] Refresh the page
- [ ] Confirm title still shows
Researcher v2.1 - [ ] (Optional) Edit title manually → save → refresh → should persist
For configuration changes:
- [x]
.env.defaultis updated or already compatible with my changes - [x]
docker-compose.ymlis updated or already compatible with my changes - [x] I have included a list of my configuration changes in the PR description (under Changes)
Note: Could not run full local environment due to dependency conflicts (tailwindcss version mismatch).
However, the fix uses only existing schema fields and follows the exact pattern used elsewhere in the codebase.
Ready for CI & maintainer testing!
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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 @coderabbitai help to get the list of available commands and usage tips.
This PR targets the master branch but does not come from dev or a hotfix/* branch.
Automatically setting the base branch to dev.
Here's the code health analysis summary for commits 4744675..4a19446. View details on DeepSource ↗.
Analysis Summary
| Analyzer | Status | Summary | Link |
|---|---|---|---|
| ✅ Success | ❗ 6 occurences introduced 🎯 1 occurence resolved | View Check ↗ | |
| ✅ Success | View Check ↗ |
💡 If you’re a repository administrator, you can configure the quality gates from the settings.
Thanks for this detailed PR! The changes look good and the implementation approach is sound. A few observations:
-
Your PR includes some changes to
block_cost_config.pythat add new AI video block types and update costs, which seem unrelated to the Agent Executor title persistence issue. While these changes are within our acceptable limits (less than 20% of the PR), it would be better to separate unrelated changes into different PRs in the future. -
The code looks good, but there are a couple of template string issues in the code. You're using single quotes with template syntax like
'${agent.name}'instead of backticks. This would need to be fixed to work correctly. -
I appreciate the detailed test plan even though you couldn't run it locally. This will help the maintainers verify your fix works correctly.
When the template string issues are fixed, this PR should be ready to merge!
Deploy Preview for auto-gpt-docs canceled.
| Name | Link |
|---|---|
| Latest commit | d0e9357825f47ff98663d60369cfa1fcd7c5fab7 |
| Latest deploy log | https://app.netlify.com/projects/auto-gpt-docs/deploys/68ff0ac9993b300008fade8b |
Deploy Preview for auto-gpt-docs-dev canceled.
| Name | Link |
|---|---|
| Latest commit | 4a19446e841a4547334805135752f6fa8f7b5f24 |
| Latest deploy log | https://app.netlify.com/projects/auto-gpt-docs-dev/deploys/690a4a3dd8b8530008023736 |
Deploy Preview for auto-gpt-docs canceled.
| Name | Link |
|---|---|
| Latest commit | 4a19446e841a4547334805135752f6fa8f7b5f24 |
| Latest deploy log | https://app.netlify.com/projects/auto-gpt-docs/deploys/690a4a3dbf3d6f00088ffc7f |
hey @Pwuts please review and let me know if needed any changes
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.
Thanks for this PR to fix the Agent Executor title persistence issue!
Feedback
-
Your implementation approach looks good - using the existing
agent_namefield in the backend schema is a clean solution. -
There appears to be a merge conflict in the
package.jsonfile - there are duplicate entries for@chromatic-com/storybookwith different versions (4.1.1 and 4.1.2). This will need to be resolved before merging. -
While I understand you couldn't test locally due to environment issues, it would be good to get confirmation from maintainers that they've tested according to your test plan before final approval.
Overall, this looks like a solid fix that addresses the issue in a clean way. Just need to resolve that package.json conflict, and we should be good to go!