From 4058c7dffeabbcf248946595df08b112cce75a9c Mon Sep 17 00:00:00 2001 From: Woody Date: Tue, 28 Apr 2026 17:10:02 +0800 Subject: [PATCH] fix(citations): use all sub-question sources for citation lookup LLMs may cite chunks from one sub-question's context inside another sub-question's answer section. Previously, processCitationsForSubq only looked up the current sub-question's sources, leaving cross-referenced citations unlinked. Now SubQuestionSection passes all sub-question sources and uses processCitations with a combined flat lookup. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- frontend/src/components/ResponsePanel.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ResponsePanel.tsx b/frontend/src/components/ResponsePanel.tsx index c55edca..609cd1d 100644 --- a/frontend/src/components/ResponsePanel.tsx +++ b/frontend/src/components/ResponsePanel.tsx @@ -70,13 +70,18 @@ function SubQuestionSection({ index, subQuestion, answerSection, + allSubQuestionSources, }: { index: number subQuestion: SubQuestionSources answerSection: string + allSubQuestionSources: SubQuestionSources[] }) { const [expanded, setExpanded] = useState(false) - const processedAnswer = processCitationsForSubq(answerSection, [subQuestion], 0) + // Look up citations across ALL sub-questions' sources because the LLM + // may cite chunks from other sub-questions' contexts. + const allSources = allSubQuestionSources.flatMap(sq => sq.sources) + const processedAnswer = processCitations(answerSection, allSources) return (
))}