mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 12:02:27 +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.