Skip to content
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

fix(platform): Fields with default value are not set to advanced by default #9128

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

majdyz
Copy link
Contributor

@majdyz majdyz commented Dec 25, 2024

#8739 causes input fields that are supposed to be an advanced field end up being a mandatory field:

image

*See the retry count field here.

Changes 🏗️

Set the advanced field on each input field, and set the default value using this logic:

  • If it has a default value, set it to True.
  • otherwise, False.

Checklist 📋

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • ...
Example test plan
  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

For configuration changes:

  • .env.example is updated or already compatible with my changes
  • docker-compose.yml is updated or already compatible with my changes
  • I have included a list of my configuration changes in the PR description (under Changes)
Examples of configuration changes
  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

@majdyz majdyz requested review from kcze and Abhi1992002 December 25, 2024 22:26
@majdyz majdyz requested a review from a team as a code owner December 25, 2024 22:26
@majdyz majdyz requested review from ntindle and removed request for a team December 25, 2024 22:26
@github-actions github-actions bot added the platform/backend AutoGPT Platform - Back end label Dec 25, 2024
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

8739 - Partially compliant

Compliant requirements:

  • Fix issue where input fields that should be advanced are showing as mandatory

Non-compliant requirements:

  • Hide "advanced" toggle on blocks if there are no advanced inputs

Requires further human verification:

  • Verify in UI that advanced toggle is properly hidden when no advanced inputs exist
  • Verify that fields with default values are correctly marked as advanced in the UI
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Logic Validation

Verify that the new advanced field logic correctly handles all edge cases, especially when both default and default_factory are provided

if default is PydanticUndefined and default_factory is None:
    if advanced:
        raise ValueError("Advanced fields must have a default value.")
    advanced = False
elif advanced is None:
    advanced = True

Copy link

netlify bot commented Dec 25, 2024

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
🔨 Latest commit 4d66687
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs-dev/deploys/676d7a83dc6e9d00084c5970

Copy link

netlify bot commented Dec 25, 2024

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 4d66687
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/676d7a835db15e00088afe64

@majdyz majdyz enabled auto-merge December 26, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant