Skip to content

Add icon to truncate history at last tool call #6382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Jul 1, 2025

Builds on #6333 to add an icon for truncating chat history at a given message, to allow users to interrupt mid-long agent streams

image

Summary by cubic

Added an icon to tool call messages that lets users truncate chat history at that point.

  • New Features
    • Clicking the icon trims the chat to the selected tool call, removing later messages.

@RomneyDa RomneyDa requested a review from a team as a code owner July 1, 2025 19:36
@RomneyDa RomneyDa requested review from tomasz-stefaniak and removed request for a team July 1, 2025 19:36
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 1, 2025
Copy link

netlify bot commented Jul 1, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 20503cd
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/686438c2c6c68a0007bc507e

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic found 2 issues across 8 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@@ -319,7 +319,7 @@ export function Chat() {
inputId={item.message.id}
/>
</>
) : item.message.role === "tool" ? null : item.message.role ===
) : item.message.role === "tool" ? null : item.message.role === // /> // toolCallId={item.message.toolCallId} // contextItems={item.contextItems} // <ToolOutput
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline comments are left in the middle of a ternary expression, which can break code parsing and readability. Comments should not be placed within expressions like this.

Suggested change
) : item.message.role === "tool" ? null : item.message.role === // /> // toolCallId={item.message.toolCallId} // contextItems={item.contextItems} // <ToolOutput
) : item.message.role === "tool" ? null : item.message.role === "assistant" &&


if (state.history.length && index < state.history.length) {
state.codeBlockApplyStates.curIndex = 0;
state.history = state.history.slice(0, index + 1).concat({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeBlockApplyStates.states is not cleared when history is truncated, leaving stale apply-state entries that may refer to messages that were just removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant