Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions integration/workflow_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ func TestWorkflowRunLifecycle(t *testing.T) {
if states.O("start").S("status") != "succeeded" || states.O("agent-1").S("status") != "succeeded" {
t.Fatalf("run node_states missing nodes: %v", states)
}
// The run echoes the kickoff input as its start-node output: the one thing the sim can say truthfully.
output := states.O("start").O("output").O("input")
// The start node reports the run form the way desktop's variable pool does: each run-form variable
// is its own root, and `input` is the authored kickoff prompt (unset in this fixture).
output := states.O("start").O("output")
if output.S("branch") != "main" {
t.Fatalf("start output did not echo input: %v", output)
t.Fatalf("start output did not expose the run input variable: %v", output)
}
if prompt, ok := output["input"].(string); !ok || prompt != "" {
t.Fatalf("start output input = %v; want the authored kickoff prompt as a string", output["input"])
}
// definitionSnapshot is the frozen graph, not the live document: the run carries its own copy.
ds := run.O("definitionSnapshot")
Expand Down
13 changes: 11 additions & 2 deletions internal/collab/workflow-run-simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ func (MockWorkflowRunSimulator) SimulateWorkflowRun(graph, input core.Object) (n
"finishedAt": finishedAt.UTC().Format(time.RFC3339),
}
if isStart {
// The one thing the sim can truthfully report: what it was kicked off with.
state["output"] = core.Object{"input": input}
// The one thing the sim can truthfully report: what it was kicked off with. Match the
// real Start output shape — `input` is the authored prompt and each run-form variable is
// a root — so a UI negative case reads the same pool the scheduler writes.
output := core.Object{}
for key, value := range input {
if key != "input" {
output[key] = value
}
}
output["input"] = data.S("input")
state["output"] = output
} else {
state["output"] = core.Object{"message": "Simulated " + title + " result (simulated; no real work was performed)."}
}
Expand Down
Loading
Loading