Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements a comprehensive conversation branching system that enables users to edit messages and create alternative conversation paths, along with adding support for new GPT-5 models and reasoning display features. The implementation spans both frontend (React/TypeScript) and backend (Go) with protocol buffer schema updates.
Key changes:
- Implements conversation branching architecture with Branch struct for tracking edit history
- Adds GPT-5.1, GPT-5.2, and GPT-5.2 Pro model support with pricing information
- Introduces reasoning token display for AI responses with streaming support
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
internal/models/conversation.go |
Adds Branch struct and methods for branch management, migration from legacy format |
internal/api/chat/create_conversation_message_stream_v2.go |
Updates message streaming to use branches, handles parent message IDs for edits |
internal/api/mapper/conversation_v2.go |
Maps conversation model to proto with branch selection support |
internal/api/chat/get_conversation_v2.go |
Supports optional branch_id parameter for retrieving specific branches |
internal/api/chat/list_supported_models_v2.go |
Adds GPT-5.x model definitions with context sizes and pricing |
proto/chat/v2/chat.proto |
Adds BranchInfo, reasoning field, ReasoningChunk, and parent_message_id |
pkg/gen/api/chat/v2/*.go |
Generated Go code from proto changes |
webapp/_webapp/src/components/branch-switcher.tsx |
New UI component for navigating between conversation branches |
webapp/_webapp/src/components/message-entry-container/user.tsx |
Adds message editing interface with edit button and textarea |
webapp/_webapp/src/components/message-entry-container/assistant.tsx |
Displays reasoning content in expandable card format |
webapp/_webapp/src/hooks/useSendMessageStream.ts |
Handles parentMessageId for branching, truncates messages client-side |
internal/services/toolkit/handler/stream_v2.go |
Adds HandleReasoningDelta for streaming reasoning tokens |
internal/services/toolkit/client/completion_v2.go |
Parses reasoning_content and reasoning fields from streaming responses |
webapp/_webapp/src/stores/conversation/handlers/handleReasoningChunk.ts |
New handler for processing reasoning chunks in streaming messages |
| Multiple handler files | Removes "openai_" prefix from message IDs for cleaner identifier format |
webapp/_webapp/src/views/settings/*.tsx |
Reduces label text size from text-sm to text-xs |
webapp/_webapp/src/main.tsx |
Adds URL patterns to Faro monitoring ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const handlePrevious = () => { | ||
| if (currentIndex <= 1) return; | ||
| const prevBranchId = branches[currentIndex - 2]?.id; | ||
| if (prevBranchId) { | ||
| switchToBranch(prevBranchId); | ||
| } | ||
| }; | ||
|
|
||
| const handleNext = () => { | ||
| if (currentIndex >= totalBranches) return; | ||
| const nextBranchId = branches[currentIndex]?.id; | ||
| if (nextBranchId) { | ||
| switchToBranch(nextBranchId); | ||
| } | ||
| }; |
There was a problem hiding this comment.
The component should handle the case where conversation.branches array length doesn't match conversation.totalBranches. If the arrays are out of sync, accessing branches[currentIndex - 2] or branches[currentIndex] could return undefined even when the navigation should be valid, or conversely allow navigation when it shouldn't be possible.
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
related to #71 |
…ches (#80) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Junyi-99 <14367694+Junyi-99@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 32 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Updated CreateNewBranch method to return an error if the parent message is not found, enhancing error handling. - Modified appendConversationMessage to handle errors from CreateNewBranch. - Added migration logic for legacy data to branch structure in GetConversation and ListConversations, ensuring stability of branch IDs. - Introduced HandleAssistantPartBegin to manage assistant message streaming more effectively. - Enhanced conversation state update in the frontend to prevent stale data application during asynchronous updates.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…conversation preparation - Added '.claude' to .gitignore to exclude specific files from version control. - Refactored conversation preparation logic in both V1 and V2 to use a local variable for project instructions, improving code clarity. - Updated toolkit client to register file and LaTeX tools with project service injection, enhancing functionality. - Modified error messages in file and folder tools to indicate unimplemented features.
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This pull request introduces significant improvements to the conversation branching system, adds support for new GPT-5 models, and refines how conversations and their branches are managed and returned via the API. The main changes include implementing a robust branching mechanism for chat conversations, updating the API to support branch selection and history, and expanding the list of supported language models.
Conversation Branching and API Enhancements:
Branchstruct toConversationinmodels/conversation.go, enabling multiple branches per conversation for edit history, and migrated legacy fields for backward compatibility.create_conversation_message_stream_v2.goto append messages to the correct branch, support branch creation on message edits, and ensure all API methods use the active or specified branch for chat history and LLM calls. [1] [2] [3] [4] [5] [6] [7]mapper/conversation_v2.goto allow explicit branch selection, include branch metadata in API responses, and ensure backward compatibility with legacy conversations. [1] [2]GetConversationAPI to allow branch selection via abranch_idparameter, returning the correct branch's history and metadata.Supported Models Expansion:
Other Changes:
Note
Implements multi-branch conversations across backend, API, and UI, adds reasoning streaming, and expands model support.
Branchmodel and per-branch histories; editing a message creates a new branch viaparent_message_id; use active branch for LLM calls; migrate legacy data withEnsureBranches;GetConversation/ListConversationssupport branch selection and return branch metadata; mapper updated to includebranches,current_branch_id, indicesBranchInfo, branch fields onConversation,branch_idonGetConversationRequest,parent_message_idon streaming request; addReasoningChunkand optional assistantreasoning; normalize message IDs (removeopenai_prefix)branchIdingetConversation; minor UI/UX tweaks (prompt picker visibility, settings text size, drag shadow)Written by Cursor Bugbot for commit 25dfd0c. This will update automatically on new commits. Configure here.