You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(chat): round-1 bug-hunt fixes, minus the superseded skip-notice hunk (rework of #299) - #569
Rework of #299 (kahme247, "fix(chat): round-1 bug-hunt fixes"), rebased onto current main (08717b6). The original PR was based on old main 7d0ce59 and its Windows CI failed; this branch carries the fixes that are still useful, minus the one hunk that has since been superseded.
This is a replacement for #561: that PR's branch could not be made mergeable by pushing resolved files to it (both sides inserted different blocks at the same anchor, so Git still conflicts), so this branch was recreated from current main with the same 8 files re-applied. #561 will be closed as superseded by this PR.
Dropped: ChatInput image skip-notice hunk
#299 added a chatInput.attachmentImagesSkipped notice when images were silently dropped (oversized / over the 10-image cap), plus components/ChatInput.image-skip-notice.test.mjs. That hunk is dropped, not ported:
feat(chat): attach any file up to 2 GiB, streamed in chunks to the session's host #371 has since reworked image attachment in components/ChatInput.tsx (processImageFiles / attachAsFiles): images now go inline while the inline budget has room and the rest go "As file" with an imagesAsFile notice, while oversized / over-limit file attachments are reported via attachmentUploadTooLarge / attachmentUploadLimit. There is no longer a silent-drop path for the old hunk to report on, and the attachmentImagesSkipped locale key it used does not exist on main.
The skip-notice test file is therefore not carried over either.
Kept fixes (3)
User-bubble overflow toggle re-measures on image load (components/MessageView.tsx): updateOverflow is hoisted out of the layout effect (via useCallback) and wired to the bubble image's onLoad. A late-loading image grows the bubble's scrollHeight past the 300px cap without resizing the capped box, so the ResizeObserver never fired and the "Show full input" toggle never appeared. Adapted to current main: the image is now a ClickableImage (lightbox wrapper), which forwards onLoad to its underlying <img>. Test added in components/MessageView.test.mjs.
Subagent transcript rows cap tool-call input at 400 chars (components/SubagentTranscriptDialog.tsx): the tool-call input JSON is sliced to the same 400-char budget plain-text rows already use, so a big file write/edit no longer freezes the dialog with one unbounded row. SubagentTranscriptRow is exported so the test can render it directly. Test added in components/SubagentTranscriptDialog.test.mjs.
Thinking-only finished replies are held on screen (lib/assistant-response.ts, hooks/useAgentSession.ts): new hasHoldableAssistantContent (visible content plus non-empty thinking) replaces hasVisibleAssistantContent in the message_end hold check, so a thinking-only reply is held until its saved copy lands instead of flickering away. Other call sites keep the stricter predicate. Tests added in lib/assistant-response.test.mjs (new) and hooks/useAgentSession.rpc.test.mjs.
Rebase notes
Only one file conflicted when re-applying #561 onto current main: components/MessageView.test.mjs — main had appended two collapse tests after the same anchor point #561 appended its image-load test to. Resolved by keeping main's two tests and appending #561's test after them. The other seven files applied cleanly. No CHANGELOG.md change: #561 carried none, so none was added. Main's later change to the same bubble area (text-only messages collapse to a one-line preview, image messages keep the 300px cap) is complementary, not conflicting.
No actionable comments were generated in the recent review.
Walkthrough
The changes remeasure user-message overflow after image loads, truncate tool-call input in assistant transcript rows, and retain completed thinking-only assistant replies while catch-up history is pending.
A shared overflow callback remeasures the user-message bubble when an image loads. A test checks that the “Show full input” control appears after an image increases the bubble’s height.
The session hook uses the predicate when deciding whether to hold a completed reply. A regression test checks that thinking content remains in streaming state when catch-up history does not include the saved reply.
This change fixes three small UI and session-handling behaviors: the overflow toggle after an image loads, truncation of long tool-call input in transcripts, and keeping thinking-only replies on screen until their saved copy arrives. Each has a regression test and no concrete risk was found, so it is ready to merge.
Security architecture risk: Minimal · up to 935b5
Completed thinking-only replies now stay visible while chat history catches up. The change affects what remains on screen; the review found no material change to who can access a conversation or what actions they can take.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The inspected change extends on-screen retention of thinking content already delivered to the active chat view. It does not add a delivery path or change the RPC manager's response accounting.
Trust Boundaries and Controls
observed — The stream callback rejects events from an obsolete event source or a different session. Selecting another history view resets the held state before fetching that view, and the fetch result is discarded if session, request, or run identity has changed.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Title check
The title has the form "fix(chat): ..." and names a bug-hunt fix set with a rework reference. The changeset does contain fixes in chat components: user-bubble overflow remeasurement on image load, cap…
Rewrite the title to name the primary change. For example: "fix(chat): remeasure user bubble overflow on image load and hold thinking-only replies". Drop the "round-1 bug-hunt" wording and the rework reference from the title. Move the rewor…
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title has the form "fix(chat): ..." and names a bug-hunt fix set with a rework reference. The changeset does contain fixes in chat components: user-bubble overflow remeasurement on image load, capping subagent transcript tool-call input at 400 characters, and holding thinking-only replies until history catches up. However, the title does not name any of these changes. "Round-1 bug-hunt fixes" is vague, and a reader cannot tell the primary change from it. The title also refers to a skip-notice hunk that was dropped, which adds noise. The title is therefore too generic to convey the main change, so the check is inconclusive.
Resolution
Rewrite the title to name the primary change. For example: "fix(chat): remeasure user bubble overflow on image load and hold thinking-only replies". Drop the "round-1 bug-hunt" wording and the rework reference from the title. Move the rework note to the description.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: f4f9e627-a029-41ca-a3f6-a2d41a4857bf
Commits
Reviewing files that changed from the base of the PR and between 08717b6 and 935b554.
Files selected for processing: 8
components/MessageView.test.mjs
components/MessageView.tsx
components/SubagentTranscriptDialog.test.mjs
components/SubagentTranscriptDialog.tsx
hooks/useAgentSession.rpc.test.mjs
hooks/useAgentSession.ts
lib/assistant-response.test.mjs
lib/assistant-response.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
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
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.
Rework of #299 (kahme247, "fix(chat): round-1 bug-hunt fixes"), rebased onto current main (08717b6). The original PR was based on old main 7d0ce59 and its Windows CI failed; this branch carries the fixes that are still useful, minus the one hunk that has since been superseded.
This is a replacement for #561: that PR's branch could not be made mergeable by pushing resolved files to it (both sides inserted different blocks at the same anchor, so Git still conflicts), so this branch was recreated from current main with the same 8 files re-applied. #561 will be closed as superseded by this PR.
Dropped: ChatInput image skip-notice hunk
#299 added a
chatInput.attachmentImagesSkippednotice when images were silently dropped (oversized / over the 10-image cap), pluscomponents/ChatInput.image-skip-notice.test.mjs. That hunk is dropped, not ported:components/ChatInput.tsx(processImageFiles/attachAsFiles): images now go inline while the inline budget has room and the rest go "As file" with animagesAsFilenotice, while oversized / over-limit file attachments are reported viaattachmentUploadTooLarge/attachmentUploadLimit. There is no longer a silent-drop path for the old hunk to report on, and theattachmentImagesSkippedlocale key it used does not exist on main.Kept fixes (3)
components/MessageView.tsx):updateOverflowis hoisted out of the layout effect (viauseCallback) and wired to the bubble image'sonLoad. A late-loading image grows the bubble'sscrollHeightpast the 300px cap without resizing the capped box, so theResizeObservernever fired and the "Show full input" toggle never appeared. Adapted to current main: the image is now aClickableImage(lightbox wrapper), which forwardsonLoadto its underlying<img>. Test added incomponents/MessageView.test.mjs.components/SubagentTranscriptDialog.tsx): the tool-call input JSON is sliced to the same 400-char budget plain-text rows already use, so a big file write/edit no longer freezes the dialog with one unbounded row.SubagentTranscriptRowis exported so the test can render it directly. Test added incomponents/SubagentTranscriptDialog.test.mjs.lib/assistant-response.ts,hooks/useAgentSession.ts): newhasHoldableAssistantContent(visible content plus non-empty thinking) replaceshasVisibleAssistantContentin themessage_endhold check, so a thinking-only reply is held until its saved copy lands instead of flickering away. Other call sites keep the stricter predicate. Tests added inlib/assistant-response.test.mjs(new) andhooks/useAgentSession.rpc.test.mjs.Rebase notes
Only one file conflicted when re-applying #561 onto current main:
components/MessageView.test.mjs— main had appended two collapse tests after the same anchor point #561 appended its image-load test to. Resolved by keeping main's two tests and appending #561's test after them. The other seven files applied cleanly. No CHANGELOG.md change: #561 carried none, so none was added. Main's later change to the same bubble area (text-only messages collapse to a one-line preview, image messages keep the 300px cap) is complementary, not conflicting.Tests run (fresh main tree,
bun test)lib/assistant-response.test.mjs,components/SubagentTranscriptDialog.test.mjs,components/MessageView.test.mjs: 92 pass, 0 failhooks/useAgentSession.rpc.test.mjs: 328 pass, 0 fail (includes the new thinking-only hold test)tsc --noEmit: pass, exit 0, no errorsNo ChatInput files are touched. Supersedes #561 and #299.
Summary by CodeRabbit