Repository navigation
feat(chat): switch between versions and regenerate answers in the web app - #471
Merged
Merged
Conversation
A conversation is now a tree: chat_message.parent and chat.head. Regenerate
writes a new answer beside the old one, edit makes a new version of a question
beside it instead of deleting what followed, and parent goes on from any
message. GET /chats/{cid} adds tree, head and each message's versions; PUT
/chats/{cid}/head switches. The model reads only the version showing; a
summary written on another version is ignored and rewritten for this one.
Upgrade step chat-tree lines existing conversations up, safe to run twice.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
… app
A question or an answer with versions shows ‹ 2 / 3 › to move between them
(arrow keys too); a version already seen shows at once, then PUT
/chats/{cid}/head saves it. Regenerate (and Regenerate with… another model)
replaces Try another model and streams the new answer in place, as does an
edit. The next question goes on from the version showing, and approvals show
in the version they were proposed in.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
The last check asked for 2026-10-17's note after the call without a date had made today's note, so on that day it found the note the deleted root had left behind. It now asks for a day no earlier call makes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HXPWXcSCQb9hWPr7xkZu7B
…-r960xc-c2-ui # Conflicts: # CHANGELOG.md # docs/assistant.md
# Conflicts: # CHANGELOG.md
19 of 22 tasks
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.
Requested by Adeel · project thread
Description
Stacked on #467 (versions in the backend). Until #467 merges, this diff includes its commit. After that, only the web app commit and a cherry-picked test fix remain.
Before: "Try another model" asked the question again as a new pair at the end of the conversation. Edit said it would replace the answer and everything after it. There was no way to see earlier versions.
After:
‹ 2 / 3 ›appears under a question or an answer that has versions. It moves between them, and so do the arrow keys while it has focus. Each version shows what followed it.PUT /chats/{cid}/headsaves the choice. A version not seen yet loads from that call.parent= the last message shown).treetimestamps./clearand/compactreplies get no Regenerate, since the model never answered them.How:
components/chat/versions.tsxholds the switch and pure tree helpers (versionsOf,newestBelow,lineage,switched) that mirror the backend.chat-app.tsxpassesregenerate/edit/parentand switches the version. The answer being written streams in place of the message it is a version of (live.beside).Also cherry-picks f6fd6c7 from #470 (
test_daily_notesfailed on 2026-10-17). It drops out once #470 is in main.Motivation and Context
Part of the chat gaps Adeel listed: regenerate, navigating the response tree, and carrying on from any version. This is module C2 of the plan, web app part.
Screenshots (if appropriate):
Steps to reproduce (if appropriate):
‹ 2 / 2 ›appears under it.‹. The first answer shows again, with what followed it.‹ 2 / 2 ›appears under it.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
regenerate,edit,parent,PUT /chats/{cid}/head).docs/assistant.md› Versions, Choosing the model) and the CHANGELOG describe what's built.__tests__/chat-versions.test.tsxcovers the tree helpers, the switch (arrows, keys, ends) and Regenerate with its model menu. The docs are updated, and there is no API change here.Generated by Claude Code