feat(chatgpt): add model/mode selection and fix response polling#438
Merged
jackwener merged 2 commits intojackwener:mainfrom Mar 25, 2026
Merged
feat(chatgpt): add model/mode selection and fix response polling#438jackwener merged 2 commits intojackwener:mainfrom
jackwener merged 2 commits intojackwener:mainfrom
Conversation
Add --model option to ask and send commands, and a new standalone model command for switching ChatGPT Desktop models via Accessibility API. Supported models: auto, instant, thinking, 5.2-instant, 5.2-thinking. Changes: - ax.ts: add AX_MODEL_SCRIPT (opens Options popover, searches within AXPopover to avoid matching sidebar items, supports legacy models submenu) and AX_GENERATING_SCRIPT (detects "Stop generating" button) - ask.ts: add --model flag; fix polling to wait for generation to complete instead of returning partial/thinking intermediate text - send.ts: add --model flag - model.ts: new standalone command to switch model/mode
Merged
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
--modeloption toaskandsendcommands for selecting ChatGPT model/mode before sendingopencli chatgpt model <model>standalone command for switching modelsaskcommand returning partial/thinking intermediate text instead of waiting for the full responseSupported models
auto,instant,thinking,5.2-instant,5.2-thinkingUsage
Implementation details
Model selection (
ax.ts)desc="Options") to open the model popover5.2-instant,5.2-thinking): clicks "Legacy models" first to expand the submenu, then selects the modeldescprefix matching within the popover for robustnessResponse polling fix (
ask.ts)isGenerating()which checks if the "Stop generating" button exists in the AX tree. Only reads the final response after generation completesFiles changed
src/clis/chatgpt/ax.tsAX_MODEL_SCRIPT,AX_GENERATING_SCRIPT,selectModel(),isGenerating(),MODEL_CHOICESsrc/clis/chatgpt/ask.ts--modelarg, fix polling to wait for generation completionsrc/clis/chatgpt/send.ts--modelargsrc/clis/chatgpt/model.tsTest plan
opencli chatgpt model auto— switches to Autoopencli chatgpt model thinking— switches to Thinkingopencli chatgpt model 5.2-thinking— opens Legacy submenu, selects GPT-5.2 Thinkingopencli chatgpt model autoafter legacy model — correctly selects Auto (not sidebar items)opencli chatgpt ask "what is 2+2?" --model thinking— waits for full response, not thinking textopencli chatgpt ask "explain quantum computing in 3 sentences" --model thinking --timeout 60— returns complete response