fix(intelligent-assistant): sources chip on stream end and unknown route handling - #4860
Open
rohitratannagar wants to merge 2 commits into
Conversation
Parse trailing SSE end events for referenced_documents, merge persisted sources when the stream completes, and remount chat messages when source count changes so the sources chip appears without a page refresh. Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
rohitratannagar
requested review from
a team,
karthikjeeyar,
rohitkrai03 and
yangcao77
as code owners
September 17, 2026 17:41
Changed Packages
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4860 +/- ##
=======================================
Coverage 63.59% 63.60%
=======================================
Files 2685 2685
Lines 107076 107109 +33
Branches 29978 29976 -2
=======================================
+ Hits 68099 68126 +27
- Misses 37159 37165 +6
Partials 1818 1818
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Handle unrecognized paths under /intelligent-assistant with RBAC-aware redirect to LIGHTSPEED_PATH or a 404 when chat access is denied. Co-authored-by: Cursor <cursoragent@cursor.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
Notebook sources chip
Notebook chat did not show the RAG sources chip until the page was refreshed, even though the assistant response had finished and the server already had
referenced_documents.This change fixes three gaps in the live notebook path:
endframe soreferenced_documentsare applied even when the final chunk has no\n\ndelimiter.complete, merge sources from refetched conversation messages when the in-memory transcript is still missing them.MessageReact key soSourcesChipModalmounts when sources arrive after tokens stop.Root cause: The sources chip depends on
referenced_documentsfrom the SSEendevent and onendContentupdating on the last bot message. Trailing SSE data could be dropped onreader.done, and the message component did not remount when onlysourceschanged (content unchanged), so the chip appeared only after a full reload from the API.Unknown Intelligent Assistant URLs
Visiting an unrecognized path under
/intelligent-assistant(for example/intelligent-assistant/sdc) previously rendered a blank screen.The plugin router now catches unknown subpaths and:
/intelligent-assistantwhenintelligent-assistant.chatis allowed (usesLIGHTSPEED_PATH, not app root/).Test Plan
/intelligent-assistant/<unknown>with chat allowed — should land on/intelligent-assistantwith the chat UI./intelligent-assistant/<unknown>without chat permission — should show Backstage 404.Checklist