Skip to content

tests: add unit tests for OpenAiChatCompletionsProvider#3036

Merged
Salazareo merged 1 commit into
mainfrom
DS/2959
May 9, 2026
Merged

tests: add unit tests for OpenAiChatCompletionsProvider#3036
Salazareo merged 1 commit into
mainfrom
DS/2959

Conversation

@Salazareo
Copy link
Copy Markdown
Member

Mocks the OpenAI SDK at the module boundary, boots a real PuterServer for the wired MeteringService/stores/FSService, and exercises construction, model catalog (responses_api_only filtering), argument validation (messages-array gate, web_search routing — error when no sibling, delegation when one is set), request shape (max_completion_ tokens rename, gpt-5 vs non-gpt-5 reasoning_effort/verbosity gating, stream_options gating), non-stream + streaming output (cached-token splitting), the moderations.create flagging branch (above and at the 0.8 threshold), and error mapping.

closes #2959

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 41.45%
⬆️ +0.29%
7327 / 17674
🔵 Statements 40.55%
⬆️ +0.28%
7726 / 19051
🔵 Functions 44.77%
⬆️ +0.43%
1337 / 2986
🔵 Branches 30.48%
⬆️ +0.27%
4280 / 14040
File CoverageNo changed files found.
Generated in workflow #105 for commit 679e5c6 by the Vitest Coverage Report Action

Mocks the OpenAI SDK at the module boundary, boots a real PuterServer
for the wired MeteringService/stores/FSService, and exercises
construction, model catalog (responses_api_only filtering), argument
validation (messages-array gate, web_search routing — error when no
sibling, delegation when one is set), request shape (max_completion_
tokens rename, gpt-5 vs non-gpt-5 reasoning_effort/verbosity gating,
stream_options gating), non-stream + streaming output (cached-token
splitting), the moderations.create flagging branch (above and at the
0.8 threshold), and error mapping.

closes #2959
@Salazareo Salazareo merged commit 87f0294 into main May 9, 2026
4 checks passed
@Salazareo Salazareo deleted the DS/2959 branch May 10, 2026 21:28
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.

[Tests] Add unit tests for OpenAiChatCompletionsProvider with mocked client

1 participant