mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-19 00:13:11 +08:00
Every function-call event previously rebuilt the short-to-original name map (walking all historical messages) and re-collected Responses tool winners over a fresh full parse of the original request. Resolve reverse names, ordinary function names, and custom-patch winners once into a small metadata struct shared by the streaming params and the non-stream loop. Golden SHA-256 tests from the previous implementation plus an equivalence test against the legacy helpers (including tools-as-object Array() semantics, function/custom same-name veto, namespace custom tools, additional_tools) pin behavior. Benchmark (long history, 4 tool calls): 221us -> 124us per stream, heap -39%. Refs #6816