fix(backend): Reduce GET /api/graphs expense + latency - #11986
Conversation
WalkthroughRefactors graph models into lightweight metadata (GraphMeta/GraphBaseMeta) and full models (GraphModel/GraphModelWithoutNodes); moves credentials/schema construction to on-demand dict building and per-field is_required; updates call sites, DB store APIs, and frontend types; paginated listings return lightweight metadata to reduce per-item computation. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant API as API Server
participant DB as Database
participant GM as GraphModel
participant GMeta as GraphMeta
Note over API,GM: OLD flow (expensive per-graph computation)
Client->>API: GET /api/graphs?page=N
API->>DB: fetch graphs page
DB-->>API: list of graph rows
loop per graph (old)
API->>GM: GM.from_db(row) rgba(66,133,244,0.5)
GM-->>API: GraphModel instance
API->>GM: .meta() rgba(219,68,55,0.5)
GM->>GM: compute credentials_input_schema (expensive)
GM-->>API: meta dict
end
API-->>Client: paginated response
Note over API,GMeta: NEW flow (lighter metadata)
Client->>API: GET /api/graphs?page=N
API->>DB: fetch graphs page
DB-->>API: list of graph rows
loop per graph (new)
API->>GM: GM.from_db(row) rgba(15,157,88,0.5)
GM-->>API: GraphModel instance
API->>GMeta: GMeta.from_db(GM) rgba(15,157,88,0.5)
GMeta-->>API: lightweight meta (deferred credentials)
end
API-->>Client: paginated response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (6)autogpt_platform/backend/**/*.py📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
autogpt_platform/backend/backend/data/**/*.py📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
autogpt_platform/backend/**/*.{py,txt}📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Files:
autogpt_platform/backend/backend/**/*.py📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Files:
autogpt_platform/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
autogpt_platform/**/data/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (5)📓 Common learnings📚 Learning: 2026-02-04T16:50:20.494ZApplied to files:
📚 Learning: 2026-01-19T07:20:23.494ZApplied to files:
📚 Learning: 2026-02-04T16:49:42.476ZApplied to files:
📚 Learning: 2026-02-04T16:50:20.494ZApplied to files:
🧬 Code graph analysis (1)autogpt_platform/backend/backend/data/graph.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (9)
✏️ Tip: You can disable this entire section by setting 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
autogpt_platform/backend/backend/data/graph.py (1)
432-492:⚠️ Potential issue | 🔴 CriticalThree callers of
aggregate_credentials_inputs()unpack a 2-tuple but the method now returns a 3-tuple.The method now returns
dict[str, tuple[field_info, node_pairs, is_required]], but the following callers still unpack only 2 values and will fail withValueError: too many values to unpack:
autogpt_platform/backend/backend/api/features/chat/tools/utils.py:131— dictionary comprehension unpacking(field_info, _node_fields)autogpt_platform/backend/backend/api/features/chat/tools/utils.py:270-273— for loop unpacking(credential_requirements, _node_fields)autogpt_platform/backend/backend/executor/utils.py:376— for loop unpacking(_, compatible_node_fields)Update all three to unpack the new third element (
is_required) or use indexing if the value is not needed.
🧹 Nitpick comments (1)
autogpt_platform/backend/backend/data/graph.py (1)
839-887: Preferdefault_factoryfor mutable schema defaults.Using
{}as a default for schema fields risks shared mutable state.Field(default_factory=dict)is safer and aligns with Pydantic guidance.♻️ Proposed refactor
- input_schema: dict[str, Any] = {} - output_schema: dict[str, Any] = {} - credentials_input_schema: dict[str, Any] = {} + input_schema: dict[str, Any] = Field(default_factory=dict) + output_schema: dict[str, Any] = Field(default_factory=dict) + credentials_input_schema: dict[str, Any] = Field(default_factory=dict)
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
autogpt_platform/backend/backend/data/graph.py
🧰 Additional context used
📓 Path-based instructions (6)
autogpt_platform/backend/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/data/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
All data access in backend requires user ID checks; verify this for any 'data/*.py' changes
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/**/*.{py,txt}
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use
poetry runprefix for all Python commands, including testing, linting, formatting, and migrations
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/**/*.py
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use Prisma ORM for database operations in PostgreSQL with pgvector for embeddings
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Format Python code with
poetry run format
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/data/*.py
📄 CodeRabbit inference engine (AGENTS.md)
For changes touching
data/*.py, validate user ID checks or explain why not needed
Files:
autogpt_platform/backend/backend/data/graph.py
🧠 Learnings (1)
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/**/schema.prisma : Define key database models (User, AgentGraph, AgentGraphExecution, AgentNode, StoreListing) in `schema.prisma`
Applied to files:
autogpt_platform/backend/backend/data/graph.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: types
- GitHub Check: Seer Code Review
- GitHub Check: test (3.11)
- GitHub Check: test (3.13)
- GitHub Check: Check PR Status
- GitHub Check: test (3.12)
🔇 Additional comments (2)
autogpt_platform/backend/backend/data/graph.py (2)
965-968: Nice clarification aboutmeta()validation side effects.The added note makes it clear why exceptions can be raised here and why the
try/exceptis warranted.
368-430: Optional credentials fields still appear as required in the JSON schema.When
is_required=False, fields use(CMI | None, CredentialsField(...)), butCredentialsField()returnsField(...)without settingdefault=None. In Pydantic v2, a field without an explicit default value is required in the schema regardless of its type annotation. This means optional credentials fields will still appear in the schema'srequiredlist, defeating theis_required=Falselogic.Fix: Pass
default=Noneto theFieldreturned byCredentialsField()for optional credentials, or add conditional logic to set the default when the field should be optional.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
autogpt_platform/backend/backend/data/graph.py (1)
993-1002:⚠️ Potential issue | 🟡 MinorPer-graph error handling in
list_graphs_paginatedis a good improvement.Catching exceptions per-graph and continuing prevents a single malformed graph from breaking the entire paginated response.
One thing to consider:
total_count(fromprisma().count()) may not matchlen(graph_models)if some graphs fail processing. The pagination metadata will claim more items exist than are actually returned. This could confuse clients paginating through results (e.g., requesting page 2 when the effective count is lower). This is a minor UX concern and probably acceptable given the alternative (500 errors), but worth documenting or logging the discrepancy.
🧹 Nitpick comments (2)
autogpt_platform/backend/backend/data/graph.py (2)
393-460: Credentials input schema: hand-built JSON schema is correct and well-validated.The direct JSON schema construction avoids the
create_modeloverhead nicely. Thevalidate_credentials_field_schemacall at line 448 is a good safeguard to catch malformed schemas at build time.One minor defensive concern: if
field_info.providerorfield_info.supported_typesis an empty frozenset,providers[0]/cred_types[0]on lines 422/431 would raise anIndexError. In practice these should never be empty, but if you want to be defensive:🛡️ Optional defensive guard
providers = list(field_info.provider) cred_types = list(field_info.supported_types) + if not providers or not cred_types: + logger.error( + f"Empty provider or cred_types for field {agg_field_key} " + f"on graph #{self.id}" + ) + continue + field_schema: dict[str, Any] = {
438-445: Nit:**unpacking indict.update()is redundant.
field_schema.update(**some_dict)is equivalent tofield_schema.update(some_dict)here. The latter is more idiomatic and avoids the unnecessary unpacking step.✏️ Suggested simplification
- field_schema.update( - **field_info.model_dump( - by_alias=True, - exclude_defaults=True, - exclude={"provider", "supported_types"}, # already included above - ) + field_schema.update( + field_info.model_dump( + by_alias=True, + exclude_defaults=True, + exclude={"provider", "supported_types"}, # already included above + ) )
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
autogpt_platform/backend/backend/data/graph.pyautogpt_platform/frontend/src/app/api/openapi.json
🧰 Additional context used
📓 Path-based instructions (6)
autogpt_platform/backend/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/data/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
All data access in backend requires user ID checks; verify this for any 'data/*.py' changes
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/**/*.{py,txt}
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use
poetry runprefix for all Python commands, including testing, linting, formatting, and migrations
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/**/*.py
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use Prisma ORM for database operations in PostgreSQL with pgvector for embeddings
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Format Python code with
poetry run format
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/data/*.py
📄 CodeRabbit inference engine (AGENTS.md)
For changes touching
data/*.py, validate user ID checks or explain why not needed
Files:
autogpt_platform/backend/backend/data/graph.py
🧠 Learnings (5)
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/**/schema.prisma : Define key database models (User, AgentGraph, AgentGraphExecution, AgentNode, StoreListing) in `schema.prisma`
Applied to files:
autogpt_platform/backend/backend/data/graph.pyautogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-01-19T07:20:23.494Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11795
File: autogpt_platform/backend/backend/api/features/chat/tools/utils.py:92-111
Timestamp: 2026-01-19T07:20:23.494Z
Learning: In autogpt_platform/backend/backend/api/features/chat/tools/utils.py, the _serialize_missing_credential function uses next(iter(field_info.provider)) for provider selection. The PR author confirmed this non-deterministic provider selection is acceptable because the function returns both "type" (single, for backward compatibility) and "types" (full array), which achieves the primary goal of deterministic credential type presentation.
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/backend/backend/blocks/**/*.py : Inherit from 'Block' base class with input/output schemas when adding new blocks in backend
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/backend/blocks/*.py : When creating new blocks, inherit from the `Block` base class and define input/output schemas using `BlockSchema`
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:49:56.176Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:49:56.176Z
Learning: Applies to autogpt_platform/**/*agent*graph*.json : Agent Graphs are workflow definitions stored as JSON and executed by the backend
Applied to files:
autogpt_platform/frontend/src/app/api/openapi.json
🧬 Code graph analysis (1)
autogpt_platform/backend/backend/data/graph.py (1)
autogpt_platform/backend/backend/data/model.py (4)
CredentialsMetaInput(496-554)validate_credentials_field_schema(511-535)CredentialsFieldInfo(566-687)combine(576-666)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: types
- GitHub Check: e2e_test
- GitHub Check: test (3.11)
- GitHub Check: test (3.12)
- GitHub Check: test (3.13)
- GitHub Check: Check PR Status
🔇 Additional comments (3)
autogpt_platform/backend/backend/data/graph.py (2)
869-917: GraphMeta refactoring to a lightweight BaseModel looks solid.The separation from
Graphinto a flatBaseModelis a clean approach to avoid recomputing expensive computed fields on serialization. All relevant fields fromGraphModelare properly mapped infrom_graph().Note: this is a breaking API change (removes
nodes,links,sub_graphsfrom theGraphMetaresponse shape). The AI summary confirms the OpenAPI spec was updated accordingly.
462-522:is_requiredaggregation logic is correct.The approach of defaulting
node_required_map.get(node_id, True)(line 517) is a safe conservative choice — if a node ID is somehow missing from the map, it defaults to "required". In practice every node is iterated at lines 480–483 so the default shouldn't be hit.autogpt_platform/frontend/src/app/api/openapi.json (1)
7809-7858: LGTM — GraphMeta schema updates align with the backend refactor.The new required fields and
credentials_input_schemaaddition look consistent for list endpoints.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@autogpt_platform/backend/backend/data/graph.py`:
- Around line 402-432: The code currently assumes field_info.provider and
field_info.supported_types are non-empty and directly uses providers[0] and
cred_types[0]; add a defensive guard before building field_schema: check if
providers or cred_types are empty and either (a) raise a clear ValueError
referencing field_info (e.g., "CredentialsFieldInfo must provide at least one
provider and one supported type") or (b) avoid indexing by only using {"enum":
providers} / {"enum": cred_types} when lists are present and omit the {"const":
...} branch when empty; update the construction around providers/cred_types in
the field_schema block to use these guarded branches so no IndexError can occur.
🧹 Nitpick comments (1)
autogpt_platform/backend/backend/data/graph.py (1)
438-445:dict.update()could silently overwrite schema keys ifCredentialsFieldInfogains new fields.The
field_schema.update(field_info.model_dump(...))call merges arbitrary keys into the hand-built JSON schema. IfCredentialsFieldInfoever gains a field that serializes to"type","properties", or"required", the schema would be silently corrupted. Consider either using a namespaced key or explicitly picking the fields you want to merge.♻️ Safer alternative: explicitly merge known extra keys
- # Add other (optional) field info items - field_schema.update( - field_info.model_dump( - by_alias=True, - exclude_defaults=True, - exclude={"provider", "supported_types"}, # already included above - ) - ) + # Add other (optional) field info items, avoiding collision with schema keys + _SCHEMA_RESERVED = {"type", "properties", "required"} + for k, v in field_info.model_dump( + by_alias=True, + exclude_defaults=True, + exclude={"provider", "supported_types"}, + ).items(): + if k in _SCHEMA_RESERVED: + logger.warning( + f"Skipping reserved key '{k}' from CredentialsFieldInfo " + f"for field '{agg_field_key}'" + ) + continue + field_schema[k] = v
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
autogpt_platform/backend/backend/data/graph.pyautogpt_platform/frontend/src/app/api/openapi.json
🧰 Additional context used
📓 Path-based instructions (6)
autogpt_platform/backend/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/data/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
All data access in backend requires user ID checks; verify this for any 'data/*.py' changes
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/**/*.{py,txt}
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use
poetry runprefix for all Python commands, including testing, linting, formatting, and migrations
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/**/*.py
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use Prisma ORM for database operations in PostgreSQL with pgvector for embeddings
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Format Python code with
poetry run format
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/data/*.py
📄 CodeRabbit inference engine (AGENTS.md)
For changes touching
data/*.py, validate user ID checks or explain why not needed
Files:
autogpt_platform/backend/backend/data/graph.py
🧠 Learnings (5)
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/**/schema.prisma : Define key database models (User, AgentGraph, AgentGraphExecution, AgentNode, StoreListing) in `schema.prisma`
Applied to files:
autogpt_platform/backend/backend/data/graph.pyautogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-01-19T07:20:23.494Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11795
File: autogpt_platform/backend/backend/api/features/chat/tools/utils.py:92-111
Timestamp: 2026-01-19T07:20:23.494Z
Learning: In autogpt_platform/backend/backend/api/features/chat/tools/utils.py, the _serialize_missing_credential function uses next(iter(field_info.provider)) for provider selection. The PR author confirmed this non-deterministic provider selection is acceptable because the function returns both "type" (single, for backward compatibility) and "types" (full array), which achieves the primary goal of deterministic credential type presentation.
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/backend/backend/blocks/**/*.py : Inherit from 'Block' base class with input/output schemas when adding new blocks in backend
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/backend/blocks/*.py : When creating new blocks, inherit from the `Block` base class and define input/output schemas using `BlockSchema`
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:49:56.176Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:49:56.176Z
Learning: Applies to autogpt_platform/**/*agent*graph*.json : Agent Graphs are workflow definitions stored as JSON and executed by the backend
Applied to files:
autogpt_platform/frontend/src/app/api/openapi.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: chromatic
- GitHub Check: e2e_test
- GitHub Check: types
- GitHub Check: Seer Code Review
- GitHub Check: test (3.13)
- GitHub Check: test (3.11)
- GitHub Check: test (3.12)
- GitHub Check: Check PR Status
🔇 Additional comments (5)
autogpt_platform/frontend/src/app/api/openapi.json (1)
7807-7858: Schema update looks good.GraphMeta now includes
credentials_input_schemaand requiresid, which matches the lightweight metadata intent for list endpoints.autogpt_platform/backend/backend/data/graph.py (4)
376-377: LGTM!Tuple unpacking correctly adapted to the new 3-tuple structure, and
is_requiredis appropriately ignored in the same-provider warning logic.
462-522: LGTM!The
is_requiredflag logic is sound: it correctly derives per-node requirement fromcredentials_optional, and theany()aggregation ensures that if any contributing node requires the credential, the aggregated field is marked required. The defensivedefault=Trueinnode_required_map.get()is a reasonable fallback.
993-1002: LGTM!The updated flow correctly materializes
GraphMetaonce per graph item. Thetry/excepterror handling is preserved, and the user ID filter is properly applied in the query (Line 973). This achieves the PR's goal of eliminating redundant schema computation during serialization.
869-917: TheGraphMetadesign is sound and field exclusions are intentional.The removal of
sub_graphsandcreated_atis appropriate for a lightweight metadata model used by list endpoints. Verification confirms:
- No frontend code references these fields from graph meta/list responses
sub_graphsis only used internally where fullGraphModelis fetched separatelycreated_atis not exposed in any API endpoint returningGraphMeta- The store endpoint explicitly declares
GraphMetaas its return type, indicating intentional lightweight response designNo action needed.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
Before: After: Looks like 60-63% less latency so far, 2.5 times faster Update: 400x faster 😎 |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
autogpt_platform/backend/backend/api/features/store/routes.py (1)
279-286:⚠️ Potential issue | 🔴 CriticalUpdate frontend client types: endpoint now returns
GraphModelWithoutNodes, notGraphMeta.The backend endpoint returns
GraphModelWithoutNodes(which includes computed fields likecredentials_input_schema,input_schema,output_schemainherited fromGraphModel, but excludesnodes,links,sub_graphs). However, the frontend client atautogpt_platform/frontend/src/lib/autogpt-server-api/client.ts:458still explicitly types the response asPromise<GraphMeta>, and the frontend type definition forGraphMetaonly includes basic metadata fields, not the computed fields now being returned.This creates a type mismatch:
- Backend:
GraphModelWithoutNodes(has computed fields)- Frontend expectation:
GraphMeta(lacks computed fields)The frontend client type must be updated to match the actual response shape. Additionally, no tests were added for this endpoint change in
routes_test.py.autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsx (1)
329-341:⚠️ Potential issue | 🟠 MajorDragging agent blocks into the canvas will result in empty input/output schemas; add on-demand schema fetching to the drop handler.
The
onDragStarthandler (Lines 329–339) serializeshardcodedValueswithout schemas, and the drop handler inFlow.tsx(Lines 922–970) populates the new node using only the empty schemas fromavailableBlocks(Lines 120–127). Unlike the click path (handleAddBlock, which fetchesinput_schema/output_schemaon-demand viagetV1GetSpecificGraph), the drag path never fetches these schemas. The drop handler must fetch and inject schemas for agent blocks, similar to howhandleAddBlockdoes.Additionally,
handleAddBlock(Line 190) usesuseCallbackin violation of the guideline: do not useuseCallbackoruseMemounless asked to optimize a given function.autogpt_platform/backend/backend/api/features/store/db.py (1)
366-378:⚠️ Potential issue | 🟡 MinorPre-existing:
HTTPExceptionis swallowed by the broadexcept Exception.The
fastapi.HTTPException(status_code=404, ...)raised on line 367 is caught by the blanketexcept Exceptionon line 376 and re-wrapped as a genericDatabaseError. This strips the 404 status code, so callers (and ultimately the API consumer) will get a 500-level error instead.Not introduced by this PR, but since the function was refactored this is a good opportunity to fix it.
Proposed fix
+ except fastapi.HTTPException: + raise except Exception as e: logger.error(f"Error getting agent: {e}") raise DatabaseError("Failed to fetch agent") from e
🤖 Fix all issues with AI agents
In `@autogpt_platform/backend/backend/api/features/store/db.py`:
- Around line 372-374: The ternary dispatch using (GraphModelWithoutNodes if
hide_nodes else GraphModel).from_db(...) is incorrect because from_db is a
staticmethod that always constructs a GraphModel; instead call
GraphModel.from_db(store_listing_version.AgentGraph) and then conditionally call
.hide_nodes() when hide_nodes is true (i.e., assign model =
GraphModel.from_db(...); if hide_nodes: model = model.hide_nodes()); this
ensures you return a GraphModelWithoutNodes-like result when requested while
still using the existing from_db implementation.
In `@autogpt_platform/backend/backend/api/features/store/image_gen.py`:
- Around line 105-111: Docstring for function generate_agent_image_v1
incorrectly references `_GraphBaseMeta`; update the type annotation text to
`GraphBaseMeta` so the docstring matches the actual type name (GraphBaseMeta |
AgentGraph) used in the function signature and comments.
🧹 Nitpick comments (5)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsx (1)
189-218:useCallbackusage on new handler.Coding guidelines state: "Do not use
useCallbackoruseMemounless asked to optimize a given function." SincehandleAddBlockis only passed to inlineonClick,useCallbackisn't necessary here.Proposed change: plain async function
- // Handler to add a block, fetching graph data on-demand for agent blocks - const handleAddBlock = useCallback( - async (block: _Block & { notAvailable: string | null }) => { + // Handler to add a block, fetching graph data on-demand for agent blocks + async function handleAddBlock(block: _Block & { notAvailable: string | null }) { if (block.notAvailable) return; // For agent blocks, fetch the full graph to get schemas if (block.uiType === BlockUIType.AGENT && block.hardcodedValues) { const graphID = block.hardcodedValues.graph_id as string; const graphVersion = block.hardcodedValues.graph_version as number; const graphData = okData( await getV1GetSpecificGraph(graphID, { version: graphVersion }), ); if (graphData) { addBlock(block.id, block.name, { ...block.hardcodedValues, input_schema: graphData.input_schema, output_schema: graphData.output_schema, }); } else { // Fallback: add without schemas (will be incomplete) console.error("Failed to fetch graph data for agent block"); addBlock(block.id, block.name, block.hardcodedValues || {}); } } else { addBlock(block.id, block.name, block.hardcodedValues || {}); } - }, - [addBlock], - ); + }As per coding guidelines: "Do not use
useCallbackoruseMemounless asked to optimize a given function."autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts (2)
20-28: Explicit return type on hook.The coding guidelines for this path state "Do not type hook returns, let TypeScript infer as much as possible." The explicit
: SubAgentUpdateInfo<GraphModel>can be removed — the return object on Lines 170–177 already satisfies the generic, so TypeScript will infer it correctly.Proposed change
export function useSubAgentUpdate( nodeID: string, graphID: string | undefined, graphVersion: number | undefined, currentInputSchema: GraphInputSchema | undefined, currentOutputSchema: GraphOutputSchema | undefined, connections: EdgeLike[], availableGraphs: GraphMetaLike[], -): SubAgentUpdateInfo<GraphModel> { +) {As per coding guidelines: "Do not type hook returns, let TypeScript infer as much as possible."
36-39: Non-null assertion onversionmay hide type issues.
latestGraphInfo.version!uses a non-null assertion. IfGeneratedGraphMetamakesversionoptional (common for fields with backend defaults), this suppresses the type checker. While safe at runtime (undefined > number→false), an explicit guard would be more robust.Suggested fix
const hasUpdate = useMemo(() => { - if (!latestGraphInfo || graphVersion === undefined) return false; - return latestGraphInfo.version! > graphVersion; - }, [latestGraphInfo, graphVersion]); + if (!latestGraphInfo?.version || graphVersion === undefined) return false; + return latestGraphInfo.version > graphVersion; + }, [latestGraphInfo, graphVersion]);autogpt_platform/backend/backend/data/graph.py (2)
415-445: Diamond inheritance works but warrants a brief note for future maintainers.
GraphModel(Graph, GraphMeta)forms a diamond viaGraphBaseMeta. Python's C3 linearization handles this correctly, and Pydantic will resolve field overrides (e.g.,GraphMeta.id: stroverBaseDbModel.id: Optional[str]) in the expected order. The design is sound for the performance goal.One thing to keep in mind: if either branch ever adds conflicting field definitions or validators, the MRO resolution could produce surprises. A brief inline comment noting the intentional diamond might help future readers.
459-460: Minor: destructured_shadows theis_requiredflag — consider naming for clarity.In the warning loop (Lines 459-460), the
is_requiredflag from the 3-tuple is discarded as_. This is fine since it's unused here, but naming it_is_requiredwould signal intentional discard more clearly in a tuple with multiple ignored positions.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (20)
autogpt_platform/backend/backend/api/features/chat/tools/utils.pyautogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/backend/backend/api/features/store/db.pyautogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/api/features/store/routes.pyautogpt_platform/backend/backend/data/graph.pyautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(platform)/build/stores/graphStore.tsautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/api/openapi.jsonautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
✅ Files skipped from review due to trivial changes (1)
- autogpt_platform/frontend/src/app/(platform)/build/stores/graphStore.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- autogpt_platform/backend/backend/api/features/chat/tools/utils.py
🧰 Additional context used
📓 Path-based instructions (20)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/frontend/**/*.{tsx,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/frontend/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/frontend/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
autogpt_platform/frontend/src/**/*.{ts,tsx}: Fully capitalize acronyms in symbols, e.g.graphID,useBackendAPI
Use function declarations (not arrow functions) for components and handlers
Separate render logic (.tsx) from business logic (use*.tshooks)
Use shadcn/ui (Radix UI primitives) with Tailwind CSS styling for UI components
Use Phosphor Icons only for icons
Use ErrorCard for render errors, toast for mutations, and Sentry for exceptions
Use design system components fromsrc/components/(atoms, molecules, organisms)
Never usesrc/components/__legacy__/*components
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}
Use Tailwind CSS only for styling, with design tokens
Do not useuseCallbackoruseMemounless asked to optimize a given function
Never type withanyunless a variable/attribute can ACTUALLY be of any type
autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components asComponentName/ComponentName.tsx+useComponentName.ts+helpers.tsand use design system components fromsrc/components/(atoms, molecules, organisms)
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}and regenerate withpnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local/componentsfolder
Avoid large hooks, abstract logic intohelpers.tsfiles when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not useuseCallbackoruseMemounless asked to optimize a given function
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code usingpnpm format
Never use components fromsrc/components/__legacy__/*
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}
📄 CodeRabbit inference engine (AGENTS.md)
Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/frontend/src/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Do not type hook returns, let Typescript infer as much as possible
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never type with
any, if no types available useunknown
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
autogpt_platform/frontend/src/app/(platform)/**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Put sub-components in local
components/folder within feature directories
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsx
autogpt_platform/frontend/src/**/*.tsx
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Component props should be
type Props = { ... }(not exported) unless it needs to be used outside the componentComponent props should be
interface Props { ... }(not exported) unless the interface needs to be used outside the component
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsx
autogpt_platform/frontend/src/app/(platform)/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
If adding protected frontend routes, update
frontend/lib/supabase/middleware.ts
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsx
autogpt_platform/backend/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development
Files:
autogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/api/features/store/routes.pyautogpt_platform/backend/backend/data/graph.pyautogpt_platform/backend/backend/api/features/store/db.py
autogpt_platform/backend/backend/api/features/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
When modifying API routes, update corresponding Pydantic models in the same directory and write tests alongside the route file
Files:
autogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/api/features/store/routes.pyautogpt_platform/backend/backend/api/features/store/db.py
autogpt_platform/backend/**/*.{py,txt}
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use
poetry runprefix for all Python commands, including testing, linting, formatting, and migrations
Files:
autogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/api/features/store/routes.pyautogpt_platform/backend/backend/data/graph.pyautogpt_platform/backend/backend/api/features/store/db.py
autogpt_platform/backend/backend/api/**/*.py
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
autogpt_platform/backend/backend/api/**/*.py: Use FastAPI for building REST and WebSocket endpoints
Use JWT-based authentication with Supabase integration
Files:
autogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/api/features/store/routes.pyautogpt_platform/backend/backend/api/features/store/db.py
autogpt_platform/backend/backend/**/*.py
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use Prisma ORM for database operations in PostgreSQL with pgvector for embeddings
Files:
autogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/api/features/store/routes.pyautogpt_platform/backend/backend/data/graph.pyautogpt_platform/backend/backend/api/features/store/db.py
autogpt_platform/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Format Python code with
poetry run format
Files:
autogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/api/features/store/routes.pyautogpt_platform/backend/backend/data/graph.pyautogpt_platform/backend/backend/api/features/store/db.py
autogpt_platform/frontend/src/**/*use*.ts
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Do not type hook returns, let TypeScript infer as much as possible
Files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
autogpt_platform/backend/backend/data/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
All data access in backend requires user ID checks; verify this for any 'data/*.py' changes
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/data/*.py
📄 CodeRabbit inference engine (AGENTS.md)
For changes touching
data/*.py, validate user ID checks or explain why not needed
Files:
autogpt_platform/backend/backend/data/graph.py
🧠 Learnings (30)
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use generated API hooks from '@/app/api/__generated__/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/*'
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Fully capitalize acronyms in symbols, e.g. `graphID`, `useBackendAPI`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/frontend/src/lib/autogpt-server-api/types.ts
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/**/schema.prisma : Define key database models (User, AgentGraph, AgentGraphExecution, AgentNode, StoreListing) in `schema.prisma`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.tsautogpt_platform/backend/backend/api/features/library/db.pyautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.tsautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.tsautogpt_platform/backend/backend/data/graph.pyautogpt_platform/frontend/src/lib/autogpt-server-api/types.tsautogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.tsx : Component props should be `type Props = { ... }` (not exported) unless it needs to be used outside the component
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.ts
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/frontend/src/**/*.tsx : Component props should be `interface Props { ... }` (not exported) unless the interface needs to be used outside the component
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsx
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Never use 'src/components/__legacy__/*' in frontend code
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsxautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsx
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : No barrel files or 'index.ts' re-exports in frontend code
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Never use `src/components/__legacy__/*` components
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use shadcn/ui (Radix UI primitives) with Tailwind CSS styling for UI components
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Separate render logic (`.tsx`) from business logic (`use*.ts` hooks)
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/frontend/**/*.{js,jsx,ts,tsx} : Never use components from `src/components/__legacy__/*`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx
📚 Learning: 2026-02-04T16:49:56.176Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:49:56.176Z
Learning: Applies to autogpt_platform/**/*agent*graph*.json : Agent Graphs are workflow definitions stored as JSON and executed by the backend
Applied to files:
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsxautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/backend/backend/data/graph.pyautogpt_platform/frontend/src/lib/autogpt-server-api/types.tsautogpt_platform/frontend/src/app/api/openapi.json
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use function declarations (not arrow functions) for components and handlers
Applied to files:
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsx
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/backend/blocks/*.py : When adding new blocks, analyze block interfaces to ensure inputs and outputs tie well together for productive graph-based editor connections
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsx
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/backend/backend/blocks/**/*.py : Inherit from 'Block' base class with input/output schemas when adding new blocks in backend
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/backend/blocks/*.py : When creating new blocks, inherit from the `Block` base class and define input/output schemas using `BlockSchema`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsxautogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use generated API hooks from `@/app/api/__generated__/endpoints/` with pattern `use{Method}{Version}{OperationName}` and regenerate with `pnpm generate:api`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*use*.ts : Do not type hook returns, let TypeScript infer as much as possible
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/frontend/src/**/*.ts : Do not type hook returns, let Typescript infer as much as possible
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Use generated API hooks from `@/app/api/__generated__/endpoints/` with pattern `use{Method}{Version}{OperationName}`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.tsautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/**/*.{ts,tsx} : Never type with `any`, if no types available use `unknown`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.ts
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Do not use `useCallback` or `useMemo` unless asked to optimize a given function
Applied to files:
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use React Query for server state (via generated hooks) in frontend development
Applied to files:
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsxautogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Use xyflow/react for visual graph editor in Workflow Builder
Applied to files:
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsx
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/backend/backend/api/features/**/*.py : Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
Applied to files:
autogpt_platform/backend/backend/api/features/store/routes.py
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/backend/api/features/**/*.py : When modifying API routes, update corresponding Pydantic models in the same directory and write tests alongside the route file
Applied to files:
autogpt_platform/backend/backend/api/features/store/routes.py
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/frontend/**/*.{ts,tsx} : Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Avoid large hooks, abstract logic into `helpers.ts` files when sensible
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts
📚 Learning: 2026-01-19T07:20:23.494Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11795
File: autogpt_platform/backend/backend/api/features/chat/tools/utils.py:92-111
Timestamp: 2026-01-19T07:20:23.494Z
Learning: In autogpt_platform/backend/backend/api/features/chat/tools/utils.py, the _serialize_missing_credential function uses next(iter(field_info.provider)) for provider selection. The PR author confirmed this non-deterministic provider selection is acceptable because the function returns both "type" (single, for backward compatibility) and "types" (full array), which achieves the primary goal of deterministic credential type presentation.
Applied to files:
autogpt_platform/backend/backend/data/graph.py
🧬 Code graph analysis (16)
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.ts (1)
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.ts (1)
GraphLike(18-18)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerInputUI.tsx (2)
autogpt_platform/backend/backend/data/graph.py (1)
Graph(378-381)autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
Graph(438-454)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/RunnerUIWrapper.tsx (2)
autogpt_platform/backend/backend/data/graph.py (1)
Graph(378-381)autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
Graph(438-454)
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-run-draft-view.tsx (2)
autogpt_platform/backend/backend/data/graph.py (1)
Graph(378-381)autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
Graph(438-454)
autogpt_platform/backend/backend/api/features/library/db.py (1)
autogpt_platform/backend/backend/data/graph.py (1)
GraphBaseMeta(224-236)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/BlocksControl.tsx (3)
autogpt_platform/backend/backend/data/graph.py (1)
block(131-140)autogpt_platform/frontend/src/app/api/helpers.ts (1)
okData(23-37)autogpt_platform/frontend/src/tests/pages/build.page.ts (1)
addBlock(104-131)
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/AgentOnboardingCredentials.tsx (1)
autogpt_platform/backend/backend/data/graph.py (1)
GraphModel(415-927)
autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/OldAgentLibraryView/components/agent-schedule-details-view.tsx (2)
autogpt_platform/backend/backend/data/graph.py (1)
Graph(378-381)autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
Graph(438-454)
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/components/AgentOnboardingCredentials/helpers.ts (1)
autogpt_platform/backend/backend/data/graph.py (1)
GraphModel(415-927)
autogpt_platform/backend/backend/api/features/store/image_gen.py (1)
autogpt_platform/backend/backend/data/graph.py (2)
GraphBaseMeta(224-236)name(1681-1682)
autogpt_platform/backend/backend/api/features/store/routes.py (1)
autogpt_platform/backend/backend/data/graph.py (1)
GraphModelWithoutNodes(930-942)
autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/useSubAgentUpdate.ts (4)
autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (2)
GraphInputSchema(377-381)GraphOutputSchema(411-415)autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/helpers.ts (1)
EdgeLike(52-58)autogpt_platform/frontend/src/app/(platform)/build/hooks/useSubAgentUpdate/types.ts (2)
GraphMetaLike(21-21)SubAgentUpdateInfo(8-15)autogpt_platform/frontend/src/app/api/helpers.ts (1)
okData(23-37)
autogpt_platform/frontend/src/app/(no-navbar)/onboarding/5-run/helpers.ts (1)
autogpt_platform/backend/backend/data/graph.py (1)
GraphModel(415-927)
autogpt_platform/backend/backend/data/graph.py (1)
autogpt_platform/backend/backend/data/model.py (4)
CredentialsMetaInput(496-554)validate_credentials_field_schema(511-535)CredentialsFieldInfo(566-687)combine(576-666)
autogpt_platform/backend/backend/api/features/store/db.py (1)
autogpt_platform/backend/backend/data/graph.py (3)
GraphModelWithoutNodes(930-942)hide_nodes(921-927)GraphModel(415-927)
autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
autogpt_platform/backend/backend/data/graph.py (1)
GraphTriggerInfo(370-375)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: types
- GitHub Check: e2e_test
- GitHub Check: Seer Code Review
- GitHub Check: test (3.12)
- GitHub Check: test (3.11)
- GitHub Check: test (3.13)
- GitHub Check: Check PR Status
- GitHub Check: Analyze (python)
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@autogpt_platform/frontend/src/app/`(platform)/build/components/legacy-builder/Flow/Flow.tsx:
- Around line 713-731: The code calls getV1GetSpecificGraph even when
hardcodedValues may lack graph_id/graph_version; update the conditional that
currently checks (blockID === SpecialBlockID.AGENT && hardcodedValues) to
additionally verify graph_id and graph_version are present and valid (e.g.,
const graphID = hardcodedValues.graph_id; const graphVersion =
hardcodedValues.graph_version; only proceed if graphID is a non-empty string and
graphVersion is a number), so getV1GetSpecificGraph(graphID, { version:
graphVersion }) is only invoked when both values exist; ensure inputSchema,
outputSchema and finalHardcodedValues are only set inside that guarded branch
and otherwise handle the missing-values path (log or skip) to avoid requests to
/graphs/undefined.
🧹 Nitpick comments (1)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx (1)
733-755:nodeIdstale-closure risk on rapid node additions.Line 734 reads
nodeIdfrom the closure while Line 755 increments via a functional updater. Because the function is nowasync, the window during whichnodeIdis stale is wider — two rapid calls (e.g. quick successive drops) could produce nodes with the sameid.A
useRef-based counter (or usinggetNextNodeId()which already returns a UUID) would eliminate this entirely.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
🧰 Additional context used
📓 Path-based instructions (10)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{tsx,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
autogpt_platform/frontend/src/**/*.{ts,tsx}: Fully capitalize acronyms in symbols, e.g.graphID,useBackendAPI
Use function declarations (not arrow functions) for components and handlers
Separate render logic (.tsx) from business logic (use*.tshooks)
Use shadcn/ui (Radix UI primitives) with Tailwind CSS styling for UI components
Use Phosphor Icons only for icons
Use ErrorCard for render errors, toast for mutations, and Sentry for exceptions
Use design system components fromsrc/components/(atoms, molecules, organisms)
Never usesrc/components/__legacy__/*components
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}
Use Tailwind CSS only for styling, with design tokens
Do not useuseCallbackoruseMemounless asked to optimize a given function
Never type withanyunless a variable/attribute can ACTUALLY be of any type
autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components asComponentName/ComponentName.tsx+useComponentName.ts+helpers.tsand use design system components fromsrc/components/(atoms, molecules, organisms)
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}and regenerate withpnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local/componentsfolder
Avoid large hooks, abstract logic intohelpers.tsfiles when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not useuseCallbackoruseMemounless asked to optimize a given function
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/app/(platform)/**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Put sub-components in local
components/folder within feature directories
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/**/*.tsx
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Component props should be
type Props = { ... }(not exported) unless it needs to be used outside the componentComponent props should be
interface Props { ... }(not exported) unless the interface needs to be used outside the component
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code usingpnpm format
Never use components fromsrc/components/__legacy__/*
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}
📄 CodeRabbit inference engine (AGENTS.md)
Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never type with
any, if no types available useunknown
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/app/(platform)/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
If adding protected frontend routes, update
frontend/lib/supabase/middleware.ts
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
🧠 Learnings (1)
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Use xyflow/react for visual graph editor in Workflow Builder
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
🧬 Code graph analysis (1)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx (3)
autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
BlockIORootSchema(43-48)autogpt_platform/frontend/src/app/api/helpers.ts (1)
okData(23-37)autogpt_platform/frontend/src/lib/utils.ts (1)
findNewlyAddedBlockCoordinates(352-408)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: e2e_test
- GitHub Check: types
- GitHub Check: Seer Code Review
- GitHub Check: test (3.13)
- GitHub Check: test (3.12)
- GitHub Check: test (3.11)
- GitHub Check: Check PR Status
🔇 Additional comments (3)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx (3)
31-42: Imports align with coding guidelines.Using
getV1GetSpecificGraphfrom the generated endpoints andokDatahelper is consistent with the project's API access patterns. As per coding guidelines: "Use generated API hooks from@/app/api/__generated__/endpoints/".
776-837: Clean delegation tocreateAndAddNode.
addNodeis now much simpler with node creation logic properly centralized. The null-return check on Line 819 correctly handles the case where the block schema isn't found.
981-1008:onDropsimplification looks correct.Properly delegates to
createAndAddNode, and the existingtry/catchcovers bothJSON.parsefailures and any errors from the async helper.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@autogpt_platform/backend/backend/data/graph.py`:
- Around line 224-228: Docstring of GraphBaseMeta incorrectly references
GraphModelMeta which doesn't exist; update the docstring to reference the actual
class name GraphMeta (and keep mention of BaseGraph) so it correctly describes
the relationship; locate the GraphBaseMeta class definition and change the text
"Shared base for `GraphModelMeta` and `BaseGraph`" to "Shared base for
`GraphMeta` and `BaseGraph`".
🧹 Nitpick comments (2)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx (2)
694-774: Good centralization of node-creation logic.The
createAndAddNodehelper properly consolidates what was previously duplicated acrossaddNodeandonDrop. The history tracking, schema resolution for agent blocks, and state updates are correctly wired.One minor note:
availableBlocks.find((node) => node.id === blockID)on Line 702 is also performed by the calleraddNodeon Line 782 (to determineuiTypefor coordinate calculation). This means two lookups for the same block on everyaddNodecall. Consider passing the foundnodeSchemainto the helper or extracting the UI-type check.Sketch: avoid double lookup
const addNode = useCallback( async ( blockId: string, nodeType: string, hardcodedValues: Record<string, any> = {}, ) => { const nodeSchema = availableBlocks.find((node) => node.id === blockId); if (!nodeSchema) { console.error(`Schema not found for block ID: ${blockId}`); return; } // ... position calculation using nodeSchema.uiType ... - const newNode = await createAndAddNode( - blockId, - nodeType, - hardcodedValues, - position, - ); + const newNode = await createAndAddNode( + nodeSchema, + nodeType, + hardcodedValues, + position, + );Then update
createAndAddNodeto accept the already-resolved schema instead of looking it up again byblockID.
821-828:- 0.0on Line 823 is a no-op.
(window.innerWidth - 0.0)is identical towindow.innerWidth. If this was meant to be an offset (like the- 400on Line 824 for height), it should be corrected; otherwise, just remove it for clarity.Proposed cleanup
- x: -position.x * 0.8 + (window.innerWidth - 0.0) / 2, + x: -position.x * 0.8 + window.innerWidth / 2,
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
autogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/data/graph.pyautogpt_platform/backend/snapshots/grphs_allautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
🧰 Additional context used
📓 Path-based instructions (18)
autogpt_platform/backend/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/backend/**/*.py: Use Python 3.11 (required; managed by Poetry via pyproject.toml) for backend development
Always run 'poetry run format' (Black + isort) before linting in backend development
Always run 'poetry run lint' (ruff) after formatting in backend development
Files:
autogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/api/features/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
When modifying API routes, update corresponding Pydantic models in the same directory and write tests alongside the route file
Files:
autogpt_platform/backend/backend/api/features/store/image_gen.py
autogpt_platform/backend/**/*.{py,txt}
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use
poetry runprefix for all Python commands, including testing, linting, formatting, and migrations
Files:
autogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/api/**/*.py
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
autogpt_platform/backend/backend/api/**/*.py: Use FastAPI for building REST and WebSocket endpoints
Use JWT-based authentication with Supabase integration
Files:
autogpt_platform/backend/backend/api/features/store/image_gen.py
autogpt_platform/backend/backend/**/*.py
📄 CodeRabbit inference engine (autogpt_platform/backend/CLAUDE.md)
Use Prisma ORM for database operations in PostgreSQL with pgvector for embeddings
Files:
autogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
Format Python code with
poetry run format
Files:
autogpt_platform/backend/backend/api/features/store/image_gen.pyautogpt_platform/backend/backend/data/graph.py
autogpt_platform/backend/backend/data/**/*.py
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
All data access in backend requires user ID checks; verify this for any 'data/*.py' changes
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/**/data/*.py
📄 CodeRabbit inference engine (AGENTS.md)
For changes touching
data/*.py, validate user ID checks or explain why not needed
Files:
autogpt_platform/backend/backend/data/graph.py
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{tsx,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
autogpt_platform/frontend/src/**/*.{ts,tsx}: Fully capitalize acronyms in symbols, e.g.graphID,useBackendAPI
Use function declarations (not arrow functions) for components and handlers
Separate render logic (.tsx) from business logic (use*.tshooks)
Use shadcn/ui (Radix UI primitives) with Tailwind CSS styling for UI components
Use Phosphor Icons only for icons
Use ErrorCard for render errors, toast for mutations, and Sentry for exceptions
Use design system components fromsrc/components/(atoms, molecules, organisms)
Never usesrc/components/__legacy__/*components
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}
Use Tailwind CSS only for styling, with design tokens
Do not useuseCallbackoruseMemounless asked to optimize a given function
Never type withanyunless a variable/attribute can ACTUALLY be of any type
autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components asComponentName/ComponentName.tsx+useComponentName.ts+helpers.tsand use design system components fromsrc/components/(atoms, molecules, organisms)
Use generated API hooks from@/app/api/__generated__/endpoints/with patternuse{Method}{Version}{OperationName}and regenerate withpnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local/componentsfolder
Avoid large hooks, abstract logic intohelpers.tsfiles when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not useuseCallbackoruseMemounless asked to optimize a given function
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/app/(platform)/**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Put sub-components in local
components/folder within feature directories
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/**/*.tsx
📄 CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)
Component props should be
type Props = { ... }(not exported) unless it needs to be used outside the componentComponent props should be
interface Props { ... }(not exported) unless the interface needs to be used outside the component
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code usingpnpm format
Never use components fromsrc/components/__legacy__/*
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}
📄 CodeRabbit inference engine (AGENTS.md)
Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never type with
any, if no types available useunknown
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
autogpt_platform/frontend/src/app/(platform)/**/*.tsx
📄 CodeRabbit inference engine (AGENTS.md)
If adding protected frontend routes, update
frontend/lib/supabase/middleware.ts
Files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
🧠 Learnings (11)
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/backend/backend/api/features/**/*.py : Update routes in '/backend/backend/api/features/' and add/update Pydantic models in the same directory for API development
Applied to files:
autogpt_platform/backend/backend/api/features/store/image_gen.py
📚 Learning: 2026-02-04T16:49:56.176Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:49:56.176Z
Learning: Applies to autogpt_platform/**/*agent*graph*.json : Agent Graphs are workflow definitions stored as JSON and executed by the backend
Applied to files:
autogpt_platform/backend/snapshots/grphs_allautogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/**/*_test.py : Always review snapshot changes with `git diff` before committing when updating snapshots with `poetry run pytest --snapshot-update`
Applied to files:
autogpt_platform/backend/snapshots/grphs_all
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/backend/**/test/**/*.py : Use snapshot testing with '--snapshot-update' flag in backend tests when output changes; always review with 'git diff'
Applied to files:
autogpt_platform/backend/snapshots/grphs_all
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/**/schema.prisma : Define key database models (User, AgentGraph, AgentGraphExecution, AgentNode, StoreListing) in `schema.prisma`
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-01-19T07:20:23.494Z
Learnt from: ntindle
Repo: Significant-Gravitas/AutoGPT PR: 11795
File: autogpt_platform/backend/backend/api/features/chat/tools/utils.py:92-111
Timestamp: 2026-01-19T07:20:23.494Z
Learning: In autogpt_platform/backend/backend/api/features/chat/tools/utils.py, the _serialize_missing_credential function uses next(iter(field_info.provider)) for provider selection. The PR author confirmed this non-deterministic provider selection is acceptable because the function returns both "type" (single, for backward compatibility) and "types" (full array), which achieves the primary goal of deterministic credential type presentation.
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:49:42.476Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.476Z
Learning: Applies to autogpt_platform/backend/backend/blocks/**/*.py : Inherit from 'Block' base class with input/output schemas when adding new blocks in backend
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:50:20.494Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/backend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:20.494Z
Learning: Applies to autogpt_platform/backend/backend/blocks/*.py : When creating new blocks, inherit from the `Block` base class and define input/output schemas using `BlockSchema`
Applied to files:
autogpt_platform/backend/backend/data/graph.py
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Use xyflow/react for visual graph editor in Workflow Builder
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
📚 Learning: 2026-02-04T16:50:33.593Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.593Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Fully capitalize acronyms in symbols, e.g. `graphID`, `useBackendAPI`
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
📚 Learning: 2026-02-04T16:50:51.303Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.303Z
Learning: Applies to autogpt_platform/frontend/src/**/*.{ts,tsx} : Structure components as `ComponentName/ComponentName.tsx` + `useComponentName.ts` + `helpers.ts` and use design system components from `src/components/` (atoms, molecules, organisms)
Applied to files:
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx
🧬 Code graph analysis (3)
autogpt_platform/backend/backend/api/features/store/image_gen.py (1)
autogpt_platform/backend/backend/data/graph.py (2)
GraphBaseMeta(224-236)name(1682-1683)
autogpt_platform/backend/backend/data/graph.py (2)
autogpt_platform/backend/backend/data/block.py (2)
name(569-570)BlockType(66-76)autogpt_platform/backend/backend/data/model.py (4)
CredentialsMetaInput(496-554)validate_credentials_field_schema(511-535)CredentialsFieldInfo(566-687)combine(576-666)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx (6)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/CustomNode/CustomNode.tsx (2)
CustomNode(110-110)CustomNode(112-1270)autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/CustomNode.tsx (2)
CustomNode(46-46)CustomNode(48-130)autogpt_platform/frontend/src/lib/autogpt-server-api/types.ts (1)
BlockIORootSchema(43-48)autogpt_platform/frontend/src/app/api/helpers.ts (1)
okData(23-37)autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/history.ts (1)
history(95-95)autogpt_platform/frontend/src/lib/utils.ts (1)
findNewlyAddedBlockCoordinates(352-408)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: e2e_test
- GitHub Check: types
- GitHub Check: test (3.11)
- GitHub Check: test (3.12)
- GitHub Check: test (3.13)
- GitHub Check: Check PR Status
🔇 Additional comments (14)
autogpt_platform/frontend/src/app/(platform)/build/components/legacy-builder/Flow/Flow.tsx (2)
32-42: LGTM on new imports.The imports correctly use the generated API endpoint (
getV1GetSpecificGraphfrom@/app/api/__generated__/endpoints/) and the sharedokDatahelper, which aligns with the coding guidelines for using generated API hooks.
981-1008: LGTM on the refactoredonDrop.Clean delegation to
createAndAddNodewith properasync/await, fallback for missinghardcodedValues, and a correct dependency array.autogpt_platform/backend/backend/data/graph.py (10)
114-119: Good use ofField(default_factory=...)for mutable defaults.Switching from bare mutable defaults to
Field(default_factory=...)is the correct pattern in Pydantic to avoid shared-state bugs across instances.
224-249: Clean separation of metadata and structure.Splitting
GraphBaseMeta(core fields) fromBaseGraph(nodes, links, computed fields) is a solid design choice that enables the lightweightGraphMetapath for listings.
384-412: LightweightGraphMetais the key to the latency reduction.By stripping out nodes, links, and all expensive computed fields (especially
credentials_input_schema), this model sidesteps the dominant cost identified in profiling. Thefrom_dbmapping is clean and complete.
415-445: MRO diamond throughGraphBaseMetais valid.The C3 linearization resolves correctly:
GraphModel → Graph → BaseGraph → GraphMeta → GraphBaseMeta → BaseDbModel. SinceGraphMetaredeclaresidandversionwithout defaults,GraphModelconstruction always requires them — which all current call sites (from_db,make_graph_model) satisfy.
476-543: Excellent optimization: dict-based schema avoidscreate_modeloverhead.Building the JSON schema dict directly instead of constructing a dynamic
BlockSchemasubclass per credential field is the right approach. Themodel_dumpon Line 523 correctly uses Python field names inexclude(not aliases), and the merged keys don't collide with the hand-builtfield_schemaproperties.
545-605: Correctis_requiredpropagation with safe default.The
any(...)semantics (Lines 599–602) — treating the aggregated field as required if any contributing node demands credentials — is the right policy. The fallbacknode_required_map.get(node_id, True)defaults to required, which is the safe/conservative choice.
889-920: HardcodedGraphModel.from_dbfor sub-graphs is fine given the exclusion.Line 917 uses
GraphModel.from_dbrather thancls.from_dbfor sub-graphs. This is harmless becausesub_graphsis excluded from serialization inGraphModelWithoutNodes, andBaseGraph-typed sub-graphs don't need the same treatment as the parent.
922-944: Smart serialization-only exclusion preserves computed fields.
Field(exclude=True)hides nodes/links/sub-graphs from JSON output while keeping them accessible internally, socredentials_input_schema,input_schema, etc. continue to work correctly on theGraphModelWithoutNodesinstance.
1018-1018: This is the primary latency win — matching the lightweight query with the lightweight model.The
find_manyquery omitsAGENT_GRAPH_INCLUDE(no node/link joins), andGraphMeta.from_dbskips all expensive computed fields. This matches the PR objective to eliminate per-itemcredentials_input_schemacomputation in listings.
946-951: LGTM.
GraphsPaginatedcorrectly types graphs aslist[GraphMeta], aligning with the lightweight listing path.autogpt_platform/backend/snapshots/grphs_all (1)
1-15: Snapshot correctly reflects the newGraphMetashape.The snapshot aligns with
GraphMeta's fields: all expensive computed properties (credentials_input_schema,input_schema,output_schema, etc.) and structural data (sub_graphs) are removed, andcreated_atis added. Consistent with the listing endpoint now returningGraphMetainstead of full graph models.autogpt_platform/backend/backend/api/features/store/image_gen.py (1)
19-19: Type narrowing fromBaseGraphtoGraphBaseMetais correct.These functions only access
.nameand.description, both of which live onGraphBaseMeta. Using the narrower type avoids requiring the heavierBaseGraph(which carries nodes, links, and computed fields) when it's unnecessary.The docstring typo flagged in a previous review (
_GraphBaseMeta) appears to be fixed — Line 110 now readsGraphBaseMeta | AgentGraph.Also applies to: 37-37, 44-44, 105-110
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
Tested as an AI agent on local dev environment: Test Results ✅
No critical errors in backend logs. The latency optimization appears to be working well — API calls are completing quickly. Looks good to me! 🤠 — Claude (AI agent testing on behalf of @ntindle) |
Adapt auto-credentials filtering to dev's refactored graph model: - aggregate_credentials_inputs() now returns 3-tuples (field_info, node_pairs, is_required) - credentials_input_schema moved to GraphModel, builds JSON schema directly - Update regular/auto_credentials_inputs properties for 3-tuple format - Update test mocks and assertions for new tuple format and class hierarchy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SECRT-1896: Fix crazy
GET /api/graphslatency (P95 = 107s)These changes should decrease latency of this endpoint by
60-65%a lot.Changes 🏗️
Graph.credentials_input_schemacheaper by avoiding constructing a newBlockSchemasubclassGraphMeta- drop all computed fieldsGraphModelorGraphModelWithoutNodeswherever those computed fields are usedlist_graphs_paginatedandfetch_graph_from_store_slugBaseGraphintoGraphBaseMeta+BaseGraphGraph- movecredentials_input_schemaandaggregate_credentials_inputstoGraphModelaggregate_credentials_inputs()call incredentials_input_schemacall treeGraphModelWithoutNodes(similar to currentGraphMeta)Checklist 📋
For code changes:
GET /api/graphsworks as it should