Files
CLIProxyAPI/internal/translator/codex/openai
sususu 74e7ff609b perf(codex/chat): cache tool metadata per stream instead of rescanning per tool call
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
2026-10-21 16:37:48 +08:00
..