Skip to content

Stream workflow authoring progress before generation completes #3631

Description

@AbigailDeng

Problem

Workflow generation opens an HTTP 200 SSE response, emits the initial Starting event, then buffers progress and reasoning until the entire generation/validation/repair operation finishes. Long generations therefore appear inactive even when work continues. HTTP 200 here only confirms that the stream started; later failures are reported as RUN_ERROR.

Evidence on feature/integrate

Reference commit: 195b87818ccd8047d36e04d41962efe267817db2 (the deployed production commit has not been verified).

  • StudioAuthoringPreviewApplicationService.cs, lines 37–75: Starting is yielded immediately; subsequent callback events are appended to a list; the list is drained only after awaiting GenerateAsync. Final validated YAML is then emitted.
  • The LLM streaming callback, lines 122–140 also appends reasoning to that buffered list.
  • StudioEndpoints.cs already maps progress/reasoning to SSE frames. The Application service prevents these from reaching the host while generation is in progress.
  • WorkflowAuthoringPreviewGenerator can perform up to three generation/validation/repair attempts, extending the silent interval. The script preview path has the same buffering pattern and should be assessed as part of the shared implementation.

Live verification and scope

On 2026-09-15, a minimal Describe workflow with one assign step generated and opened successfully. Its temporary draft was subsequently deleted successfully. Archival of an existing published workflow also completed, and its unchanged definition was republished successfully. The original screenshot failure was not reproduced; these controls do not establish a backend delete/archive defect. This issue is for the independently confirmed generation-progress buffering in the reference code.

The frontend currently ignores progress and also needs visible waiting, cancellation, timeout, and clearer accepted-operation feedback. That work is being implemented separately.

Requested behavior

  • Publish typed generation/validation/repair progress while the operation is running, without collecting the entire event sequence until completion.
  • Keep orchestration in Application and protocol mapping in Host; use a bounded streaming mechanism with correct cancellation and cleanup.
  • Keep final validated YAML as the authoritative completion result. Intermediate candidates must not become a successful final workflow.
  • Preserve terminal error reporting and propagate cancellation through generation and streaming.

Acceptance evidence

  • A deterministic test pauses generation after emitting progress and verifies that the consumer receives that progress before generation is released/completed (use explicit synchronization rather than arbitrary delays).
  • Cover progress across repair attempts, terminal errors, cancellation, and the final validated YAML contract.
  • Confirm the script path either shares the corrected streaming implementation or has a documented separate follow-up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions