fix(tui): expand collapsed paste tokens before submission - #75565
Merged
Conversation
The interpolation branch of dispatchSubmission passed the pre-interpolation
composer text as the transcript display, so a paste token combined with a
visible {!...} rendered the literal interpolation syntax instead of the
resolved output main shows today. Pass interpolate()'s resolved text as the
display override: it still carries the compact paste label while the model
payload expands the paste. Add a dispatch-level regression for the combined
interpolation + collapsed-paste route.
Co-authored-by: teknium1 <teknium1@users.noreply.github.com>
5 tasks
Contributor
૮ >ﻌ< ა ci reviewran on 8c13dff ℹ️ InfoDesktop E2E visual evidence · View test artifacts · View job3 visual diffs. inline evidence is publishing... |
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…ch#75565) * fix(tui): expand collapsed paste tokens before submission * fix(tui): show resolved interpolation, not raw {!...}, with paste tokens The interpolation branch of dispatchSubmission passed the pre-interpolation composer text as the transcript display, so a paste token combined with a visible {!...} rendered the literal interpolation syntax instead of the resolved output main shows today. Pass interpolate()'s resolved text as the display override: it still carries the compact paste label while the model payload expands the paste. Add a dispatch-level regression for the combined interpolation + collapsed-paste route. Co-authored-by: teknium1 <teknium1@users.noreply.github.com> --------- Co-authored-by: UltraInstinct0x <gokhansarapevi@gmail.com> Co-authored-by: teknium1 <teknium1@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this is
Multiline pastes collapse into a
[[ … ]]composer token, but ordinary idle TUI submission sent that literal token to the agent instead of the pasted content. This carries #75387 forward onto currentmainand resolves the review feedback on it.Root cause
dispatchSubmission()callsclearIn(), which synchronously emptiestokensRef.current(paste state moved from React state to refs in #75210). The latersend(full)then rebuilt its expander from an empty token list, so the collapsed[[ … ]]label reachedprompt.submitunchanged.Fix
clearIn(), expand the model payload from that snapshot, and keep the collapsed token as transcript display text.{!…}copied inside pasted content stays inert.{!…}shows resolved output rather than the literal syntax — preserving currentmainbehavior.Complements the queued-paste fix in #74797 (already on
main); the queue path is unchanged here.Verification
npm run typecheck— cleannpm run lint(touched files) — cleannpx vitest run src/__tests__/useSubmission.test.ts src/__tests__/queueSubmission.test.ts src/__tests__/attachments.test.ts src/__tests__/submissionCore.test.ts— 29 passedCredit
Supersedes #75387 by @UltraInstinct0x (original fix + tests, authorship preserved in the first commit). Display fix and combined-route regression from @teknium1's review.