bug(frontend): the chat widget calls two functions that no longer exist
I maintainer di solito rispondono entro 3 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- frontend
Direzione di ricerca
Inizia da frontend/docs_scripts/chatbot.js e confronta i quattro punti di chiamata che falliscono con gli helper esistenti escapeMarkdownHtml e formatChatMarkdown introdotti in #234. Esegui tests/test_widget_markdown.py e prova i percorsi per citazioni, stato dello strumento, chat salvata e arresto della generazione; il lavoro è completato quando questi flussi terminano senza ReferenceError e il controllo richiesto delle chiamate non risolte è coperto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
chatbot.js calls escapeHtml at three places and formatMarkdown at one. Neither is defined anywhere in the file:
$ grep -nE "^\s*(function|const|let|var)\s+(escapeHtml|formatMarkdown)\b" frontend/docs_scripts/chatbot.js
(no output)
$ grep -n "escapeHtml(\|formatMarkdown(" frontend/docs_scripts/chatbot.js
934: const formattedText = formatMarkdown(currentMessageContent.trim());
1257: <span class="flo-tool-status-text">${escapeHtml(text)}</span>
1882: <span class="citation-pill-title">${escapeHtml(info.title)}</span>
1883: <span class="citation-pill-sub">${escapeHtml(info.domain)}</span>
Both were real functions until #234 (b24399e), which hoisted them out of the DOMContentLoaded closure and renamed them to escapeMarkdownHtml and formatChatMarkdown, alongside the new tests/test_widget_markdown.py. #234 converted every call site with them: at b24399e the file contains no reference to either old name. All four call sites above arrive at 9a1e5ab (#237).
What breaks
The tool-status pill, on every tool-using turn. setToolStatus (:1257) builds its markup with escapeHtml, so the "Searching Kubeflow documentation..." indicator #237 added never mounts, whether or not the turn returns citations.
Citations, and the saved chat. In the SSE handler the final event does:
if (currentMessageDiv && pendingCitations.length > 0) {
renderCitationsOnDiv(currentMessageDiv, pendingCitations); // ReferenceError: escapeHtml
}
if (currentMessageContent.trim()) {
messagesHistory.push({ role: 'assistant', content: ... }); // never reached
}
...
autoSaveCurrentChat(); // never reached
renderCitationsOnDiv builds each pill with escapeHtml, so it throws on the first citation. The block sits inside try { ... } catch (parseError) { // Ignore partial / heartbeat lines }, which swallows the ReferenceError with no console output. The Sources accordion never mounts, and because the throw lands before messagesHistory.push and autoSaveCurrentChat(), the reply stays on screen but is never written to the saved chat, so it is gone on reload or chat switch. The agent's own context is server-side via contextId and is unaffected.
Stop generation. stopGeneration renders the partial answer with formatMarkdown (:934) before adding the interrupted badge and pushing to history, so the badge never appears, the partial is never saved, and currentMessageDiv / currentMessageContent are left uncleared. This path is not silent: stopGeneration is async and the click handler at :1500 drops the promise, so it surfaces as an unhandled rejection.
Why CI does not see it
tests/test_widget_markdown.py loads the file by splitting on document.addEventListener('DOMContentLoaded' and evaluating only the prelude. All four call sites are inside that closure, so nothing in the repo evaluates them. node --check passes, since an undefined reference is a runtime error rather than a syntax error.
Suggested fix
Point the call sites at the helpers that exist, and add a check over the whole file that every bare name( call resolves to something the file declares or a known global.
Related: #242 resolves the escapeHtml half by adding an alias, as part of the XSS work for #175. It does not cover formatMarkdown.
P.S. I'll shortly open a PR addressing this.
- Lingua principale
- Python
- Stelle
- 49
- Fork
- 122
- Merge medio
- 10h 54m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di kubeflow/docs-agent
-
bug(pipelines): shortcode stripping deletes text between a {{< >}} shortcode and the next {{% %}}Forse già presa @Ashborne-lab l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
kubeflow/docs-agent#293 ·
I maintainer di solito rispondono entro 3 giorni
-
bug(mcp): release-date version rerank matches 1.1 against 1.10, v2.1.1 and 11.1Forse già presa @Aryan-Pardeshi l’ha presa 19 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubeflow/docs-agent#279 ·
I maintainer di solito rispondono entro 3 giorni
-
bug(mcp): Milvus search failures escape the tool boundaryForse già presa @sanjayy0612 l’ha presa 62 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
kubeflow/docs-agent#251 ·
I maintainer di solito rispondono entro 3 giorni
-
fix: update API server paths in README to point to legacy directoryForse già presa @pratik-naik003 l’ha presa 101 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
kubeflow/docs-agent#225 · 1 reazione ·
I maintainer di solito rispondono entro 3 giorni
-
Issues pipeline chunk_size (1500) exceeds the TEI embedding limit (1000) — tail of long chunks is unsearchableForse già presa @Sharkyii l’ha presa 134 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
kubeflow/docs-agent#216 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di kubeflow/docs-agent
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
splunk/security_content#4418 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug / Enhancement]: Improve teleop_robot CLI with configurable timeout, robust input validation, and clean ROS shutdownForse già presa @muskan-creates352 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Imbad0202/academic-research-skills#1093 ·
I maintainer di solito rispondono entro 1 giorno
-
Input: placeholder drawn in the text colour when the empty Input is focused but not yet editedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pierreaubert/gpui-toolkit#114 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Lightricks/LTX-2#336 · 1 commento ·