feat(kimi): unwrap redirect urls and merge search panel into citations
Pull Kimi's "搜索网页" panel results into the regular citation source flow, drop the dedicated-citation-panel branch on the server side, and unwrap Kimi redirect URLs so citation source items resolve to the real target host. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2680,12 +2680,7 @@ func buildMonitoringCitationSourceInputs(platformID string, req MonitoringTaskRe
|
||||
}
|
||||
|
||||
func monitoringPlatformUsesDedicatedCitationPanel(platformID string) bool {
|
||||
switch normalizeMonitoringPlatformID(platformID) {
|
||||
case "kimi":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func monitoringPlatformResolvesContentCitations(platformID string) bool {
|
||||
|
||||
@@ -283,7 +283,7 @@ func TestMonitoringHeartbeatSnapshotMetrics(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildMonitoringRawPayloadKimiExcludesSearchResultsFromCitationInputs(t *testing.T) {
|
||||
func TestBuildMonitoringRawPayloadKimiIncludesSearchResultsInCitationInputs(t *testing.T) {
|
||||
citationTitle := "真实引用文章"
|
||||
searchTitle := "搜索网页结果"
|
||||
|
||||
@@ -304,13 +304,18 @@ func TestBuildMonitoringRawPayloadKimiExcludesSearchResultsFromCitationInputs(t
|
||||
}
|
||||
|
||||
rawPayload, sourceInputs := buildMonitoringRawPayload("kimi", req)
|
||||
if len(sourceInputs) != 1 {
|
||||
t.Fatalf("buildMonitoringRawPayload() sourceInputs len = %d, want 1", len(sourceInputs))
|
||||
if len(sourceInputs) != 2 {
|
||||
t.Fatalf("buildMonitoringRawPayload() sourceInputs len = %d, want 2", len(sourceInputs))
|
||||
}
|
||||
seen := make(map[string]bool)
|
||||
for _, item := range sourceInputs {
|
||||
if item.URL != "https://example.com/citation" {
|
||||
t.Fatalf("buildMonitoringRawPayload() source url = %q, want citation url", item.URL)
|
||||
}
|
||||
seen[item.URL] = true
|
||||
}
|
||||
if !seen["https://example.com/citation"] {
|
||||
t.Fatalf("buildMonitoringRawPayload() missing citation url in source inputs: %#v", sourceInputs)
|
||||
}
|
||||
if !seen["https://example.com/search"] {
|
||||
t.Fatalf("buildMonitoringRawPayload() missing search url in source inputs: %#v", sourceInputs)
|
||||
}
|
||||
|
||||
var payload map[string]interface{}
|
||||
|
||||
Reference in New Issue
Block a user