Skip to content

feat(agent): add Querit Contents tool - #18156

Merged
yingfeng merged 1 commit into
infiniflow:mainfrom
ethan7zhanghx:agent/querit-contents-upstream
Aug 12, 2026
Merged

yingfeng merged 1 commit into
infiniflow:mainfrom
ethan7zhanghx:agent/querit-contents-upstream

Conversation

@ethan7zhanghx

@ethan7zhanghx ethan7zhanghx commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add Querit Contents as a built-in page content tool for RAGFlow Agents and Canvas workflows.

Querit Contents crawls one or more known URLs and returns their page content and optional metadata. It complements the existing Querit Search tool: Search discovers relevant pages, while Contents retrieves pages already selected by an Agent or workflow.

This integration supports two usage modes:

  • A standalone QueritContents node in Canvas workflows.
  • An embedded content tool available to RAGFlow Agents.

What changed

  • Added Querit Contents support to the Python and Go agent runtimes.
  • Added Agent and Canvas configuration forms.
  • Added tool registration, icons, timeline labels, and English/Chinese UI text.
  • Reused the existing Querit request, retry, cancellation, environment-key fallback, JSON-number preservation, and error-redaction behavior.
  • Preserved the complete Querit Contents JSON response for downstream workflow usage, including per-URL results and statuses.
  • Kept node-level format, timeout, metadata, and API-key settings on the node while requesting only URLs at runtime.
  • Added API-key sanitization when exporting or duplicating Agent and Canvas DSL.
  • Added URL, format, timeout, response-shape, partial-failure, and credential-redaction coverage.
  • Added Python, Go, and frontend unit tests.

Supported parameters

Parameter Description
urls One to ten absolute HTTP or HTTPS URLs. Comma-separated Canvas input is supported.
format Content format: text, markdown, or html. Defaults to markdown.
crawl_timeout Per-page crawl timeout from 1 to 60 seconds. Defaults to 10.
extras_meta Whether to return page title, publication time, site name, and site icon. Defaults to false.

Authentication

The API key can be configured on the Querit Contents node or through the QUERIT_API_KEY environment variable. A node-level key takes precedence.

Querit API keys can be created at https://www.querit.ai/en/dashboard/api-keys.

Request behavior

  • Sends requests to POST https://api.querit.ai/v1/contents with Bearer authentication.
  • Maps the flat RAGFlow form parameters to the Querit urls, format, crawlTimeout, and extrasMeta request payload.
  • Returns the original Querit JSON response without response normalization.
  • Preserves per-URL success and failed statuses when only part of a batch can be crawled.
  • Reuses the existing Querit retry handling for rate limits and transient request failures.
  • Does not retry input-validation failures and stops when the workflow is canceled.

Scope

This PR adds the Querit Contents Agent Tool and Canvas component. It does not change Chat Web Search provider selection, reasoning-mode scheduling or gating, managed credentials, custom provider endpoints, or credential hosting.

Testing

  • Python Querit Contents unit tests: 15 passed.
  • Frontend unit tests: 2 suites passed, 15 tests passed.
  • Real API checks passed for single URL, multi-URL, text / markdown / html, metadata enabled/disabled, mixed success/404 status, and the documented 10-URL limit.
  • Canvas checks passed for tool selection, masked API-key configuration, single-URL execution, and multi-URL execution.
  • Python compilation, Go source formatting, frontend changed-file formatting, and git diff --check passed.
  • Screenshots show only the masked credential, and source changes were scanned for the complete Querit API key; no matches were found.
  • Full upstream CI matrix pending.

Screenshots

Canvas tool menu

Querit Contents in the Canvas tool menu

Canvas node configuration

Querit Contents Canvas node configuration

Canvas content result

Querit Contents Canvas result

Multi-URL content result

Querit Contents successfully crawls the Querit Contents documentation and the RAGFlow Quickstart documentation in one request.

Querit Contents multi-URL result

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a Querit Contents tool for fetching webpage content. It adds request validation, retries, response validation, Go registration, component wiring, tests, and web canvas configuration.

Changes

Querit Contents

Layer / File(s) Summary
Querit API and shared request flow
agent/tools/querit.py
Adds the contents endpoint, supported formats, URL and option validation, response validation, request retries, and shared POST handling for Querit tools.
Go tool execution and contracts
internal/agent/tool/querit_contents.go, internal/agent/tool/querit.go, internal/agent/tool/querit_contents_test.go
Adds the Querit Contents tool, parameter merging, authenticated requests, response decoding, component metadata, structured errors, and comprehensive Go tests.
Tool and component registration
internal/agent/tool/registry.go, internal/agent/tool/registry_test.go, internal/agent/component/tool_component.go, internal/agent/component/tool_component_test.go
Registers querit_contents, Canvas aliases, component metadata, workflow construction, and registry coverage.
Web operator configuration and display
web/src/components/operator-icon.tsx, web/src/constants/agent.tsx, web/src/locales/*, web/src/pages/agent/**, test/unit_test/agent/tools/test_querit_contents_unit.py
Adds the operator enum, defaults, form, localized text, menu and node mappings, icon and timeline support, sensitive-field sanitization, and Python unit tests.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: ci, agent

Suggested reviewers: cike8899

Sequence Diagram(s)

sequenceDiagram
  participant Canvas
  participant QueritContentsTool
  participant QueritAPI
  Canvas->>QueritContentsTool: submit URLs and crawl options
  QueritContentsTool->>QueritContentsTool: validate and merge parameters
  QueritContentsTool->>QueritAPI: POST authenticated contents request
  QueritAPI-->>QueritContentsTool: JSON response
  QueritContentsTool-->>Canvas: return JSON output or structured error
Loading

Poem

A rabbit sets URLs in a neat little row,
Then sends them where Querit pages grow.
Text, Markdown, HTML return in a stream,
With metadata tucked in the crawl’s gentle dream.
“Hop!” says the rabbit, “the canvas is bright!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.03% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the purpose, implementation scope, supported parameters, testing, and known pending CI work.
Title check ✅ Passed The title clearly and concisely identifies the primary change: adding the Querit Contents tool.
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.

@ethan7zhanghx
ethan7zhanghx marked this pull request as ready for review August 12, 2026 06:51
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. 🌈 python Pull requests that update Python code 💞 feature Feature request, pull request that fullfill a new feature. 🧰 typescript Pull requests that update Typescript code labels Aug 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
web/src/pages/agent/form/querit-contents-form/index.tsx (2)

121-124: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the inline switch handler.

Line 123 uses an inline JSX event handler. Pass a named handler instead. If the field handler accepts the boolean value, use onCheckedChange={field.onChange}.

As per coding guidelines: “Avoid inline JSX event handlers such as onClick={() => ...} and onChange={(e) => ...}; extract named handlers and reference them by name.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/form/querit-contents-form/index.tsx` around lines 121 -
124, Update the Switch usage in the form field to reference a named handler
instead of defining an inline JSX callback; since field.onChange accepts the
boolean value, pass it directly through onCheckedChange={field.onChange}.

Source: Coding guidelines


13-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use useTranslation in this component.

Line 13 imports useTranslate. Replace it with useTranslation from react-i18next and preserve the flow namespace.

As per coding guidelines: “Prefer useTranslation from react-i18next over project-wrapped utilities such as useTranslate.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/form/querit-contents-form/index.tsx` at line 13, Replace
the useTranslate import and usage in the querit contents form component with
useTranslation from react-i18next, retaining the existing flow namespace
configuration and translation behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agent/tools/querit.py`:
- Around line 262-288: Increase the timeout applied to _invoke so it covers the
configured request timeout for all retries plus the retry backoff, including the
maximum supported crawl_timeout. Preserve _request’s per-attempt timeout
calculation and add a test that verifies a timed-out first request is retried
successfully before the component timeout expires.

In `@web/src/pages/agent/form/querit-contents-form/index.tsx`:
- Line 106: Update the numeric Input for crawl_timeout in the form field render
to use a named change handler that passes event.target.valueAsNumber to
field.onChange, preserving the integer type when useWatchFormChange persists
form values.
- Around line 34-44: Update FormSchema’s urls validation to normalize
comma-separated input like _normalize_contents_urls, then require between one
and ten absolute HTTP/HTTPS URLs containing a host, matching
_validate_contents_inputs instead of only checking string length.

---

Nitpick comments:
In `@web/src/pages/agent/form/querit-contents-form/index.tsx`:
- Around line 121-124: Update the Switch usage in the form field to reference a
named handler instead of defining an inline JSX callback; since field.onChange
accepts the boolean value, pass it directly through
onCheckedChange={field.onChange}.
- Line 13: Replace the useTranslate import and usage in the querit contents form
component with useTranslation from react-i18next, retaining the existing flow
namespace configuration and translation behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 15010c5a-a2df-4910-88ba-622c9d5b7255

📥 Commits

Reviewing files that changed from the base of the PR and between fdb6b5f and 602e86e.

📒 Files selected for processing (26)
  • agent/tools/querit.py
  • internal/agent/component/tool_component.go
  • internal/agent/component/tool_component_test.go
  • internal/agent/tool/querit.go
  • internal/agent/tool/querit_contents.go
  • internal/agent/tool/querit_contents_test.go
  • internal/agent/tool/registry.go
  • internal/agent/tool/registry_test.go
  • test/unit_test/agent/tools/test_querit_contents_unit.py
  • web/src/components/operator-icon.tsx
  • web/src/constants/agent.tsx
  • web/src/locales/en.ts
  • web/src/locales/zh.ts
  • web/src/pages/agent/canvas/node/dropdown/accordion-operators.tsx
  • web/src/pages/agent/constant/index.tsx
  • web/src/pages/agent/form-sheet/form-config-map.tsx
  • web/src/pages/agent/form/agent-form/tool-popover/tool-command.tsx
  • web/src/pages/agent/form/querit-contents-form/index.tsx
  • web/src/pages/agent/form/tool-form/constant.tsx
  • web/src/pages/agent/hooks/use-add-node.ts
  • web/src/pages/agent/hooks/use-agent-tool-initial-values.ts
  • web/src/pages/agent/log-sheet/tool-name.test.ts
  • web/src/pages/agent/log-sheet/tool-name.ts
  • web/src/pages/agent/log-sheet/tool-timeline-item.tsx
  • web/src/pages/agent/utils/clear-sensitive-fields.test.ts
  • web/src/pages/agent/utils/clear-sensitive-fields.ts

Comment thread agent/tools/querit.py
Comment on lines +262 to +288
@timeout(int(os.environ.get("COMPONENT_EXEC_TIMEOUT", "70")))
def _invoke(self, **kwargs):
if self.check_if_canceled("QueritContents processing"):
return

values = {name: kwargs[name] if name in kwargs else getattr(self._param, name) for name in ("urls", "format", "crawl_timeout", "extras_meta")}
values["urls"] = _normalize_contents_urls(values["urls"])

node_api_key = (self._param.api_key or "").strip()
api_key = node_api_key or (os.environ.get("QUERIT_API_KEY") or "").strip()
if not api_key:
return self._fail("Querit API key is required. Configure api_key or set QUERIT_API_KEY.")

try:
_validate_contents_inputs(**values)
response_data = self._request(_build_contents_payload(**values), api_key)
_validate_contents_response(response_data)
self.set_output("json", response_data)
return self.output("json")
except _QueritCanceled:
return
except (requests.RequestException, RuntimeError, TypeError, ValueError) as error:
return self._fail(_safe_error_message(error, api_key))

def _request(self, payload: dict[str, Any], api_key: str) -> Any:
request_timeout = max(DEFAULT_TIMEOUT, payload["crawlTimeout"] + 5)
return _post_querit(self, QUERIT_CONTENTS_URL, payload, api_key, "QueritContents", request_timeout)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Allow the retry budget before the component timeout expires.

Line 262 sets a 70-second default component timeout. Lines 286-288 allow a 65-second request for crawl_timeout=60. After one timed-out attempt, a retry has at most five seconds to complete. This prevents the advertised retry flow from working for the maximum valid crawl timeout.

Set the component timeout to cover all allowed attempts and backoff time. Alternatively, reduce the per-attempt timeout and document the resulting limit. Add a test where the first request times out and the next request succeeds.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/tools/querit.py` around lines 262 - 288, Increase the timeout applied
to _invoke so it covers the configured request timeout for all retries plus the
retry backoff, including the maximum supported crawl_timeout. Preserve
_request’s per-attempt timeout calculation and add a test that verifies a
timed-out first request is retried successfully before the component timeout
expires.

Comment on lines +34 to +44
const FormSchema = z.object({
api_key: z.string(),
urls: z.string().min(1),
format: z.enum([
QueritContentFormat.Text,
QueritContentFormat.Markdown,
QueritContentFormat.Html,
]),
crawl_timeout: z.coerce.number().int().min(1).max(60),
extras_meta: z.boolean(),
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline agent/tools/querit.py --items all
sed -n '1,260p' agent/tools/querit.py

rg -n -C 4 --glob '*.py' --glob '*.go' --glob '*.ts' --glob '*.tsx' \
  'QueritContents|crawl_timeout|extras_meta|urls|https?://' \
  agent internal test web

Repository: infiniflow/ragflow

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- candidate Querit files ---'
fd -i 'querit|querit-contents-form' . | head -80

printf '%s\n' '--- backend symbols and URL parsing ---'
rg -n -C 5 --glob '*.py' --glob '*.go' \
  'QueritContent|QueritContents|crawl_timeout|extras_meta|url.*split|split.*url|urlparse|HttpUrl|https?://' \
  agent common api ragflow test 2>/dev/null | head -500

printf '%s\n' '--- frontend form ---'
FORM=$(fd -i -t f 'index.tsx' web/src/pages/agent/form | rg 'querit-contents-form')
cat -n "$FORM" | sed -n '1,220p'

Repository: infiniflow/ragflow

Length of output: 39399


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- backend Querit implementations ---'
for f in agent/tools/querit.py internal/agent/tool/querit_contents.go internal/agent/tool/querit_contents_test.go test/unit_test/agent/tools/test_querit_contents_unit.py; do
  if [ -f "$f" ]; then
    printf '\n### %s (%s lines)\n' "$f" "$(wc -l < "$f")"
    cat -n "$f" | sed -n '1,280p'
  fi
done

printf '%s\n' '--- frontend form ---'
cat -n web/src/pages/agent/form/querit-contents-form/index.tsx | sed -n '1,240p'

printf '%s\n' '--- related frontend initialization and API types ---'
rg -n -C 5 --glob '*.{ts,tsx}' \
  'QueritContents|QueritContentFormat|crawl_timeout|extras_meta|querit_contents' \
  web/src | head -300

Repository: infiniflow/ragflow

Length of output: 50374


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- Python normalization and validation ---'
sed -n '280,430p' agent/tools/querit.py

printf '%s\n' '--- frontend values, serialization, and submission path ---'
for f in \
  web/src/pages/agent/constant.ts \
  web/src/pages/agent/hooks/use-watch-form-change.ts \
  web/src/pages/agent/hooks/use-form-values.ts \
  web/src/pages/agent/hooks/querit-agent-initial-values.ts \
  web/src/pages/agent/form/querit-contents-form/index.tsx; do
  if [ -f "$f" ]; then
    printf '\n### %s\n' "$f"
    cat -n "$f" | sed -n '1,260p'
  fi
done

printf '%s\n' '--- exact frontend references ---'
rg -n -C 8 --glob '*.{ts,tsx}' \
  'initialQueritContentsValues|useWatchFormChange|QueritContents|urls' web/src/pages/agent \
  | head -450

Repository: infiniflow/ragflow

Length of output: 49946


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- URL variable and PromptEditor behavior ---'
rg -n -C 6 --glob '*.{ts,tsx,py,go}' \
  'PromptEditor|QueryVariable|replace.*variable|variable.*replace|sys\.|urls.*split|split.*urls|urlparse\(' \
  web/src agent internal common | head -500

printf '%s\n' '--- comparable URL schemas ---'
rg -n -C 5 --glob '*.{ts,tsx}' \
  'z\.(string|array).*url|z\.string\(\)\.url|absolute HTTP|URL|urls:' \
  web/src/pages/agent | head -300

printf '%s\n' '--- targeted backend validation probe ---'
python3 - <<'PY'
from urllib.parse import urlparse

def normalize(value):
    if isinstance(value, str):
        return [part.strip() for part in value.split(",") if part.strip()]
    return value

def backend_accepts(value):
    urls = normalize(value)
    if not isinstance(urls, list) or not 1 <= len(urls) <= 10:
        return False
    if any(not isinstance(url, str) or not url.strip() for url in urls):
        return False
    return all(urlparse(url).scheme in {"http", "https"} and bool(urlparse(url).netloc) for url in urls)

cases = {
    "": False,
    "not a url": False,
    "ftp://example.com": False,
    "example.com": False,
    "https://one.example, https://two.example": True,
    ",".join(f"https://{i}.example" for i in range(11)): False,
    "https://example.com": True,
}
for value, expected in cases.items():
    actual = backend_accepts(value)
    print(f"{actual!s:5} expected={expected!s:5} value={value!r}")
    assert actual == expected
PY

Repository: infiniflow/ragflow

Length of output: 49602


Validate the URL contract in FormSchema.

z.string().min(1) accepts invalid schemes and more than ten URLs. Match _normalize_contents_urls and _validate_contents_inputs: normalize comma-separated values, then require one to ten absolute HTTP/HTTPS URLs with a host.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/form/querit-contents-form/index.tsx` around lines 34 -
44, Update FormSchema’s urls validation to normalize comma-separated input like
_normalize_contents_urls, then require between one and ten absolute HTTP/HTTPS
URLs containing a host, matching _validate_contents_inputs instead of only
checking string length.

{t('queritContentsTimeout')}
</FormLabel>
<FormControl>
<Input type="number" min={1} max={60} step={1} {...field} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline web/src/pages/agent/hooks/use-watch-form-change.ts --items all
sed -n '1,240p' web/src/pages/agent/hooks/use-watch-form-change.ts

rg -n -C 4 --glob '*.go' --glob '*.py' --glob '*.ts' --glob '*.tsx' \
  'crawl_timeout|QueritContents' internal agent test web

Repository: infiniflow/ragflow

Length of output: 50374


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- QueritContentsForm ---'
sed -n '1,180p' web/src/pages/agent/form/querit-contents-form/index.tsx

printf '%s\n' '--- useWatchFormChange consumers ---'
rg -n -C 5 'useWatchFormChange|updateNodeForm|replaceNodeForm' web/src/pages/agent \
  -g '*.{ts,tsx}'

printf '%s\n' '--- React Hook Form and resolver versions ---'
rg -n -C 2 '"react-hook-form"|"`@hookform/resolvers`"|"zod"' \
  package.json web/package.json pnpm-lock.yaml yarn.lock package-lock.json 2>/dev/null || true

printf '%s\n' '--- form value and node serialization helpers ---'
rg -n -C 6 'function useFormValues|export.*useFormValues|updateNodeForm|replaceNodeForm|nodeForm' \
  web/src/pages/agent/hooks web/src/pages/agent/store web/src/pages/agent -g '*.{ts,tsx}' \
  | head -n 400

Repository: infiniflow/ragflow

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- package manifests ---'
git ls-files '*package.json' '*lock*' | head -n 80
for file in $(git ls-files '*package.json' | head -n 20); do
  if rg -q '"react-hook-form"|"`@hookform/resolvers`"' "$file"; then
    printf '%s\n' "--- $file ---"
    rg -n -C 2 '"react-hook-form"|"`@hookform/resolvers`"|"zod"' "$file"
  fi
done

printf '%s\n' '--- graph store update methods ---'
sed -n '500,560p' web/src/pages/agent/store.ts

printf '%s\n' '--- graph save paths mentioning nodes/forms ---'
rg -n -C 5 'save.*graph|graph.*save|data\.form|JSON\.stringify|nodes' \
  web/src/pages/agent -g '*.{ts,tsx}' \
  | rg -n -C 3 'save|form|nodes|JSON' | head -n 350

printf '%s\n' '--- backend timeout type checks ---'
rg -n -C 4 'crawl_timeout|crawlTimeout' agent internal -g '*.{py,go}' | head -n 260

Repository: infiniflow/ragflow

Length of output: 31536


🏁 Script executed:

#!/bin/bash
set -u

printf '%s\n' '--- save hook ---'
save_file=$(git ls-files 'web/src/pages/agent/hooks/use-save-graph.ts' | head -n 1)
if [ -n "$save_file" ]; then
  sed -n '1,260p' "$save_file"
else
  printf '%s\n' 'save hook not found'
fi

printf '%s\n' '--- backend Querit contents implementation ---'
for file in $(git ls-files 'agent/tools/querit.py' 'internal/agent/tool/querit_contents.go'); do
  printf '%s\n' "--- $file ---"
  if [ "$file" = 'agent/tools/querit.py' ]; then
    sed -n '245,290p' "$file"
    sed -n '357,385p' "$file"
  else
    sed -n '30,55p' "$file"
    sed -n '128,205p' "$file"
  fi
done

printf '%s\n' '--- numeric input registrations ---'
rg -n -C 3 'type="number"|valueAsNumber|crawl_timeout' web/src/pages/agent \
  -g '*.{ts,tsx}' | head -n 240

Repository: infiniflow/ragflow

Length of output: 20396


Preserve the numeric type for crawl_timeout.

useWatchFormChange stores raw form.getValues(), and z.coerce.number() does not normalize that value before persistence. Pass a named change handler that calls field.onChange(event.target.valueAsNumber) so the backend receives an integer.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/form/querit-contents-form/index.tsx` at line 106, Update
the numeric Input for crawl_timeout in the form field render to use a named
change handler that passes event.target.valueAsNumber to field.onChange,
preserving the integer type when useWatchFormChange persists form values.

@yingfeng yingfeng added the ci Continue Integration label Aug 12, 2026
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (0c225b0) to head (602e86e).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18156   +/-   ##
=======================================
  Coverage   90.65%   90.65%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          650      650           
  Misses         39       39           
  Partials       28       28           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yingfeng
yingfeng merged commit 1d8b9c7 into infiniflow:main Aug 12, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. 🌈 python Pull requests that update Python code size:XL This PR changes 500-999 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants