Repository navigation
Show images uploaded to a macOS host in the chat instead of their paths - #606
Open
thiblahute wants to merge 1 commit into
Open
thiblahute wants to merge 1 commit into
thiblahute wants to merge 1 commit into
Conversation
macOS's TMPDIR ends with a slash, so an image uploaded through SSH to a macOS host got a path like `/var/folders/.../T//roamgate-uploads-501/...`. The chat only recognises an uploaded image by a path with single separators, so it showed that path as text instead of the image. The remote upload script now strips TMPDIR's trailing slashes, so the path sent to the agent is clean, and the chat also recognises the doubled slash in paths uploaded before.
This branch has not been deployed
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
Show an image uploaded to a macOS host in the chat, not its path.
Why
macOS's
TMPDIRends with a slash (/var/folders/.../T/), so an image uploaded through SSH to a macOS host got a path with a doubled slash:/var/folders/.../T//roamgate-uploads-501/upload-.../img-....png. The chat only recognises an uploaded image (messageImagePieces, #562) by a path with single separators, so it showed that path as text.What changed
server/src/http/terminal-upload.ts: the remote upload script stripsTMPDIR's trailing slashes before building the upload root, so the path sent to the agent is clean.web/src/chatImages.ts: the uploaded-image pattern also accepts repeated separators, so images uploaded before this change still show.Verification
bun test server/src/http/terminal-upload.test.ts web/src/chatImages.test.ts: new tests "the remote script's path has no doubled slash when TMPDIR ends with one" and "takes a remote macOS upload, whose TMPDIR ends with a slash"; both fail onmain.bun run format:check,bun run lint,bun run typecheck:bun,bun run build:web,bun run test:quickwith an isolatedHOME/TMPDIR.Manual checks
//.