update OpenAPI schema and add back model_rebuild

This commit is contained in:
Reinier van der Leer
2026-02-12 10:38:00 +01:00
parent 2fa166d839
commit 23175708e6
4 changed files with 12 additions and 14 deletions

View File

@@ -61,9 +61,18 @@ class Webhook(BaseDbModel):
)
# LibraryAgentPreset import must be after Webhook definition to avoid
# broken circular import:
# integrations.py → library/model.py → integrations.py (for Webhook)
from backend.api.features.library.model import LibraryAgentPreset # noqa: E402
# Resolve forward refs
LibraryAgentPreset.model_rebuild()
class WebhookWithRelations(Webhook):
triggered_nodes: list[NodeModel]
triggered_presets: list["LibraryAgentPreset"]
triggered_presets: list[LibraryAgentPreset]
@staticmethod
def from_db(webhook: IntegrationWebhook):
@@ -82,11 +91,6 @@ class WebhookWithRelations(Webhook):
)
# LibraryAgentPreset import must be after WebhookWithRelations definition to avoid
# broken circular import:
# integrations.py → library/model.py → integrations.py (for Webhook)
from backend.api.features.library.model import LibraryAgentPreset # noqa: E402
# --------------------- CRUD functions --------------------- #

View File

@@ -1137,7 +1137,7 @@ const FlowEditor: React.FC<{
<AlertTitle>You are building a Trigger Agent</AlertTitle>
<AlertDescription>
Your agent{" "}
{savedAgent?.nodes.some((node) => node.webhook)
{savedAgent?.nodes.some((node) => node.webhook_id)
? "is listening"
: "will listen"}{" "}
for its trigger and will run when the time is right.

View File

@@ -9498,12 +9498,6 @@
"webhook_id": {
"anyOf": [{ "type": "string" }, { "type": "null" }],
"title": "Webhook Id"
},
"webhook": {
"anyOf": [
{ "$ref": "#/components/schemas/Webhook" },
{ "type": "null" }
]
}
},
"type": "object",

View File

@@ -292,7 +292,7 @@ export type NodeCreatable = {
export type Node = NodeCreatable & {
input_links: Link[];
output_links: Link[];
webhook?: Webhook;
webhook_id?: string | null;
};
/* Mirror of backend/data/graph.py:Link */