Skip to content

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

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

kahme247 wants to merge 1 commit into
mainfrom
rework-pr-561-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 (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)

  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.

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 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 #561 and #299.

Summary by CodeRabbit

  • Bug Fixes
    • The “Show full input” control now appears when an image expands a message beyond its collapsed size.
    • Thinking-only assistant replies are retained while conversation history catches up, preventing them from disappearing temporarily.
  • Improvements
    • Tool-call details in assistant transcripts are limited to 400 characters, keeping long inputs from overwhelming the transcript.

@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 image loads, truncate tool-call input in assistant transcript rows, and retain completed thinking-only assistant replies while catch-up history is pending.

Changes: User-message image overflow

Layer / File(s) Summary
Image-load overflow remeasurement
components/MessageView.tsx, components/MessageView.test.mjs
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.

Transcript tool-call input

Layer / File(s) Summary
Tool-call input truncation
components/SubagentTranscriptDialog.tsx, components/SubagentTranscriptDialog.test.mjs
Tool-call input JSON in transcript rows is limited to 400 characters. A test checks the rendered output for a long patch input.

Thinking-only assistant replies

Layer / File(s) Summary
Holdable assistant content predicate
lib/assistant-response.ts, lib/assistant-response.test.mjs
The new predicate accepts visible assistant content or nonblank thinking content. Tests cover thinking, text, image, empty, tool-call-only, and non-assistant messages.
Completed reply catch-up handling
hooks/useAgentSession.ts, hooks/useAgentSession.rpc.test.mjs
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.

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

Change: Bug fix

Possibly related issues

Possibly related PRs

Suggested reviewers: andrebrait, gtanger

Merge Risk: Minimal · up to 935b5

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: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Inconclusive 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 Passed checks: 3 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 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 branch has not been deployed

No deployments
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