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) - #561
Rework of #299 (kahme247, "fix(chat): round-1 bug-hunt fixes"), rebased onto current main (5d7232a). 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.
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.
No actionable comments were generated in the recent review.
Walkthrough
The changes remeasure user-message overflow after images load, limit displayed tool-call input in transcript rows, and retain thinking-only assistant replies during transcript catch-up.
Changes: Image overflow measurement
Layer / File(s)
Summary
Remeasure overflow after image load components/MessageView.tsx, components/MessageView.test.mjs
UserMessageView shares an overflow-measurement callback between its layout effect and image load events. A test checks that loading an image reveals the “Show full input” control when content exceeds the height limit.
Tool-call input JSON is truncated to 400 characters in transcript rows. A test checks that a long input does not produce a similarly long rendered output.
Thinking-only assistant replies
Layer / File(s)
Summary
Recognize and retain holdable replies lib/assistant-response.ts, lib/assistant-response.test.mjs, hooks/useAgentSession.ts, hooks/useAgentSession.rpc.test.mjs
hasHoldableAssistantContent recognizes nonblank thinking content as holdable. useAgentSession uses the predicate to retain a completed thinking-only reply during catch-up. Tests cover the predicate and the catch-up behavior.
This change remeasures user-message overflow when images load, caps displayed tool-call input in transcript rows, and keeps thinking-only replies visible until their saved copy arrives. No concrete defects were found, so the merge risk is minimal.
Security architecture risk: Minimal · up to 98a31
Thinking-only replies can now stay visible in the same conversation while history catches up. The reviewed changes do not establish a new access path or materially weaken how failures are contained.
Retained concerns
No architecture-level concerns identified.
Security review details
Trust Boundaries and Controls
observed — Tool-call input still reaches a JSX text child, not a tool invocation or raw HTML sink. Truncation happens after serialization, so it limits displayed text but does not bound serialization work or redact sensitive values.
Resilience and Maintainability Implications
observed — Terminal handling still reports errors and reloads session history. The end action does not itself clear a held reply, so a failed reload or missing saved copy can leave the reply in the current view until a later matching commit, stream update, or reset.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names a fix in the chat area and says it is a rework of #299 that leaves out the superseded skip-notice hunk. The changeset covers three fixes: image-load overflow re-measurement in the user…
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 names a fix in the chat area and says it is a rework of #299 that leaves out the superseded skip-notice hunk. The changeset covers three fixes: image-load overflow re-measurement in the user bubble, a 400-character cap on subagent tool-call input, and holding thinking-only finished replies until the saved copy arrives. The title does not name these three fixes, so it is only partially related. It is also not a vague title, because it uses the 'round-1 bug-hunt' label and refers to a rework that a teammate can trace in history. The title is long (89 characters) and does not state the main change directly.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
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: bbc50330-83ef-4144-b17b-fc018b580755
Commits
Reviewing files that changed from the base of the PR and between 5d7232a and 98a3105.
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
Limit details: You’ve used all 10 included reviews currently available.
This 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 even with main's content already on the branch tip. The branch was therefore recreated from current main (08717b6) as rework-pr-561-2026-11-23 with the same 8 files re-applied (only components/MessageView.test.mjs needed manual resolution — main's two collapse tests kept, #561's image-load test appended after them), tests re-run green (420 pass, 0 fail; tsc --noEmit clean), and opened as #569. Closing this PR as superseded; please review #569 instead.
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 (5d7232a). 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.
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.Tests run (fresh main tree,
bun test --parallel)lib/assistant-response.test.mjs,components/SubagentTranscriptDialog.test.mjs,components/MessageView.test.mjs: 90 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 #299; #299 itself is left open for the coordinator to close once this replacement is verified.
Summary by CodeRabbit