Skip to content

tests: add unit tests for ClaudeProvider with mocked Anthropic SDK#3038

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

tests: add unit tests for ClaudeProvider with mocked Anthropic SDK#3038
Salazareo merged 1 commit into
mainfrom
DS/2958

Conversation

@Salazareo
Copy link
Copy Markdown
Member

Mocks @anthropic-ai/sdk at the module boundary, boots a real PuterServer for the wired MeteringService/stores/FSService, and exercises construction (long timeout for Opus 4.7 thinking), model catalog/resolution, request shape (tool_choice locking, system message extraction, OpenAI-shape tool_calls → Claude tool_use blocks, tool role → user tool_result, opus-4.7 temperature drop, adaptive thinking config, enabled budget thinking + temperature=1 for older Sonnet), non-stream output (input/output/cache token metering), streaming via the message_start/content_block_*/message_delta/message_stop event graph for both text_delta and input_json_delta tool_use, and the moderation throw.

closes #2958

Mocks @anthropic-ai/sdk at the module boundary, boots a real
PuterServer for the wired MeteringService/stores/FSService, and
exercises construction (long timeout for Opus 4.7 thinking), model
catalog/resolution, request shape (tool_choice locking, system message
extraction, OpenAI-shape tool_calls → Claude tool_use blocks, tool
role → user tool_result, opus-4.7 temperature drop, adaptive thinking
config, enabled budget thinking + temperature=1 for older Sonnet),
non-stream output (input/output/cache token metering), streaming via
the message_start/content_block_*/message_delta/message_stop event
graph for both text_delta and input_json_delta tool_use, and the
moderation throw.

closes #2958
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 40.3%
⬆️ +0.72%
7124 / 17674
🔵 Statements 39.47%
⬆️ +0.71%
7520 / 19051
🔵 Functions 42.93%
⬆️ +0.74%
1282 / 2986
🔵 Branches 29.35%
⬆️ +0.80%
4122 / 14040
File CoverageNo changed files found.
Generated in workflow #98 for commit 66c781c by the Vitest Coverage Report Action

@Salazareo Salazareo merged commit 31f22bc into main May 9, 2026
4 checks passed
@Salazareo Salazareo deleted the DS/2958 branch May 10, 2026 21:29
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 ClaudeProvider with mocked Anthropic SDK

1 participant