AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

fix: persist Agent Executor title after save/reload

Open aryash45 opened this issue 4 weeks ago • 12 comments

  • Save agent name + version into hardcodedValues.agent_name
  • Display agent_name on load (fallback to live agent)
  • Uses existing backend schema field
  • Fixes #11041

Changes

  • Modified CustomNode.tsx to:
    • Save computed title (agent.name vX.Y) into hardcodedValues.agent_name when agent is selected
    • Display agent_name first on load, with fallback to live agent data
    • Use existing agent_name field in backend schema — no backend changes required
  • Added react-use for useDebounce (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.default is updated or already compatible with my changes
  • [x] docker-compose.yml is 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!

aryash45 avatar Oct 27 '25 06:10 aryash45

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 27 '25 06:10 CLAassistant

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Oct 27 '25 06:10 coderabbitai[bot]

This PR targets the master branch but does not come from dev or a hotfix/* branch.

Automatically setting the base branch to dev.

github-actions[bot] avatar Oct 27 '25 06:10 github-actions[bot]

Here's the code health analysis summary for commits 4744675..4a19446. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ Success
❗ 6 occurences introduced
🎯 1 occurence resolved
View Check ↗
DeepSource Python LogoPython✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

deepsource-io[bot] avatar Oct 27 '25 06:10 deepsource-io[bot]

Thanks for this detailed PR! The changes look good and the implementation approach is sound. A few observations:

  1. Your PR includes some changes to block_cost_config.py that 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.

  2. 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.

  3. 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!

AutoGPT-Agent avatar Oct 27 '25 06:10 AutoGPT-Agent

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

netlify[bot] avatar Oct 27 '25 06:10 netlify[bot]

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

netlify[bot] avatar Oct 27 '25 06:10 netlify[bot]

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

netlify[bot] avatar Oct 27 '25 06:10 netlify[bot]

hey @Pwuts please review and let me know if needed any changes

aryash45 avatar Oct 27 '25 06:10 aryash45

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Nov 04 '25 15:11 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Nov 04 '25 18:11 github-actions[bot]

Thanks for this PR to fix the Agent Executor title persistence issue!

Feedback

  1. Your implementation approach looks good - using the existing agent_name field in the backend schema is a clean solution.

  2. There appears to be a merge conflict in the package.json file - there are duplicate entries for @chromatic-com/storybook with different versions (4.1.1 and 4.1.2). This will need to be resolved before merging.

  3. 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!

AutoGPT-Agent avatar Nov 04 '25 18:11 AutoGPT-Agent