Skip to content

fix(chat): round-1 bug-hunt fixes, minus the superseded skip-notice hunk (rework of #299) - #561

Closed
kahme247 wants to merge 1 commit into
mainfrom
rework-pr-299-2026-11-23
Closed

kahme247 wants to merge 1 commit into
mainfrom
rework-pr-299-2026-11-23

Conversation

@kahme247

@kahme247 kahme247 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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)

  1. 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.
  2. 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.
  3. 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.

Tests run (fresh main tree, bun test --parallel)

  • lib/assistant-response.test.mjs, components/SubagentTranscriptDialog.test.mjs, components/MessageView.test.mjs: 90 pass, 0 fail
  • hooks/useAgentSession.rpc.test.mjs: 328 pass, 0 fail (includes the new thinking-only hold test)
  • tsc --noEmit: pass, exit 0, no errors

No ChatInput files are touched. Supersedes #299; #299 itself is left open for the coordinator to close once this replacement is verified.

Summary by CodeRabbit

  • Bug Fixes
    • User messages with images that load after rendering now correctly reveal the “Show full input” control when their content exceeds the display limit.
    • Thinking-only assistant replies remain visible while the conversation transcript catches up.
  • Improvements
    • Tool-call details in assistant transcripts are limited to 400 characters, keeping long inputs from taking over the view.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Transcript tool-call input

Layer / File(s) Summary
Truncate displayed tool-call input
components/SubagentTranscriptDialog.tsx, components/SubagentTranscriptDialog.test.mjs
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.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

Suggested reviewers: andrebrait, gtanger

Merge Risk: Minimal · up to 98a31

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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 8
  • Waived: $2.00 (charged $0.00)
  • View usage details

Note

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.

@kahme247

Copy link
Copy Markdown
Collaborator Author

Superseded by #569.

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.

@kahme247 kahme247 closed this Nov 23, 2026
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