TUI attachments live in the composer, not above the status bar - #75210
Merged
Conversation
A collapsed paste and an attached image are the same idea: a `[[ … ]]` marker sitting in the input line that stands in for a payload resolved at submit. Model both as ComposerToken and give them one expander. Image tokens resolve to nothing — the gateway already holds the file in attached_images — so expandTokens eats an adjacent space to avoid leaving a gap mid-sentence. nextImageIndex never reuses an index after a delete, or two files would collide on one label.
…attach Every attach path now drops an `[[ Image N ]]` token where you are typing: drag-drop, clipboard (bracketed and hotkey), /image, /paste. The composer owns clipboard attach directly instead of calling back out to useMainApp. Deleting the token is how you unattach — there is no second control. updateInput is the one choke point every keystroke passes through, so syncTokens reconciles there and detaches anything erased. That also fixes a stale image riding along on the next unrelated turn. Tokens and the input line get refs alongside state: paste-then-immediately -Enter submits before React has re-rendered, and the submit path has to see the token that was just added.
The token in the input line is the whole receipt. Drop the notices that duplicated it somewhere the user was not looking: the drag-drop and clipboard sys() lines, and the attachedImageNotice / "detected file: X" activity rows above the status bar. attachedImageNotice and imageTokenMeta have no callers left.
Contributor
૮ >ﻌ< ა ci reviewran on 22af266 ℹ️ InfoDesktop E2E visual evidence · View test artifacts · View job1 visual diff. inline evidence upload failed. Failed to upload diff-665a0833239e-onboarding-overlay-diff.png with gh image (exit code 1): Error uploading /home/runner/work/_temp/e2e-evidence/diff-665a0833239e-onboarding-overlay-diff.png: step 0 (get upload token): uploadToken not found on repo page — do you have write access to NousResearch/hermes-agent? (or, if NousResearch enforces SAML SSO, authorize at https://github.com/orgs/NousResearch/sso) |
5 tasks
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…achments TUI attachments live in the composer, not above the status bar
33hodl
pushed a commit
to 33hodl/hermes-agent
that referenced
this pull request
Aug 12, 2026
…achments TUI attachments live in the composer, not above the status bar
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.
Summary
Attachments in the TUI behaved nothing like pastes. Attaching an image printed a
📎 Attached image: shot.png · 1920x1080 · ~1.2k tokline somewhere above the status bar and left the composer untouched, so the only evidence of the attachment lived outside the input you were editing — and sometimes text appeared in the composer anyway, from aremainderfield that got spliced in on its own with no visible cause.A collapsed paste and an attached image are the same idea: a
[[ … ]]marker sitting in the input line that stands in for a payload resolved at submit. This models both as oneComposerTokenwith one expander, so attachments get paste's ergonomics for free.Before / after
[[ Image 1 ]]inline at the cursorremainderinsert)Every attach path now lands in the same place:
sys()notice + maybe a stray insert📎 Image #2 attached from clipboard/image <path>setInput(remainder)/pastedetected file: Xactivity rowNotes
updateInputis the one choke point every keystroke passes through, sosyncTokensreconciles there and firesimage.detachfor anything erased. That also fixes a stale image riding along on the next unrelated turn.attached_images. The expander eats one adjacent space so a token removed mid-sentence doesn't leave a gap.attachedImageNoticeandimageTokenMetahave no callers left and are gone.Test plan
npx tsc --noEmitcleannpx eslintclean on every touched file__tests__/attachments.test.ts— expansion ordering, image-token elision without double spaces, index allocation after deletes, drop detectionsyntax,subscriptionOverlay,createGatewayEventHandler,ink-backpressure) reproduce identically on a cleanorigin/mainworktree and touch nothing in this diff — 0 added failures.[[ Image 1 ]]at the cursor and no notice/pastewith a screenshot, then Enter immediately — token must resolve