mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
## Why `AgentInputBlock` has a `placeholder_values` field whose `generate_schema()` converts it into a JSON schema `enum`. The frontend renders any field with `enum` as a dropdown/select. This means AI-generated agents that populate `placeholder_values` with example values (e.g. URLs) on regular `AgentInputBlock` nodes end up with dropdowns instead of free-text inputs — users can't type custom values. Only `AgentDropdownInputBlock` should produce dropdown behavior. ## What - Removed `placeholder_values` field from `AgentInputBlock.Input` - Moved the `enum` generation logic to `AgentDropdownInputBlock.Input.generate_schema()` - Cleaned up test data for non-dropdown input blocks - Updated copilot agent generation guide to stop suggesting `placeholder_values` for `AgentInputBlock` ## How The base `AgentInputBlock.Input.generate_schema()` no longer converts `placeholder_values` → `enum`. Only `AgentDropdownInputBlock.Input` defines `placeholder_values` and overrides `generate_schema()` to produce the `enum`. **Backward compatibility**: Existing agents with `placeholder_values` on `AgentInputBlock` nodes load fine — `model_construct()` silently ignores extra fields not defined on the model. Those inputs will now render as text fields (desired behavior). ## Test plan - [x] `poetry run pytest backend/blocks/test/test_block.py -xvs` — all block tests pass - [x] `poetry run format && poetry run lint` — clean - [ ] Import an agent JSON with `placeholder_values` on an `AgentInputBlock` — verify it loads and renders as text input - [ ] Create an agent with `AgentDropdownInputBlock` — verify dropdown still works