Skip to content

fix(tui): echo the expanded paste, not the [[ … ]] label - #951

Merged
ericleepi314 merged 1 commit into
mainfrom
fix/tui-paste-echo-expand
Sep 23, 2026
Merged

ericleepi314 merged 1 commit into
mainfrom
fix/tui-paste-echo-expand

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Problem

Pasting a long query collapses it in the composer to [[ Create a persist.. [14 lines] .. ard for follow-up questions. ]]. On submit the backend got the expanded text, but the transcript echo showed the label.

Fix

  • useSubmission.send echoes the expanded text. User rows over 10k chars render CC-style (UserPromptMessage.tsx): 2.5k head + … +N lines … + 2.5k tail. virtualHeights estimates on the same truncation.
  • /retry now re-sends the expanded text; before, it sent the bare label after clearIn() had dropped the snippets.
  • Busy, no-session, steer-rejected and session busy submits used to lose the paste. The queue keeps the label, and its snippets are carried in a ref until the message is sent. This way {!cmd} interpolation in sendQueued never runs over pasted content.

Tests

  • New useSubmissionPasteEcho.test.ts has 9 tests. 6 of them fail on the old useSubmission.ts.
  • tsc is clean.
  • The full vitest suite has the same 8 failures that are already on main (createGatewayEventHandler, cursorDriftRegression, statusRule, useConfigSync, virtualHeights compound-width).
  • The critic subagent approved the core fix and the busy/steer path. The session busy re-queue fix and its tests were added after that approval and were not re-reviewed.

Follow-ups (not in this PR)

  • History recall (↑) holds the label, and its snippets are gone.
  • carriedSnips isn't cleared on session new/resume. It's capped at 32 snippets / 4 MB.
  • A paste starting with {!…} puts an interpolation token into the label (edge preview).

🤖 Generated with Claude Code

A collapsed paste was expanded for prompt.submit but the transcript echo
kept the composer label. Echo the expanded text (capped CC-style at 10k
chars: 2.5k head + '… +N lines …' + 2.5k tail) and estimate row heights
on the same truncation.

Same bug class fixed along the way:
- /retry re-sent the label (lastUserMsg stored the unexpanded text).
- busy / no-session / steer-rejected / 'session busy' submits lost the
  paste once clearIn() dropped the snippets. The queue keeps the LABEL
  and its snippets are carried until sent, so {!cmd} interpolation never
  runs over pasted content.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit dc2266d into main Sep 23, 2026
6 of 7 checks passed
@ericleepi314
ericleepi314 deleted the fix/tui-paste-echo-expand branch September 23, 2026 20:27
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