Skip to content

test: test streamed chat happy path - #8

Open
ZsomborTothAxem wants to merge 2 commits into
integration/test-e2-server-integrationfrom
shd-1002/test-streamed-chat-happy-path
Open

ZsomborTothAxem wants to merge 2 commits into
integration/test-e2-server-integrationfrom
shd-1002/test-streamed-chat-happy-path

Conversation

@ZsomborTothAxem

@ZsomborTothAxem ZsomborTothAxem commented Sep 14, 2026

Copy link
Copy Markdown

Type of change

  • New feature
  • Bug fix
  • Breaking change
  • Refactoring or maintenance
  • Documentation update

Related issue

Closes: SHD-1002

Description

Adds the streamed chat happy-path integration test using the real HTTP router, temporary SQLite database, and fake SSE upstream.

The test verifies ordered content chunks, final usage data, [DONE] termination, and usage accounting for the correct user and model. The server now always requests upstream usage data for reliable accounting.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --verbose --all-features
  • cargo test --verbose --all-features
  • Relevant Docker, service-integration, or documentation checks

Additional validation details:

  • cargo test -p shaide --test streamed_chat - passed

Deployment and compatibility

None. No migrations, configuration changes, or breaking API changes.

Documentation

No documentation changes are needed; the existing integration-test harness documentation covers this test pattern.

Checklist

  • I added or updated tests for changed behavior, or explained why tests are not needed.
  • I updated user-facing and API documentation where necessary.
  • My commits follow the Conventional Commits specification.
  • Every commit includes a Signed-off-by trailer (git commit -s).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T06:31:23.191337Z 4e17636 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e1763652a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +220 to +226
request
.stream_options
.get_or_insert(ChatCompletionStreamOptions {
include_usage: None,
include_obfuscation: None,
});
}
})
.include_usage = Some(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Respect explicit opt-out from usage chunks

When a streaming caller sends stream_options.include_usage: false, this assignment overwrites the explicit preference before proxying the request. The upstream can therefore emit a terminal usage-only chunk with empty choices, which the forwarding loop passes directly to the caller; clients that deliberately disabled such chunks may then fail on an unexpected event shape. Preserve the original client preference and, if usage must still be requested for accounting, record but suppress that chunk unless the caller opted in.

Useful? React with 👍 / 👎.

Signed-off-by: ZsomborTothAxem <zsombor.toth@axem.dev>
Signed-off-by: ZsomborTothAxem <zsombor.toth@axem.dev>
@ZsomborTothAxem
ZsomborTothAxem force-pushed the shd-1002/test-streamed-chat-happy-path branch from 4e17636 to 09964aa Compare September 14, 2026 06:40
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.

2 participants