fix(chatgpt): support current tool menu rows#2117
Open
lavapapa wants to merge 1 commit into
Open
Conversation
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
Fix ChatGPT Deep Research/Web Search tool selection after ChatGPT changed the composer tools menu from role-based menu items to custom tabbable rows.
Changes:
selectChatGPTToolnow supports both legacy[role="menuitemradio"]options and currentdiv[tabindex="0"]custom tool rows, using guarded label matching for Deep Research and Web Search.getCurrentChatGPTToolnow detects selected tool controls/pills only and ignores editable prompt text that happens to mention “Deep Research” / “深度研究”.sendChatGPTMessagenow clears editable draft text while preservingcontenteditable="false"selected tool pills in#prompt-textarea.Verification
npm test -- --run clis/chatgpt/utils.test.js clis/chatgpt/commands.test.jsnpm run buildnode dist/src/main.js validate chatgpt/asknpm run dev -- chatgpt ask "请用一段话说明:这是 OpenCLI source main Deep Research selector smoke test,若进入深度研究请只生成极短报告。" --deep-research --wait false --new true -f json6a509b4c-990c-83ee-90c7-f1f3c3c0d254iframe title=internal://deep-researchandconnector_openai_deep_researchBackground
The npm latest package
@jackwener/opencli@1.8.6still fails with:Trace summary from local reproduction:
/Users/marvin/.opencli/profiles/default/traces/20260710070322-50fa3f83/summary.md