Skip to content

feat(agent): add Querit Canvas form - #3

Merged
ethan7zhanghx merged 2 commits into
feat/querit-search-toolfrom
feat/querit-web-node
Jul 27, 2026
Merged

ethan7zhanghx merged 2 commits into
feat/querit-search-toolfrom
feat/querit-web-node

Conversation

@ethan7zhanghx

@ethan7zhanghx ethan7zhanghx commented Jul 27, 2026 •

Copy link
Copy Markdown

Summary

Add the standalone Querit search node configuration to the RAGFlow Canvas. This replaces the compile-safe placeholder from the contract PR with a usable form while keeping the Python and Go runtimes independent.

What changed

  • add Querit to the Canvas Tools menu
  • register the real QueritSearch form in FormConfigMap
  • add a password input for api_key and a RAGFlow variable selector for query
  • add validated inputs for count, chunks_per_doc, and time_range
  • add dynamic lists for site, country, and language filters
  • serialize UI list entries to string[] and rehydrate persisted string[] values when reopening a node
  • serialize browser number input values back to numbers before writing them to Canvas state
  • validate and normalize the current form synchronously before updating Canvas state, so invalid edits and blank list entries cannot overwrite the last valid node configuration
  • expose the Querit form schema and widgets so the later Agent embedded-tool PR can reuse the same contract

Field contract

Canvas field UI type Validation / persistence
api_key password string
query RAGFlow variable string
count number integer, minimum 1; persisted as number
chunks_per_doc number integer from 1 to 3; persisted as number
site_include dynamic string list non-blank items; trimmed and persisted as string[]
site_exclude dynamic string list non-blank items; trimmed and persisted as string[]
time_range text empty, relative d/w/m/y range, or YYYY-MM-DDtoYYYY-MM-DD
country_include dynamic string list non-blank items; trimmed and persisted as string[]
language_include dynamic string list non-blank items; trimmed and persisted as string[]

Validation

  • 28 focused Jest tests passed across two suites, covering field validation, numeric normalization, list serialization, node rehydration, and the Canvas update watcher
  • touched files passed Prettier and ESLint
  • git diff --check passed
  • production frontend build passed with NODE_OPTIONS=--max-old-space-size=8192 npm run build (14,201 modules, about 15m27s on ARM)
  • the actual production Querit form widgets were mounted in an isolated Vite page and exercised in a real Chromium browser
  • browser verification confirmed default/rehydrated values, valid numeric and list persistence, inline validation, retention of the last valid Canvas state after invalid edits, rejection of blank dynamic-list rows, and trimming of valid list entries

The browser run exposed and this PR fixes two persistence defects: invalid values could be written during the react-hook-form validity update window, and a newly added empty dynamic-list row could be persisted as [""].

Known baseline / environment limitations

  • Full npm run type-check remains red because the current integration branch already contains many unrelated TypeScript errors. Filtering the output found no errors in the new querit-form files.
  • A full signed-in Canvas save/reload E2E was not run because this ARM development machine has no Docker installation, 8 GB RAM, and Python 3.9, while RAGFlow documents Docker, at least 16 GB RAM, and Python 3.13 for its normal development stack; the published RAGFlow images are x86-only.
  • The isolated browser page used the production form components but omitted QueryVariable, which requires the full Canvas/backend context. Query-variable integration remains covered by source review and the successful production build, and should receive final E2E coverage in a supported RAGFlow environment.
  • No real Querit API key is required for this form-state PR.

Scope

This PR does not modify the Python tool, Go tool, locale files, shared UI primitives, Agent embedded-tool registration, export redaction, or timeline icons.

@ethan7zhanghx
ethan7zhanghx marked this pull request as ready for review July 27, 2026 15:04
@ethan7zhanghx
ethan7zhanghx merged commit e891abe into feat/querit-search-tool Jul 27, 2026
ethan7zhanghx pushed a commit that referenced this pull request Aug 7, 2026
…17937)

Collapses three duplicated/dead code smells in the canvas debug-result
path of `internal/ingestion/task` (remaining findings #2/#3/#4 from the
package CTO review):

- **#2 — vector-key stripping duplication.** `isVectorKey` (the full
stripper: fixed legacy keys `vector`/`embedding`/`feature`/`q_vec` plus
the `q_<dim>_vec` pattern) was re-implemented as a weaker inline copy in
the golden-compare tool (`tool/compare_pipeline_golden.go`) that only
matched `q_<dim>_vec` and let real vectors leak into the diff. Exported
as `IsVectorKey` and reused by the tool.
- **#3 — near-duplicate deep copy.** `deepCopy` and `deepCopyStrip` were
identical walkers differing only in vector stripping. Parameterized
`deepCopy(v any, stripVector bool) any` and deleted `deepCopyStrip`.
- **#4 — redundant switch.** `lookupComponentOutput` had two switch
cases with identical bodies (both the `map[string]map[string]any` and
`map[string]any` state shapes). Unified into a single `found`/`ok`
resolution; nested-state and flat-fallback semantics unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant