Aias00 opened a new issue, #7907:
URL: https://github.com/apache/shenyu/issues/7907
### Behavior and reproduction
The response-transformer system prompt requests a complete HTTP/1.1 response
including its status line. The plugin applies the generated headers/body but
never applies that status.
At `fda742c48e7f553c9964cf74b36732326d0fde00`, use the real response
decorator with upstream status 200 and a mocked ChatClient emitting:
```http
HTTP/1.1 404 Not Found
Content-Type: application/json
{"error":"missing"}
```
Observed response: **200 OK** with body `{"error":"missing"}`. The generated
404 is silently discarded. This was executed with Spring MockServerWebExchange
and the actual writeWith/parser path; no live model is required.
### Location and cause
- [System prompt explicitly includes a status
line](https://github.com/apache/shenyu/blob/fda742c48e7f553c9964cf74b36732326d0fde00/shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-response-transformer/src/main/java/org/apache/shenyu/plugin/ai/transformer/response/template/AiResponseTransformerTemplate.java#L52)
- [Apply only extracted headers and
body](https://github.com/apache/shenyu/blob/fda742c48e7f553c9964cf74b36732326d0fde00/shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-response-transformer/src/main/java/org/apache/shenyu/plugin/ai/transformer/response/AiResponseTransformerPlugin.java#L363)
The parser skips the HTTP status line, and no generated status reaches
setStatusCode before commit.
### Expected behavior / suggested repair
Define and implement status handling consistently with the advertised
full-response contract. Parse and validate a generated status before committing
(or explicitly constrain the feature/prompt to preserve the upstream status).
Retain the upstream status for omitted/invalid output. Regress 404, a success
status, invalid codes, and no-content status/body semantics.
### Scope / related issues
Functional HTTP contract mismatch, medium severity. Distinct from #6756
(mutating headers before validating a generated body) and #6773 (null existing
status during prompt construction). Deduped against current open PRs and issue
history.
--
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]