refactor: 修复sqlmodel的问题

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Move workflow_engine inside workflow package to keep core root clean
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

* refactor: overhaul workflow and chat architecture

- Separate Chat and Workflow API endpoints and database models
- Use JSONB to store workflow execution context in Postgres
- Convert workflow engine to use pydantic-ai execution graphs inside a Ray task
- Update frontend React components to support standalone workflow creation
- Move workflow_engine inside workflow package to keep core root clean
- Replace sqlmodel with pure sqlalchemy mappings globally
- Remove obsolete and broken workflow runner tests

Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: zhaoxi826 <198742034+zhaoxi826@users.noreply.github.com>
This commit is contained in:
2026-05-12 22:52:19 +08:00
committed by GitHub
parent ff1ede47a0
commit c0e4fd34ae
7 changed files with 7 additions and 89 deletions
-82
View File
@@ -1,82 +0,0 @@
import pytest
from kilostar.core.workflow_running_engine.workflow import (
WorkStep,
kilostarWorkflow,
WorkflowStatus,
LogicGate,
)
def test_work_step():
ws = WorkStep(
step=1,
name="step1",
node="control_node",
action="coding",
desc="Write some code",
)
assert ws.step == 1
assert ws.name == "step1"
assert ws.node == "control_node"
assert ws.action == "coding"
assert ws.desc == "Write some code"
assert ws.status == "waiting"
def test_kilostar_workflow_validation_success():
ws1 = WorkStep(step=1, name="s1", node="control_node", action="a1", desc="d1")
ws2 = WorkStep(step=2, name="s2", node="regulatory_node", action="a2", desc="d2")
wf = kilostarWorkflow(
title="wf1",
work_link=[ws1, ws2],
trace_id="t",
event_info={"platform": "a", "user_name": "b"},
)
assert wf.title == "wf1"
def test_kilostar_workflow_validation_error_step_discontinuous():
ws1 = WorkStep(step=1, name="s1", node="control_node", action="a1", desc="d1")
ws2 = WorkStep(step=3, name="s3", node="regulatory_node", action="a2", desc="d2")
with pytest.raises(ValueError, match="工作链步数不连续"):
kilostarWorkflow(
title="wf1",
work_link=[ws1, ws2],
trace_id="t",
event_info={"platform": "a", "user_name": "b"},
)
def test_kilostar_workflow_validation_error_jump_out_of_bounds():
lg = LogicGate(if_fail="jump_to_step_3", if_pass="continue")
ws1 = WorkStep(
step=1, name="s1", node="control_node", action="a1", desc="d1", logic_gate=lg
)
ws2 = WorkStep(step=2, name="s2", node="regulatory_node", action="a2", desc="d2")
with pytest.raises(ValueError, match="跳转目标 Step 3 越界了"):
kilostarWorkflow(
title="wf1",
work_link=[ws1, ws2],
trace_id="t",
event_info={"platform": "a", "user_name": "b"},
)
def test_kilostar_workflow_validation_error_jump_format_error():
lg = LogicGate(if_fail="jump_to_step_invalid", if_pass="continue")
ws1 = WorkStep(
step=1, name="s1", node="control_node", action="a1", desc="d1", logic_gate=lg
)
with pytest.raises(ValueError, match="LogicGate 格式错误"):
kilostarWorkflow(
title="wf1",
work_link=[ws1],
trace_id="t",
event_info={"platform": "a", "user_name": "b"},
)
def test_workflow_status():
status = WorkflowStatus()
assert status.step == 1
assert status.status == "waiting_llm_working"