Skip to content

Fix: num bind datasets in template by components - #19454

Merged
wangq8 merged 2 commits into
infiniflow:mainfrom
Lynn-Inf:fix/num-datasets-in-template
Sep 10, 2026
Merged

wangq8 merged 2 commits into
infiniflow:mainfrom
Lynn-Inf:fix/num-datasets-in-template

Conversation

@Lynn-Inf

@Lynn-Inf Lynn-Inf commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

As title.

@Lynn-Inf
Lynn-Inf requested a review from wangq8 September 9, 2026 11:17
@Lynn-Inf Lynn-Inf added the ci Continue Integration label Sep 9, 2026
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0ff5545b-acb5-4ee0-9480-2e2e478e9c21

📥 Commits

Reviewing files that changed from the base of the PR and between 4ec32db and b77f8b5.

📒 Files selected for processing (1)
  • web/src/pages/agents/template-retrieval-binding.ts

📝 Walkthrough

Walkthrough

The retrieval binding helpers now traverse graph and components views separately. Binding still updates both views. Counting uses the components view when available and falls back to the graph view to avoid duplicate counts.

Changes

Retrieval binding view separation

Layer / File(s) Summary
Separate graph and component walkers
web/src/pages/agents/template-retrieval-binding.ts
Shared validation now supports dedicated graph and components walkers. The combined walker returns parameters from both views for binding.
Select the counting view
web/src/pages/agents/template-retrieval-binding.ts
countUnboundRetrieval counts the components view when a components block exists. Otherwise, it counts the graph view. Documentation describes this rule.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 4ec32

Template retrieval dataset counts now avoid double-counting steps mirrored between graph and components views, while retaining graph-only template support. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes the required Summary heading but does not provide a meaningful explanation. The text only says "As title" and omits the background and problem context required by the template… Replace "As title" with a brief summary that explains the dataset-counting problem, the affected template behavior, and how the change fixes it.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately identifies the main change: fixing dataset binding counts in templates by using components. The wording is abbreviated but remains understandable and related to the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the required Summary heading but does not provide a meaningful explanation. The text only says "As title" and omits the background and problem context required by the template.

  • Fix all pre-merge checks with AI

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.

❤️ Share

A rabbit checks the graph with care
Then finds the components waiting there
Two paths bind each retrieval key
One count keeps the tally free
No mirrored step is counted twice

Comment @coderabbitai help to get the list of available commands.

@wangq8 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an AI review comment.

Thanks for the fix. The refactor cleanly separates the two DSL views (walkGraphRetrievalParams vs walkComponentsRetrievalParams) and makes countUnboundRetrieval follow only the components view (with a graph fallback when no components block exists), while bindUnboundRetrieval still walks both views so a later save cannot silently unbind a step. This correctly eliminates the double-counting of a retrieval step mirrored in both views.

Minor points (non-blocking):

  1. hasComponents treats any object-typed components as "present", including an empty object {}. In that edge case countUnboundRetrieval returns 0 even if graph.nodes still holds unbound retrieval steps. If an empty components block can occur for a valid-but-unpersisted DSL, consider also falling back to the graph view when Object.keys(components).length === 0.

  2. No unit tests were added for the new counting behavior. A small spec (empty components + graph-only fallback + mirrored step counted once) would lock in the fix.

Otherwise LGTM — the logic matches the engine's topology-of-record semantics.

This is an AI review comment.

@Lynn-Inf
Lynn-Inf requested a review from cike8899 September 10, 2026 02:18
@wangq8
wangq8 merged commit 5c48dfb into infiniflow:main Sep 10, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants