Skip to content

Total tokens overcount in workflow caused by loop/iteration nodes #28405

@anobaka

Description

@anobaka

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Create a workflow like this and run it.

Image

✔️ Expected Behavior

The total tokens of loop or iteration nodes themselves should not be counted.

Image

❌ Actual Behavior

The total tokens inside loop or iteration nodes were counted twice.

Image

I would be happy to submit a PR to address this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions