langgenius / langgenius/dify

Fix loop-end state and log grouping in workflow run logs

Open
#40,838 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

## Summary

When a loop finishes, child node state and workflow run log formatting can become inconsistent around loop-end traces.

Observed behavior addressed by the related PR:

- child nodes can remain visually running after the parent loop emits a finish event
- loop-end traces without loop metadata can appear in the top-level workflow log list
- loop-end traces can be incorrectly grouped as parallel children

## Expected behavior

Loop-end events should update the running child node state consistently, and loop-end traces should be treated as loop/parallel boundaries so formatted workflow run logs match the actual execution structure.

## Impact

Users inspecting workflow runs may see stale running states or misleading log grouping after loop execution completes.

## Proposed fix

Update the loop-finished event handling and workflow run log formatting logic so loop-end traces are not rendered as normal top-level or parallel child entries when they do not carry loop metadata.

## Related PR

Original implementation PR: #38266

Contributor guide

Open the contributing guide

Research direction

Review the original implementation in PR #38266, then trace the loop-finished event handling and workflow run log formatting logic it changed. Reproduce a workflow containing a loop and inspect the child states and rendered traces; done means loop-end events update child state consistently and are excluded from incorrect top-level or parallel grouping.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.