gsxdsm
42009cfdb9
FN-7628: allow editing sent chat messages and rewinding agent responses
Adds the ability to edit a previously sent message in an agent chat, which rewinds the session/task room and regenerates the response from the edited message.
- Add chat-store support for locating/replacing a message and truncating subsequent history for a rewind
- Add a chat-manager rewind-session flow and a new register-chat-routes endpoint to rewind a room to an edited message
- Add legacy API route wiring and useChat hook support for issuing an edit request
- Add ChatView/StandardChatSurface/TaskPlannerChatTab UI affordances (edit control, styling) to trigger message edits
- Add a changeset documenting the new chat message-edit capability
- Add unit/integration tests covering chat-store rewind logic, chat-manager rewind-session behavior, chat routes, useChat, and ChatView edit UI
Files changed:
.changeset/fn-7628-chat-message-edit.md | 7 +
docs/dashboard-guide.md | 4 +
packages/core/src/__tests__/chat-store.test.ts | 171 ++++++++++++++
packages/core/src/chat-store.ts | 95 ++++++++
packages/dashboard/app/api/legacy.ts | 22 ++
packages/dashboard/app/components/ChatView.css | 78 ++++++
packages/dashboard/app/components/ChatView.tsx | 14 ++
.../app/components/StandardChatSurface.tsx | 87 ++++++-
.../app/components/TaskPlannerChatTab.tsx | 8 +
.../__tests__/ChatView.autosize.test.tsx | 1 +
.../__tests__/ChatView.default-model-icon.test.tsx | 1 +
.../components/__tests__/ChatView.draft.test.tsx | 1 +
.../__tests__/ChatView.hash-mention.test.tsx | 1 +
.../__tests__/ChatView.message-edit.test.tsx | 262 +++++++++++++++++++++
.../__tests__/ChatView.mobile-render.test.tsx | 1 +
.../components/__tests__/ChatView.rooms.test.tsx | 1 +
.../__tests__/ChatView.scroll-to-top.test.tsx | 1 +
.../components/__tests__/ChatView.test-harness.tsx | 1 +
.../dashboard/app/hooks/__tests__/useChat.test.ts | 98 ++++++++
packages/dashboard/app/hooks/useChat.ts | 60 +++++
.../__tests__/chat-manager-rewind-session.test.ts | 185 +++++++++++++++
.../dashboard/src/__tests__/chat-manager.test.ts | 12 +
.../dashboard/src/__tests__/chat-routes.test.ts | 124 ++++++++++
packages/dashboard/src/chat.ts | 147 +++++++++++-
.../dashboard/src/routes/register-chat-routes.ts | 52 ++++
25 files changed, 1429 insertions(+), 5 deletions(-)
Fusion-Task-Id: FN-7628
Fusion-Task-Lineage: 36d98989-1b75-428c-baf1-b2c7e8e78013
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-07 22:06:15 -07:00
..
2026-07-07 22:04:51 -07:00
2026-07-05 19:57:09 -07:00
2026-07-07 22:06:15 -07:00
2026-07-07 22:06:15 -07:00
2026-07-07 22:04:53 -07:00
2026-07-05 19:57:09 -07:00
2026-07-07 22:04:51 -07:00
2026-07-07 22:04:53 -07:00
2026-07-05 19:57:09 -07:00
2026-07-05 19:57:09 -07:00
2026-06-08 15:19:27 -07:00
2026-07-05 19:57:09 -07:00