refactor: run local subworkflows in process#2248
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR replaces the subprocess-based ChangesIn-process Local Sub-workflow Runner
Sequence Diagram(s)sequenceDiagram
participant Parent as Parent DAG Agent
participant Local as Local Sub-workflow Runner
participant DAGStore as DAG/State Stores
participant Child as Child Runtime Agent
Parent->>Local: Run/Retry/Cancel request
Local->>Local: Validate (DAG, RunID, RootDAGRun)
Local->>DAGStore: Load child DAG
opt Workspace materialization
Local->>Local: Extract & verify workspace
end
Local->>Child: Create agent (stores, config, trigger)
Local->>Child: Execute in-process
Child->>DAGStore: Update run status
Child->>Local: Final status
Local->>Parent: Return exec.RunStatus
🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 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 docstrings
🧪 Generate unit tests (beta)
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 |
Summary
Testing
Summary by cubic
Run local subworkflows in-process via the runtime agent instead of spawning the Dagu CLI. This removes the executable requirement and reduces overhead while preserving child run behavior (status, logs, artifacts, retries, cancellation, nesting).
internal/subflow/local.goandlocal_helpers.gowith a newsubflow.NewLocalrunner; removedlocal_cli.go.internal/cmd/context.go,internal/engine/engine.go,internal/engine/run.go,internal/service/worker/remote_handler.go, and tests to build a router withsubflow.NewLocal(...), passing stores, status/log/artifact handlers, worker ID, and run dirs; uses a self-referential factory to support nested subworkflows.dag.runparity with the previous subprocess path.daguexecutable is required and artifacts are written for child runs; adjusted router tests to newShouldRunrules (rejects worker selectors unlessForceLocalis set).Written for commit 975a954. Summary will update on new commits.
Summary by CodeRabbit
New Features
Tests