mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
[SECRT-1896: Fix crazy `GET /api/graphs` latency (P95 = 107s)](https://linear.app/autogpt/issue/SECRT-1896) These changes should decrease latency of this endpoint by ~~60-65%~~ a lot. ### Changes 🏗️ - Make `Graph.credentials_input_schema` cheaper by avoiding constructing a new `BlockSchema` subclass - Strip down `GraphMeta` - drop all computed fields - Replace with either `GraphModel` or `GraphModelWithoutNodes` wherever those computed fields are used - Simplify usage in `list_graphs_paginated` and `fetch_graph_from_store_slug` - Refactor and clarify relationships between the different graph models - Split `BaseGraph` into `GraphBaseMeta` + `BaseGraph` - Strip down `Graph` - move `credentials_input_schema` and `aggregate_credentials_inputs` to `GraphModel` - Refactor to eliminate double `aggregate_credentials_inputs()` call in `credentials_input_schema` call tree - Add `GraphModelWithoutNodes` (similar to current `GraphMeta`) ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] `GET /api/graphs` works as it should - [x] Running a graph succeeds - [x] Adding a sub-agent in the Builder works as it should
35 lines
784 B
Plaintext
35 lines
784 B
Plaintext
{
|
|
"created_at": "2025-09-04T13:37:00",
|
|
"credentials_input_schema": {
|
|
"properties": {},
|
|
"required": [],
|
|
"type": "object"
|
|
},
|
|
"description": "A test graph",
|
|
"forked_from_id": null,
|
|
"forked_from_version": null,
|
|
"has_external_trigger": false,
|
|
"has_human_in_the_loop": false,
|
|
"has_sensitive_action": false,
|
|
"id": "graph-123",
|
|
"input_schema": {
|
|
"properties": {},
|
|
"required": [],
|
|
"type": "object"
|
|
},
|
|
"instructions": null,
|
|
"is_active": true,
|
|
"links": [],
|
|
"name": "Test Graph",
|
|
"nodes": [],
|
|
"output_schema": {
|
|
"properties": {},
|
|
"required": [],
|
|
"type": "object"
|
|
},
|
|
"recommended_schedule_cron": null,
|
|
"sub_graphs": [],
|
|
"trigger_setup_info": null,
|
|
"user_id": "3e53486c-cf57-477e-ba2a-cb02dc828e1a",
|
|
"version": 1
|
|
} |