Skip to content

fix(chatgpt): support current tool menu rows#2117

Open
lavapapa wants to merge 1 commit into
jackwener:mainfrom
lavapapa:fix-chatgpt-deep-research-selector
Open

fix(chatgpt): support current tool menu rows#2117
lavapapa wants to merge 1 commit into
jackwener:mainfrom
lavapapa:fix-chatgpt-deep-research-selector

Conversation

@lavapapa

Copy link
Copy Markdown
Contributor

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:

  • selectChatGPTTool now supports both legacy [role="menuitemradio"] options and current div[tabindex="0"] custom tool rows, using guarded label matching for Deep Research and Web Search.
  • getCurrentChatGPTTool now detects selected tool controls/pills only and ignores editable prompt text that happens to mention “Deep Research” / “深度研究”.
  • sendChatGPTMessage now clears editable draft text while preserving contenteditable="false" selected tool pills in #prompt-textarea.
  • Added jsdom regressions for custom Deep Research rows, selected pill detection, prompt-text false positives, and pill preservation.

Verification

  • npm test -- --run clis/chatgpt/utils.test.js clis/chatgpt/commands.test.js
    • 2 files passed, 115 tests passed
  • npm run build
    • manifest compiled successfully
  • node dist/src/main.js validate chatgpt/ask
    • PASS, checked 1 command, 0 errors, 0 warnings
  • Live authenticated smoke from this worktree:
    • npm run dev -- chatgpt ask "请用一段话说明:这是 OpenCLI source main Deep Research selector smoke test,若进入深度研究请只生成极短报告。" --deep-research --wait false --new true -f json
    • returned conversation 6a509b4c-990c-83ee-90c7-f1f3c3c0d254
    • browser state showed iframe title=internal://deep-research and connector_openai_deep_research

Background

The npm latest package @jackwener/opencli@1.8.6 still fails with:

ok: false
error:
  code: COMMAND_EXEC
  message: Could not find the ChatGPT Deep Research tool option.

Trace summary from local reproduction:
/Users/marvin/.opencli/profiles/default/traces/20260710070322-50fa3f83/summary.md

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