Feat: Refact pipeline (#13826)

### What problem does this PR solve?

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring

---------

Co-authored-by: Zhichang Yu <yuzhichang@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Magicbook1108
2026-04-03 19:26:45 +08:00
committed by GitHub
parent 6d9430a125
commit 69264b3a70
71 changed files with 3055 additions and 990 deletions

View File

@@ -469,6 +469,7 @@ def _load_session_module(monkeypatch):
agent_pkg = ModuleType("agent")
agent_pkg.__path__ = []
agent_canvas_mod = ModuleType("agent.canvas")
agent_dsl_migration_mod = ModuleType("agent.dsl_migration")
class _StubCanvas:
def __init__(self, *_args, **_kwargs):
@@ -489,10 +490,13 @@ def _load_session_module(monkeypatch):
def __str__(self):
return self._dsl
agent_dsl_migration_mod.normalize_chunker_dsl = lambda dsl: dsl
agent_canvas_mod.Canvas = _StubCanvas
agent_pkg.canvas = agent_canvas_mod
agent_pkg.dsl_migration = agent_dsl_migration_mod
monkeypatch.setitem(sys.modules, "agent", agent_pkg)
monkeypatch.setitem(sys.modules, "agent.canvas", agent_canvas_mod)
monkeypatch.setitem(sys.modules, "agent.dsl_migration", agent_dsl_migration_mod)
module_path = repo_root / "api" / "apps" / "sdk" / "session.py"
spec = importlib.util.spec_from_file_location("test_session_sdk_routes_unit_module", module_path)

View File

@@ -442,7 +442,10 @@ def _load_canvas_module(monkeypatch):
agent_pkg = ModuleType("agent")
agent_pkg.__path__ = []
agent_dsl_migration_mod = ModuleType("agent.dsl_migration")
agent_dsl_migration_mod.normalize_chunker_dsl = lambda dsl: dsl
monkeypatch.setitem(sys.modules, "agent", agent_pkg)
monkeypatch.setitem(sys.modules, "agent.dsl_migration", agent_dsl_migration_mod)
agent_component_mod = ModuleType("agent.component")
@@ -450,6 +453,7 @@ def _load_canvas_module(monkeypatch):
pass
agent_component_mod.LLM = _StubLLM
agent_pkg.component = agent_component_mod
monkeypatch.setitem(sys.modules, "agent.component", agent_component_mod)
agent_canvas_mod = ModuleType("agent.canvas")
@@ -479,6 +483,8 @@ def _load_canvas_module(monkeypatch):
return "{}"
agent_canvas_mod.Canvas = _StubCanvas
agent_pkg.canvas = agent_canvas_mod
agent_pkg.dsl_migration = agent_dsl_migration_mod
monkeypatch.setitem(sys.modules, "agent.canvas", agent_canvas_mod)
quart_mod = ModuleType("quart")