Skip to content

fix(go-pipline): list agents incorrectly filtering out ingestion pipelines - #16698

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/pipline
Jul 7, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/pipline

Conversation

@Harry-Hz-Zhang

Copy link
Copy Markdown
Contributor

Summary

When no canvas_category filter is provided, the DAO defaulted to "agent_canvas", hiding canvases with category "dataflow_canvas" (i.e. ingestion pipelines). Remove the hardcoded default so both categories are returned.

Verified by frontend testing.

image

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Jul 7, 2026
@Harry-Hz-Zhang Harry-Hz-Zhang added the ci Continue Integration label Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2697f365-6d64-45a1-b395-e0648d3c3d6e

📥 Commits

Reviewing files that changed from the base of the PR and between 9eba452 and 4b59d31.

📒 Files selected for processing (1)
  • internal/dao/user_canvas.go
💤 Files with no reviewable changes (1)
  • internal/dao/user_canvas.go

📝 Walkthrough

Walkthrough

This change modifies two query methods in the user_canvas DAO to remove a default filter that previously restricted results to canvas_category "agent_canvas" when no category was specified, now returning unfiltered results in that case.

Changes

Canvas category filter change

Layer / File(s) Summary
Remove default category filtering
internal/dao/user_canvas.go
GetList and ListByTenantIDs no longer default to filtering by canvas_category = "agent_canvas" when the input is empty; the filter is applied only when canvasCategory is explicitly provided.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A filter once forced, now set free,
No more "agent_canvas" by default decree.
Empty means all, the query now shows,
A rabbit hops through, and onward it goes! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the change: removing the default canvas category filter that hid ingestion pipelines.
Description check ✅ Passed The description includes the required Summary section, the problem context, the fix, and verification notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

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.

Review Summary

PR: #16698 — fix(go-pipeline): list agents incorrectly filtering out ingestion pipelines

What it does

Removes a hardcoded default filter from two DAO methods ( and ) so that when no query param is provided, all canvas categories (including / ingestion pipelines) are returned instead of only ones.

Analysis

✅ The bug is real.
In both (line 291-293) and (line 385-387), the branch unconditionally filtered to when no category was specified. Any upstream caller that intentionally passes an empty to mean "no filter" would silently show only agent canvases. This is exactly the reported issue — ingestion pipelines (category ) were hidden from the list view.

✅ Correct approach.
The fix removes the default entirely. Since the guard already handles the filter-when-set case, removing the else clause means an empty passes through as "no category filter." This is the semantically correct behavior for an optional filter parameter.

🔍 Caller analysis

Caller How canvasCategory is set Impact
— user-supplied, empty = all ✅ Fix correctly returns all categories
Explicitly defaults to when empty (line 350-351) ✅ Not affected — hardcodes default at creation time, not query time
Other callers of None found in non-test code ✅ No regressions

⚠️ Minor concern — appears to be uncalled.
The method on doesn't seem to have any active callers outside tests. It's worth considering whether this method can be removed entirely, but that's out of scope for this PR.

✅ No security concerns.
This is a data-fetching change only — removing a restrictive filter doesn't bypass any authorization since the caller-side tenant/permission checks remain intact.

✅ No SQL injection risk.
The value is passed as a parameterized query placeholder (), not string-interpolated.

Conclusion

Clean, focused fix. Net -5 lines, no new code introduced. Zero regression risk for the affected code paths. Approved from a code perspective.

@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.

PR Review: #16698

Title: fix(go-pipeline): list agents incorrectly filtering out ingestion pipelines
Author: @Hz-186 | Files: 1 (internal/dao/user_canvas.go) | Changes: -5 lines

The Bug

When GET /api/v1/agents is called without a canvas_category query param, both DAO methods (GetList and ListByTenantIDs) had an else branch that hardcoded canvas_category = "agent_canvas". This silently filtered out canvases with category "dataflow_canvas" (ingestion pipelines).

The Fix

Remove the else default filter from both methods:

  1. GetList (lines 291-293) — else { query.Where("canvas_category = ?", "agent_canvas") } removed
  2. ListByTenantIDs (lines 385-387) — same

This is semantically correct: an optional filter parameter should apply when set and do nothing when empty.

Caller Impact

Caller canvasCategory source Impact
handler/agent.go:ListAgents c.Query("canvas_category") — user-supplied, empty = no filter Fix works correctly
handler/agent.go:CreateAgent Defaults to "agent_canvas" when empty (line 350) Creation-time default, unaffected
Other GetList callers None found outside tests No regression

Verdict

  • Correct fix — matches expected semantics for an optional filter parameter
  • Zero regression risk — 5 lines deleted, no new code; all callers verified
  • No security/injection concerns — parameterized query (?), auth checks unaffected
  • Nice-to-have cleanup — GetList appears to have zero active callers; could be removed separately

Status: Approved — clean, focused, correct.

@wangq8
wangq8 merged commit ac5860c into infiniflow:main Jul 7, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants