waterWang opened a new pull request, #13797: URL: https://github.com/apache/apisix/pull/13797
**Problem:** When ai-proxy-multi fallback_strategy retries a failed instance, the `request_llm_model` nginx var is overwritten with the retry instance's model instead of keeping the client's original model. **Root cause:** `get_json_request_body_table()` returns a cached request-body table. `build_body` mutates this cached table's `.model` field to the picked instance's model. On the fallback retry, the same cached (now mutated) table is returned, so `request_llm_model = request_body.model` reads the wrong value. **Fix:** Capture the client's original model only on the first attempt via `ctx.ai_request_llm_captured` and preserve it across retries. **Test:** Added TEST 7-8 to `ai-proxy-multi-retry.t` — verifies `request_llm_model=model_test` (client original) after fallback, and no `request_llm_model=gpt-4` (instance model). Fixes https://github.com/apache/apisix/issues/13769 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
