mirror of
https://gh-proxy.org/https://github.com/klinsmaya/sub2api.git
synced 2026-11-09 01:16:46 +08:00
Reuse applyGrokFreeMessagesFunctionToolCacheRoute on native /v1/responses and the Grok WS HTTP bridge so Free OAuth requests with client function tools get the same mixed-tools cache route as the Messages bridge (append/convert web_search and x_search). Also dedupe: Grok Build already declares function tools named web_search, so naive append caused "Duplicate tool names: web_search". Convert those function entries to native tool types and skip duplicates. Only Free OAuth accounts (isKnownGrokFreeAccount); paid/unknown unchanged.