fix: address review of Tencent/WeKnora#2514 RAG answer wait status - #43
Draft
lyingbug wants to merge 2 commits into
Draft
fix: address review of Tencent/WeKnora#2514 RAG answer wait status#43lyingbug wants to merge 2 commits into
lyingbug wants to merge 2 commits into
Conversation
… RAG wait row The wait row only appeared once a completed knowledge_search step existed, so attachment-only turns (attachment_parsing / image_analysis with no KB hit) still showed nothing between the last step and the first answer token. Model waiting is now a three-state kind: 'model' after retrieval finished, the neutral 'preparing' row otherwise. A dropped SSE connection never sets is_completed (the stream layer only raises a toast), so the row used to promise an answer forever. It now stops claiming progress after RAG_WAIT_STALL_DELAY_MS and drops the shimmer. Also share RAG_RETRIEVAL_TOOL_NAMES instead of repeating the knowledge_search / search_knowledge alias check, name the reveal delay, and move the reveal/stall timers into a controller with an injectable scheduler so the timing is covered by tests instead of by source-matching alone. Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
role="status" lived on the wait row itself, so the live region was inserted together with its own text and screen readers had nothing to announce. Move the announcement to an sr-only region that stays mounted for the whole turn, which also covers the pre-pipeline wait row that had no announcement at all. Co-authored-by: lyingbug <lyingbug@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up commits for the code review of Tencent/WeKnora#2514.
cursor[bot]has no push access to the PR head branch (ttommybot:fix/rag-answer-wait-status—maintainerCanModifyis a permission granted to maintainer accounts, not to this app installation), so these commits sit on a branch based on the PR head (dc17ffd4). The base of this PR is that same PR head, so the diff shown here is only the follow-up. Ready-to-apply patches are attached to the agent run as0001-*.patch/0002-*.patch(git am).fix(frontend): cover attachment-only turns and stalled streams in the RAG wait rowknowledge_searchstep, so attachment-only turns (attachment_parsing/image_analysiswith no KB hit — a caserag-pipeline-history.tsexplicitly documents) still showed nothing between the last step and the first answer token. Waiting is now a three-state kind:modelonce retrieval finished, the neutralpreparingrow otherwise.is_completed(streame.tsonerroronly raises a toast), so the row promised an answer forever. It now stops claiming progress afterRAG_WAIT_STALL_DELAY_MSand drops the shimmer.RAG_RETRIEVAL_TOOL_NAMESinstead of repeating theknowledge_search/search_knowledgealias check, which was dead in the timeline context becauseRAG_TIMELINE_TOOL_NAMESnever contains the alias.250, and renames the near-identicalshowModelAnswerWait/shouldShowModelAnswerWaitpair.fix(frontend): announce RAG wait status from a persistent live regionrole="status"lived on the wait row itself, so the live region was inserted together with its own text and screen readers had nothing to announce. The announcement now lives in ansr-onlyregion that stays mounted for the whole turn, which also covers the pre-pipeline wait row that had no announcement at all.Type of Change
Related Issue
Follow-up to Tencent#2514.
Testing
npm testinfrontend/: 307 passed, 0 failed (7 new, covering the three wait kinds plus debounce, in-place label swap, per-phase stall budget, and timer disposal against a fake clock).npm run type-check: clean.npm run build: clean.git diff --check: clean.Checklist
git diff --check origin/main...HEADpassesgolangci-lint run --new-from-rev=origin/main ./...) — frontend-only changedocs/, Swagger annotations, etc.)Screenshots / Recordings
Wait rows immediately after retrieval completes. Panel 2 (retrieval still running) and panel 5 (answer streaming) correctly show no wait row; panel 4 is the attachment-only turn that previously showed nothing.
RAG wait rows right after retrieval completes
Same page 83 seconds in, with no answer ever arriving: panels 3 and 4 stop claiming progress and switch to the neutral stalled message.
RAG wait rows after the stall timeout
To show artifacts inline, enable in settings.