feat(chatgpt-app): add temporary chat and multi-modal image attachment support#1783
Merged
jackwener merged 2 commits intoMay 31, 2026
Merged
Conversation
51b1f9c to
ae2c873
Compare
Contributor
Author
|
Hi @jackwener, I have created this PR to add two key capabilities to the native macOS
Key Technical Safeguards & Enhancements:
All 3,450 adapter and commands unit tests pass successfully. Please take a look when you have a moment! |
ae2c873 to
66dd80f
Compare
…t support with clipboard and process protection
66dd80f to
07f2858
Compare
d3f982f to
0c945c4
Compare
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.
PR Title:
feat(chatgpt-app): add temporary chat and multi-modal image attachment supportDescription
This Pull Request introduces two major features to the macOS ChatGPT Desktop App adapter (
chatgpt-appCLI):--temp): Provides a privacy-isolated session within the desktop client.--image): Adds Vision capabilities by programmatic image attachment.Both features have been built using Cocoa's native frameworks, macOS Accessibility APIs (
osascript& Swift),NSPasteboard, and QuartzCGEventsimulation. They include robust safeguards to prevent clipboard data loss, ensure event targeting isolation, eliminate thread-blocking delays, and resolve cross-platform/localization inconsistencies.Usage Examples & Console Outputs
1. Launch a New Privacy-Protected Temporary Chat
Console Output:
(Result: The native ChatGPT macOS client is brought to the foreground, and a New Temporary Chat is successfully started under a Chinese or English UI system. All conversations inside this mode are private and will not be saved in your chat history.)
2. Send local image file for Vision analysis
Console Output:
(Result: The local image file is securely loaded, your clipboard contents are fully backed up, the image is pasted directly into ChatGPT's input area, the clipboard is restored back to its original state, and ChatGPT's multimodality answers your prompt successfully.)
Key Enhancements & Technical Design
1. Temporary Chat Mode (
new.js)--tempCLI flag foropencli chatgpt-app new --temp.新的臨時聊天/檔案), Simplified Chinese (新的临时聊天/文件), and English (New Temporary Chat/File) menu path click selectors.2. Multi-Modal Local Image Attachments (
ask.js&ax.js)--imagepaths foropencli chatgpt-app ask "Describe" --image /path/to/image.png.AX_SEND_SCRIPT) that serializes existing user pasteboard items before writing images to the General Pasteboard, fully restoring them immediately after pasting to prevent any data loss..cghidEventTap) with PID-targeted events (.postToPid(app.processIdentifier)), preventing keyboard shortcut simulation drift if the user focuses on other windows.valueBeforeSend).3. Safety, Robustness, and Synchronization
execSync("sleep ...")) into non-blocking asynchronous Promise/setTimeout chains.as!) with safe castings (as?) and custom nil checking to prevent runtimeSIGABRTcrashes.waitForElement) to significantly speed up popover automation."停止產生","停止傳送","经典模型","經典模型").Unit & Integration Test Logs
Added extensive tests in
clis/chatgpt-app/ax.test.jsto ensure stability and verify pasteboard preservation, process-targeted event delivery, dynamic polling, safe castings, and Chinese localized translation mappings.All 3,450 unit and integration tests under OpenCLI pass successfully (100% success rate):
RUN v4.1.4 /Users/pierre/.gemini/antigravity/scratch/OpenCLI ✓ adapter clis/chatgpt-app/ax.test.js (13 tests) 4ms ✓ adapter clis/chatgpt-app/commands.test.js (3 tests) 2ms Test Files 364 passed (364) Tests 3450 passed (3450) Start at 16:02:23 Duration 13.23s (transform 6.64s, setup 0ms, import 23.67s, tests 21.80s, environment 23ms)