mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
fix(backend): merge categories with same display name in overview
INPUT and OUTPUT both mapped to "Input/Output", creating duplicate headers. Now tracks emitted display names and appends blocks to existing table instead of creating new header. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -467,13 +467,40 @@ def generate_overview_table(blocks: list[BlockDoc]) -> str:
|
||||
"MARKETING",
|
||||
]
|
||||
|
||||
# Track emitted display names to avoid duplicate headers
|
||||
# (e.g., INPUT and OUTPUT both map to "Input/Output")
|
||||
emitted_display_names: set[str] = set()
|
||||
|
||||
for category in category_order:
|
||||
if category not in by_category:
|
||||
continue
|
||||
|
||||
cat_blocks = sorted(by_category[category], key=lambda b: b.name)
|
||||
display_name = CATEGORY_DISPLAY_NAMES.get(category, category)
|
||||
|
||||
# Collect all blocks for this display name (may span multiple categories)
|
||||
if display_name in emitted_display_names:
|
||||
# Already emitted header, just add rows to existing table
|
||||
# Find the position before the last empty line and insert rows
|
||||
cat_blocks = sorted(by_category[category], key=lambda b: b.name)
|
||||
# Remove the trailing empty line, add rows, then re-add empty line
|
||||
lines.pop()
|
||||
for block in cat_blocks:
|
||||
file_mapping = get_block_file_mapping([block])
|
||||
file_path = list(file_mapping.keys())[0]
|
||||
anchor = generate_anchor(block.name)
|
||||
short_desc = (
|
||||
block.description.split(".")[0]
|
||||
if block.description
|
||||
else "No description"
|
||||
)
|
||||
short_desc = short_desc.replace("\n", " ").replace("|", "\\|")
|
||||
lines.append(f"| [{block.name}]({file_path}#{anchor}) | {short_desc} |")
|
||||
lines.append("")
|
||||
continue
|
||||
|
||||
emitted_display_names.add(display_name)
|
||||
cat_blocks = sorted(by_category[category], key=lambda b: b.name)
|
||||
|
||||
lines.append(f"## {display_name}")
|
||||
lines.append("")
|
||||
lines.append("| Block Name | Description |")
|
||||
|
||||
@@ -516,11 +516,6 @@ Below is a comprehensive list of all available blocks, categorized by their prim
|
||||
| [Exa Webset Webhook](exa/webhook_blocks.md#exa-webset-webhook) | Receive webhook notifications for Exa webset events |
|
||||
| [Generic Webhook Trigger](generic_webhook/triggers.md#generic-webhook-trigger) | This block will output the contents of the generic input for the webhook |
|
||||
| [Read RSS Feed](misc.md#read-rss-feed) | Reads RSS feed entries from a given URL |
|
||||
|
||||
## Input/Output
|
||||
|
||||
| Block Name | Description |
|
||||
|------------|-------------|
|
||||
| [Send Authenticated Web Request](misc.md#send-authenticated-web-request) | Make an authenticated HTTP request with host-scoped credentials (JSON / form / multipart) |
|
||||
| [Send Email](misc.md#send-email) | This block sends an email using the provided SMTP credentials |
|
||||
| [Send Web Request](misc.md#send-web-request) | Make an HTTP request (JSON / form / multipart) |
|
||||
|
||||
Reference in New Issue
Block a user