Repository navigation
fix: support keenable component - #16884
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 (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughKeenableSearch is integrated as a canvas component with retrieval-reference storage and rendered outputs. Runtime state now exposes normalized references, and agent SSE/session payloads use the structured reference format. Message inputs and event schemas accept broader content and reference values. ChangesRetrieval reference integration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant KeenableSearchComponent
participant CanvasState
participant AgentRun
participant SSEAndSession
KeenableSearchComponent->>CanvasState: Store retrieval chunks and doc_aggs
AgentRun->>CanvasState: Get retrieval reference
CanvasState-->>AgentRun: Return chunks, doc_aggs, total
AgentRun->>SSEAndSession: Emit and persist structured reference
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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/component/universe_a_wrappers.go (1)
713-772: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winMissing title/url render as the literal string
"None"in user-facing output.
keenableValueStringreturns the string"None"for nil fields, and bothbuildKeenableReferences(docnm_kwd/document_name/url) andrenderKeenableReferences(the "Title:"/"URL:" lines fed to the LLM and shown in the chat sidebar per the PR's reference-card UI) bake that literal in directly. The content-skip check (content == "" || content == "None") also silently depends on this sentinel string rather than checkingm["description"] == nildirectly, coupling two unrelated functions through a magic string.🩹 Proposed fix
- content := truncateRunes(strings.TrimSpace(keenableValueString(m["description"])), 10000) - if content == "" || content == "None" { + description, _ := m["description"].(string) + content := truncateRunes(strings.TrimSpace(description), 10000) + if content == "" { continue }And return
""instead of"None"fromkeenableValueString(or use a display-only variant) so a missing title/url renders as blank rather than the literal word "None".🤖 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/universe_a_wrappers.go` around lines 713 - 772, Update keenableValueString to return an empty string for nil values so missing titles and URLs render blank in buildKeenableReferences and renderKeenableReferences. Decouple the content filtering in buildKeenableReferences from the "None" sentinel by checking the raw description value for nil or empty content explicitly, while continuing to skip genuinely missing descriptions.
🤖 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/component/universe_a_wrappers.go`:
- Around line 713-772: Update keenableValueString to return an empty string for
nil values so missing titles and URLs render blank in buildKeenableReferences
and renderKeenableReferences. Decouple the content filtering in
buildKeenableReferences from the "None" sentinel by checking the raw description
value for nil or empty content explicitly, while continuing to skip genuinely
missing descriptions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: de213170-e274-4fb8-a158-d5a7a563c7d6
📒 Files selected for processing (11)
internal/agent/canvas/runner.gointernal/agent/component/fixture_stubs.gointernal/agent/component/keenable_component_test.gointernal/agent/component/message.gointernal/agent/component/message_test.gointernal/agent/component/universe_a_wrappers.gointernal/agent/runtime/state.gointernal/agent/runtime/state_test.gointernal/agent/tool/keenable.gointernal/agent/tool/keenable_test.gointernal/service/agent.go
|
LGTM |
Summary
As title