fix(go-agent): Align Go WenCai and SearXNG agent components with python - #16854
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds configurable SearXNG and WenCai tools, component wrappers, retrieval-state handling, registry validation, and tests covering metadata, invocation, errors, workflow wiring, request behavior, and parameter validation. ChangesTool and component integration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SearXNGComponent
participant SearXNGTool
participant HTTPHelper
participant SearXNGServer
participant CanvasState
SearXNGComponent->>SearXNGTool: Invoke with query and configuration
SearXNGTool->>HTTPHelper: Send pinned search request
HTTPHelper->>SearXNGServer: Request JSON search results
SearXNGServer-->>HTTPHelper: Return result payload
HTTPHelper-->>SearXNGTool: Return decoded results
SearXNGTool-->>SearXNGComponent: Return results envelope
SearXNGComponent->>CanvasState: Add retrieval chunks and document aggregates
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
🧹 Nitpick comments (1)
internal/agent/tool/wencai.go (1)
116-127: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMerged params are computed then discarded.
paramsis merged from defaults + runtime args and then thrown away via_ = params, somergeWencaiParamsis effectively dead in the production path (only the JSON parse for the malformed-args error is actually exercised). This matches the "upstream disabled" intent, but if you don't plan to re-enable soon, the merge and the_ = paramssink are removable; the parse alone covers the malformed-JSON contract.As per coding guidelines: "Prefer deletion over compatibility shims... Remove dead tests, commented-out code, stale documentation, and 'move later' notes."
🤖 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/tool/wencai.go` around lines 116 - 127, Remove the unused parameter-merging path from the wencai handler, including the runtime parameter variable, mergeWencaiParams call, and `_ = params` sink. Preserve the argsJSON JSON unmarshalling so malformed arguments still return the existing parse error response, while retaining the current empty report 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.
Nitpick comments:
In `@internal/agent/tool/wencai.go`:
- Around line 116-127: Remove the unused parameter-merging path from the wencai
handler, including the runtime parameter variable, mergeWencaiParams call, and
`_ = params` sink. Preserve the argsJSON JSON unmarshalling so malformed
arguments still return the existing parse error response, while retaining the
current empty report behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f6f39140-a2e4-47dc-af1e-8817859624fd
📒 Files selected for processing (10)
internal/agent/component/searxng.gointernal/agent/component/searxng_test.gointernal/agent/component/wencai.gointernal/agent/component/wencai_test.gointernal/agent/runtime/state.gointernal/agent/tool/registry.gointernal/agent/tool/searxng.gointernal/agent/tool/searxng_test.gointernal/agent/tool/wencai.gointernal/agent/tool/wencai_test.go
|
LGTM |
Summary
WenCaiandSearXNGCanvas components and register their tool factories.Tests
Passed:
bash build.sh --test ./internal/agent/tool/...bash build.sh --test ./internal/agent/component/...bash build.sh --test ./internal/agent/runtime/...bash build.sh --test ./internal/agent/...cd web && npm run type-check