membphis commented on PR #14139:
URL: https://github.com/apache/apisix/pull/14139#issuecomment-6622301775

   @shreemaan-abhishek, could you confirm these two regressions on 
`60ba771f2221a9a2d661974c1f98a0b0b671b508`? I reproduced them with a focused 
Lua harness using the PR modules and the core request-cache function, rather 
than a full gateway integration run. If confirmed, please fix both and add 
regression coverage before merge.
   
   1. **Template variables outside `model` and `messages[].content` stop 
rendering.** The schema accepts extra template properties. For example, `user: 
"{{ user_id }}"` and `metadata: {"tenant": "{{ tenant }}"}`, with request 
values `user_id: "alice"` and `tenant: "acme"`, used to render to `"alice"` and 
`"acme"`. On this head both placeholders are forwarded literally. 
`render_template` only visits the model and message-content fields. Please 
preserve rendering for all configured string values, including nested fields, 
while retaining the JSON-safe encoding, and add regression tests.
   
   2. **A cached body bypasses a later caller's smaller `max_req_body_size`.** 
`ai-prompt/body.lua:27` now uses `get_json_request_body_table(max_size)`, whose 
cache-hit branch returns before checking `max_size`. In a focused reproduction, 
a 193-byte JSON body returns 413 from `body.read(10)` on a cold cache, but is 
accepted by `body.read(10)` after `body.read(1000)` has cached it. The previous 
uncached `get_body(10)` rejects it. This also affects a prompt plugin running 
before another plugin or `ai-proxy` with a smaller limit. Please enforce each 
caller's limit when reusing the cache and add a chained-plugin regression test.


-- 
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]

Reply via email to