Repository navigation
Check the body of a plain chat reply - #38
Merged
Merged
Conversation
A chat request that does not ask to stream is answered with one JSON body, and no test reads it: the Gateway can return an empty object, or the wrong model name, while every test passes. The plan adds one test and lists the two breaks that must each fail it. Plan: vibe/2026-11/2026-11-20-1-plain-chat-reply-body.md Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
No test read the body the Gateway returns for a chat request that does not ask to stream. With that body replaced by an empty object, or with the backend's model name in place of the public one, all 1,962 tests passed. One test now reads the body whole. No production code changes. - `a_plain_chat_request_is_answered_with_the_backends_reply`: a plain request for the public model `test-model` is answered with the backend's whole reply, named for `test-model`. - Each of the two breaks of `chat_completions` now fails this test, and only this test. Plan: vibe/2026-11/2026-11-20-1-plain-chat-reply-body.md Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Each of the two breaks now fails the new test and no other, and a default build has 1,963 tests, one more than before. The plan also records what `vibelight` reported. Plan: vibe/2026-11/2026-11-20-1-plain-chat-reply-body.md Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues with the added non-streaming chat response regression coverage.
No open issues 🎉
What changed in this PR
Adds regression coverage for non-streaming chat responses without changing production code. The test checks that the Gateway returns the complete expected JSON reply with the caller’s public model name.
Changes:
- Adds one integration test asserting HTTP 200 and full response-body equality.
- Documents the test plan and reported verification against empty-body and incorrect-model regressions.
| File | Description |
|---|---|
vibe/2026-11/2026-11-20-1-plain-chat-reply-body.md |
Records scope, acceptance criteria, and verification results. |
crates/gateway/app/tests/it/chat.rs |
Adds the non-streaming chat response-body regression test. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds one test to the Gateway and changes only test code. It is based on
52fd92d, the head ofmasteron 2026-11-23. Related tests for the Harness and Workshop are in cppalliance/runvil-harness#60 and cppalliance/runvil-workshop#32.The tests did not read the body of a plain chat reply
A plain chat request is one that does not ask for a streamed reply. The Gateway answers it with one JSON body. That body is the backend's reply, with the model's public name, the name callers use, in its
modelfield. The tests checked the HTTP status of that answer and the request that the Gateway forwarded to the backend. They did not read the body.I showed that with two breaks, deliberate faults put into
chat_completions, incrates/gateway/app/src/relay.rs. Every existing test in the workspace passed under either break:modelfield.The new test compares the whole body
a_plain_chat_request_is_answered_with_the_backends_reply, incrates/gateway/app/tests/it/chat.rs, sends a plain chat request to a Gateway whose backend is the test suite's fake OpenAI backend. It requires the body to equal that backend's reply, except thatmodelmust hold the public name. It fails under either break.The tests and the verification commands pass
I measured these on
52fd92dwhen I wrote the test, and the plan records them.cargo nextest run --locked --workspace --all-featuresruns 1,964 tests, and all pass.--all-featuresthe workspace runs 1,963 tests. Under each break, 1,962 of those pass and the new test fails.cargo fmt,cargo doc, andcargo test -p build-xtaskpass.The plan gives both breaks in full
vibe/2026-11/2026-11-20-1-plain-chat-reply-body.md🤖 Generated with Claude Code