Part of #1. Final-mile work to make sure the new path is regression-safe.
Goal
Add unit and integration-style tests covering the new /v1/responses route, the Anthropic→Responses adapter, reasoning round-trip, and streaming event translation.
Current state
tests/ contains:
anthropic-request.test.ts
anthropic-response.test.ts
create-chat-completions.test.ts
No tests touch responses, gpt-5, reasoning, codex, or encrypted_content.
Tasks
Acceptance criteria
bun test passes locally
- Coverage for the new
src/routes/responses/, src/routes/messages/responses-*translation.ts, and src/services/copilot/create-responses.ts modules is ≥ 80%
- Existing tests remain green
File pointers
tests/anthropic-request.test.ts — reference style
tests/anthropic-response.test.ts — reference style
- AGENTS.md — test conventions
Part of #1. Final-mile work to make sure the new path is regression-safe.
Goal
Add unit and integration-style tests covering the new
/v1/responsesroute, the Anthropic→Responses adapter, reasoning round-trip, and streaming event translation.Current state
tests/contains:anthropic-request.test.tsanthropic-response.test.tscreate-chat-completions.test.tsNo tests touch
responses,gpt-5,reasoning,codex, orencrypted_content.Tasks
tests/responses-request.test.ts— Anthropic Messages → Responses input itemsthinkingblock withsignatureinto a reasoning item withencrypted_content(Model-to-endpoint routing (chat vs responses) #5, Anthropic /v1/messages → Responses API adapter #8)tests/responses-response.test.ts— Responses output → both OpenAI and Anthropictests/responses-stream.test.ts— SSE event sequencingmessage_stoptests/model-routing.test.ts— verify/v1/chat/completionsforgpt-5.3-codexeither bridges or returns a clear 400 (per the policy in Add upstream Responses API service client #4)tests/fixtures/responses/with realistic upstream SSE traces (capture once with--show-token --verboseand scrub)Acceptance criteria
bun testpasses locallysrc/routes/responses/,src/routes/messages/responses-*translation.ts, andsrc/services/copilot/create-responses.tsmodules is ≥ 80%File pointers
tests/anthropic-request.test.ts— reference styletests/anthropic-response.test.ts— reference style