wren node: Train in the panel, as a run of wren's training flow

POST/GET /flows/{name}/nodes/{id}/train submit wren_train on the node's
targets, examples and tests and read its latest run (run.for_node,
cause "train"); "Use this model" writes `model` into the draft.
This commit is contained in:
2026-10-25 01:18:54 +02:00
parent 07fa5a2dc2
commit e9941b770d
11 changed files with 671 additions and 3 deletions
+3
View File
@@ -951,6 +951,7 @@ class RunService:
idempotency_key: str | None = None,
parent_id: str | None = None,
passed: list[str] | None = None,
for_node: str | None = None,
) -> Run:
"""Journal a run and wake an engine up for it. Never blocks on it.
@@ -993,6 +994,7 @@ class RunService:
actor=actor,
idempotency_key=idempotency_key,
parent_id=parent_id,
for_node=for_node,
)
with Session(db_engine) as session:
session.add(run)
@@ -1249,6 +1251,7 @@ class RunService:
# What its parent's caller chose. A parent from before that was
# recorded falls back to the names its params carry.
passed=source.passed,
for_node=source.for_node,
)
def _flow_of(self, run_id: str) -> str | None: