Repository navigation
fix(go-agent): missing input form for ExeSQL and Browser agent nodes - #16675
Conversation
📝 WalkthroughWalkthroughThis PR adds ChangesDynamic Input Form Support
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
internal/agent/component/browser.gointernal/agent/component/universe_a_wrappers.gointernal/handler/agent_component_test.go
| 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", | ||
| }, | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
🎯 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 3Repository: 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('---')
PYRepository: 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.
Summary
/components/:component_id/input-form.Fixed
102 component has no input_formfor ExeSQL nodes.102 component has no input_formfor Browser nodes.