feat(flow-chat): preserve composer references in message history - #1747
Merged
Conversation
- persist structured composer presentation metadata for sent messages - render file, session, skill, and widget references as historical message capsules - restore reference capsules on rollback and failed-message refill - use ordered [session-ref:N] markers with bounded session names in backend reminders - support atomic reference editing and rebuild reference metadata before rerun - keep legacy messages compatible through plain-text fallback - add focused frontend and Rust coverage
- define the missing JSDOM scrollIntoView API before each dialog test - prevent unhandled errors when editing a saved SSH connection
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.
Summary
Preserve rich composer references across sent-message rendering, rollback, failed-message refill, and historical message editing.
Type and Areas
Type:
Feature / UI/UX / regression fix / test
Areas:
Web UI, Rust core
Motivation / Impact
User messages now retain structured file, session, skill, and widget references as capsules instead of exposing internal prompt tags.
Session references are represented in model-visible text as
[session-ref:N]. The backend reminder table maps each marker to a bounded session name and transcript artifact while treating both as untrusted historical content.Historical messages with references can be edited through a rich-text editor. Existing capsules remain atomic, files and sessions can be added through
@, and saving rebuilds the model prompt and reference metadata.Legacy history without presentation metadata continues to render as plain text.
Verification
pnpm --dir src/web-ui run test:run src/flow_chat/components/modern/UserMessageEditComposer.test.tsx src/flow_chat/components/modern/UserMessageItem.test.tsx src/flow_chat/components/RichTextInput.test.tsx src/flow_chat/utils/composerPresentation.test.tspnpm run type-check:webpnpm run theme:color-audit:allcargo test -p bitfun-core --lib session_reference_display_name_normalizes_escapes_and_truncates -- --nocapturecargo check -p bitfun-corecargo check --workspacesrc/apps/cli/src/account.rs:721(tokio::spawn, E0275).Reviewer Notes
Checklist