Skip to content

fix(go-agent): missing input form for ExeSQL and Browser agent nodes - #16675

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/agent-sql-input
Jul 6, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
Harry-Hz-Zhang:fix/agent-sql-input

Conversation

@Harry-Hz-Zhang

Copy link
Copy Markdown
Contributor

Summary

  • Add Go dynamic input form support for ExeSQL and Browser components.
  • Align their input form metadata with the Python implementation.
  • Add regression tests for /components/:component_id/input-form.

Fixed

  • Fixes 102 component has no input_form for ExeSQL nodes.
  • Fixes 102 component has no input_form for Browser nodes.

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds GetInputForm() methods to BrowserComponent and exesqlComponent, returning schema maps describing their respective input fields (prompts/upload_sources for Browser; sql for ExeSQL). New handler tests validate these dynamically generated forms.

Changes

Dynamic Input Form Support

Layer / File(s) Summary
Component GetInputForm implementations
internal/agent/component/browser.go, internal/agent/component/universe_a_wrappers.go
BrowserComponent and exesqlComponent each add a GetInputForm() method returning a schema map describing their input fields (prompts/upload_sources for Browser, sql for ExeSQL).
Handler tests for dynamic input forms
internal/handler/agent_component_test.go
New tests TestGetComponentInputForm_ExeSQLDynamicInputForm and TestGetComponentInputForm_BrowserDynamicInputForm validate the API response for dynamically generated input forms; an import reorder accompanies the changes.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • infiniflow/ragflow#16606: The retrieved PR's GetComponentInputForm handler dynamically calls these newly added GetInputForm() implementations when the DSL lacks a static input_form.

Poem

A rabbit hops with forms anew,
Prompts and SQL fields in view,
Browser blinks, ExeSQL sings,
Tests confirm these tiny things,
Hopping through the schema dew. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: adding missing input forms for ExeSQL and Browser agent nodes.
Description check ✅ Passed The description includes a summary and fix context, and it is mostly complete for the repository template.

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.

@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as draft July 6, 2026 10:57
@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as ready for review July 6, 2026 10:57

@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: 1

🤖 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 `@internal/agent/component/browser.go`:
- Around line 337-349: `GetInputForm()` exposes `upload_sources`, but the
Browser component never consumes it, so the form value is ignored. Update
`browserParam.Update()` to read and store `upload_sources`, and make sure
`Inputs()` documents the same field so the form surface and Go param surface
stay aligned. If the field is not meant to be supported, remove it from
`GetInputForm()` instead of leaving it unused.
🪄 Autofix (Beta)

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

Run ID: 96005d35-d480-4c8f-9b46-3b09af42530c

📥 Commits

Reviewing files that changed from the base of the PR and between 3a247db and 32af573.

📒 Files selected for processing (3)
  • internal/agent/component/browser.go
  • internal/agent/component/universe_a_wrappers.go
  • internal/handler/agent_component_test.go

Comment on lines +337 to +349
func (b *BrowserComponent) GetInputForm() map[string]any {
return map[string]any{
"prompts": map[string]any{
"type": "text",
"name": "Prompts",
},
"upload_sources": map[string]any{
"type": "line",
"name": "Upload sources",
},
}
}

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 | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether upload_sources is actually read by browserParam/Invoke
rg -n "upload_sources" -C4 internal/agent/component/browser.go

# Look for the Python browser component's get_input_form for parity comparison
fd -a -e py | xargs rg -ln "class Browser" 2>/dev/null
rg -n "def get_input_form" -C10 --type=py -g "*browser*"

Repository: infiniflow/ragflow

Length of output: 1199


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== browser.go relevant sections ==="
sed -n '1,220p' internal/agent/component/browser.go | cat -n
echo
echo "=== browser.go later sections ==="
sed -n '220,420p' internal/agent/component/browser.go | cat -n
echo
echo "=== browser.py relevant sections ==="
sed -n '1,260p' /home/jailuser/git/agent/component/browser.py | cat -n
echo
echo "=== search for get_input_form / upload_sources in browser.py ==="
rg -n "get_input_form|upload_sources|prompts|headless|persist_session|max_steps" /home/jailuser/git/agent/component/browser.py -n -C 3

Repository: infiniflow/ragflow

Length of output: 33391


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== browser.go: Inputs / browserParam / Invoke / GetInputForm ==="
rg -n "func \(b \*BrowserComponent\) (Inputs|Invoke|GetInputForm)|upload_sources|browserParam|type\": \"text\"|type\": \"line\"" internal/agent/component/browser.go -C 4

echo
echo "=== browser.py: get_input_form and upload_sources handling ==="
rg -n "def get_input_form|upload_sources|type[:=].*(text|line|string)|prompts" /home/jailuser/git/agent/component/browser.py -C 4

echo
echo "=== browser.py: show the get_input_form implementation ==="
python3 - <<'PY'
from pathlib import Path
p = Path('/home/jailuser/git/agent/component/browser.py')
text = p.read_text()
for needle in ['def get_input_form', 'upload_sources', 'prompts']:
    idx = text.find(needle)
    print(f'needle={needle!r} idx={idx}')
    if idx != -1:
        start = max(0, text.rfind('\n', 0, idx-200))
        end = text.find('\n\n', idx)
        if end == -1:
            end = len(text)
        snippet = text[start:end]
        print(snippet)
        print('---')
PY

Repository: infiniflow/ragflow

Length of output: 9125


Wire upload_sources through the Go Browser params. GetInputForm() exposes upload_sources, but browserParam.Update() never reads it and Inputs() doesn’t document it, so values entered in the form are ignored. Either plumb it into the Go param surface or remove it from the form.

🤖 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 `@internal/agent/component/browser.go` around lines 337 - 349, `GetInputForm()`
exposes `upload_sources`, but the Browser component never consumes it, so the
form value is ignored. Update `browserParam.Update()` to read and store
`upload_sources`, and make sure `Inputs()` documents the same field so the form
surface and Go param surface stay aligned. If the field is not meant to be
supported, remove it from `GetInputForm()` instead of leaving it unused.

@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as draft July 6, 2026 10:58
@Harry-Hz-Zhang
Harry-Hz-Zhang marked this pull request as ready for review July 6, 2026 10:58
@Harry-Hz-Zhang Harry-Hz-Zhang added the ci Continue Integration label Jul 6, 2026
@JinHai-CN
JinHai-CN merged commit 7e0ccee into infiniflow:main Jul 6, 2026
18 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:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants