Skip to content

Improve clipboard image pasting and upload performance over SSH - #745

Open
avafloww wants to merge 1 commit into
gnachman:masterfrom
avafloww:codex/ssh-image-paste
Open

avafloww wants to merge 1 commit into
gnachman:masterfrom
avafloww:codex/ssh-image-paste

Conversation

@avafloww

@avafloww avafloww commented Sep 8, 2026

Copy link
Copy Markdown

Clipboard screenshots commonly arrive as TIFF, which remote coding agents may not accept. This improves the existing “Upload and Paste Path” action by converting TIFF/other bitmap formats to PNG, preserving supported compressed formats, and giving pasted images unique filenames. Uploads resolve the SSH Integration conductor through tmux control-mode gateways and can use its home directory before shell integration reports a working directory, including inside ordinary tmux. Successful uploads paste the actual destination after collision renaming; cancelled or obsolete completions cannot paste a path into a different session/connection.

SSH Integration uploads now send sequential 16 KiB chunks instead of 1 KiB. A 490 KiB image requires 31 append requests instead of 490. The included benchmark runs the real remote framer over an SSH PTY: measured upload time fell from approximately 4.2 seconds to 1.4–1.7 seconds, with SHA-256 verification. Larger 64 KiB chunks took approximately 3 seconds because of parser overhead. Cancellation now cleans up temporary files, handles cancellation during the final rename, and avoids leaving finished transfers in “Cancelling…”.

Validation:

  • Development build succeeded locally.
  • ConductorUploadTests: 5 passed, covering chunk boundaries, byte preservation, progress, cancellation, and append errors.
  • NonTextPasteImageTests: 3 passed; NSStringQuotedStringForPasteTests: 22 passed.
  • Clipboard image upload/paste manually confirmed over SSH Integration with ordinary tmux. The tmux control-mode gateway path has not been manually exercised.
  • python3 tests/benchmark_conductor_upload.py <host> verified synthetic uploads across 1, 4, 8, 16, 32, and 64 KiB chunk sizes.
  • git diff --check passed.

Local build/test validation used separate Xcode 27 compatibility changes and rebuilt dependencies. Those changes, generated binaries, and local fish/it2ssh setup are excluded from this PR; the isolated PR branch has not been built independently with an older toolchain. Release notes and the new localized error string are included.

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