Skip to content

fix: should ensure anthropic thinking signature exit#1477

Merged
looplj merged 1 commit into
unstablefrom
dev-tmp
Apr 24, 2026
Merged

fix: should ensure anthropic thinking signature exit#1477
looplj merged 1 commit into
unstablefrom
dev-tmp

Conversation

@looplj

@looplj looplj commented Apr 24, 2026

Copy link
Copy Markdown
Owner

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request improves the ChunksDialog component by using a ref to track the current page, preventing manual navigation from being reset during live updates. It also updates the Anthropic inbound stream logic to ensure a signature is always provided for thinking blocks, generating a random placeholder if necessary and concatenating multiple signature chunks. Feedback was provided regarding the auto-scroll logic in the ChunksDialog, specifically that jumping to the last page when the user is on the first page might disrupt the user experience.

const newTotalPages = Math.ceil(chunks.length / pageSize);
if (chunksPage >= totalChunksPages || chunksPage === 1) {
// totalChunksPages is already re-computed in this render (depends on chunks.length + pageSize)
if (chunksPageRef.current >= totalChunksPages || chunksPageRef.current === 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The condition chunksPageRef.current === 1 in the auto-scroll logic causes the view to jump to the last page whenever a new chunk arrives, even if the user is intentionally viewing the first page. This disrupts the user experience when reading from the beginning of a live stream. Consider removing this condition to ensure that auto-scroll only triggers when the user is already at the end of the list.

Suggested change
if (chunksPageRef.current >= totalChunksPages || chunksPageRef.current === 1) {
if (chunksPageRef.current >= totalChunksPages) {

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@looplj looplj merged commit 784a9a6 into unstable Apr 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant