fix(chatgpt): add Traditional Chinese tool labels so --deep-research and --web-search work on zh-TW UI - #2463
Open
GGGODLIN wants to merge 1 commit into
Open
Conversation
…nd web-search `CHATGPT_TOOL_OPTIONS` only carried Simplified Chinese and English labels, so `--deep-research` and `--web-search` threw "Could not find the ChatGPT <tool> tool option." on a zh-TW UI. The zh-TW UI uses different wording rather than the Traditional-character form of the Simplified strings: 深度研究 -> 深入研究, 网页搜索 -> 網頁搜尋. Converting 深度研究 character-by-character still yields 深度研究, which never appears in the zh-TW menu, so the Traditional strings have to be listed explicitly. Prepend both to their label arrays and cover them in the existing current-tool-detection cases. Co-Authored-By: Claude <noreply@anthropic.com>
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
opencli chatgpt ask --deep-researchand--web-searchfail on a Traditional Chinese (zh-TW) ChatGPT UI. The tool labels inCHATGPT_TOOL_OPTIONScover only Simplified Chinese and English.Root cause
clis/chatgpt/utils.js:The zh-TW UI uses different wording, not the Traditional-character form of those strings:
Character conversion does not close the gap: 深度研究 converted character-by-character is still 深度研究, which never appears in the zh-TW menu.
selectChatGPTToolmatches menu entries by visible text, so the lookup finds nothing and throws.Fix
Prepend the Traditional Chinese wording to both label arrays, and cover both in the existing
chatgpt current tool detectioncases. Data-only change; Simplified and English UIs keep their existing behaviour.Verification
OPENCLI_CONFIG_DIR=$(mktemp -d) npx vitest run clis/chatgpt/utils.test.js— 121 passed. Filtering to the tool-label cases shows the two new ones running:Behavioural check on a zh-TW Pro account. Before:
After:
The resulting conversation shows the tool applied — the user turn reads:
Tested against opencli 1.8.7 (npm latest at time of writing) with extension v1.0.24.
Related: #2462 reports a separate, unfixed breakage in the same adapter (
chatgpt modeltier switching). This PR does not address that one.