Skip to content

Check the body of a plain chat reply - #38

Merged
rogers-andrew merged 3 commits into
cppalliance:masterfrom
rogers-andrew:qa-plan-tests
Nov 25, 2026
Merged

rogers-andrew merged 3 commits into
cppalliance:masterfrom
rogers-andrew:qa-plan-tests

Conversation

@rogers-andrew

@rogers-andrew rogers-andrew commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

This pull request adds one test to the Gateway and changes only test code. It is based on 52fd92d, the head of master on 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 model field. 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, in crates/gateway/app/src/relay.rs. Every existing test in the workspace passed under either break:

  • One makes the function return an empty JSON object as the body.
  • The other makes it put the backend's own model name in the model field.

The new test compares the whole body

a_plain_chat_request_is_answered_with_the_backends_reply, in crates/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 that model must hold the public name. It fails under either break.

The tests and the verification commands pass

I measured these on 52fd92d when I wrote the test, and the plan records them.

  • cargo nextest run --locked --workspace --all-features runs 1,964 tests, and all pass.
  • Without --all-features the workspace runs 1,963 tests. Under each break, 1,962 of those pass and the new test fails.
  • Clippy, cargo fmt, cargo doc, and cargo test -p build-xtask pass.

The plan gives both breaks in full

vibe/2026-11/2026-11-20-1-plain-chat-reply-body.md

🤖 Generated with Claude Code

rogers-andrew and others added 3 commits November 20, 2026 14:03
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>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ba2a1bae-4dec-4905-b31c-80906191c4bf
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@rogers-andrew
rogers-andrew marked this pull request as ready for review November 23, 2026 17:38
Copilot AI balanced review requested due to automatic review settings November 23, 2026 17:38

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@awheeler294 awheeler294 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@rogers-andrew
rogers-andrew merged commit edeec31 into cppalliance:master Nov 25, 2026
19 checks passed
@rogers-andrew
rogers-andrew deleted the qa-plan-tests branch November 25, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants