Part of #38. Small but important — fixes misleading documentation and missing types.
Background
non-stream-translation.ts:305 contains:
// GitHub Copilot doesn't generate thinking blocks, so we don't include them in responses
This comment is factually wrong as of Claude 4.5+ on the native Anthropic path. It was accurate for the OpenAI translation path (Copilot's /chat/completions doesn't return thinking), but confusing and misleading for anyone reading the code after #38 lands.
Additionally, anthropic-types.ts is missing fields that the native Anthropic path returns:
AnthropicThinkingBlock.signature?: string — the encrypted thinking signature for multi-turn
AnthropicMessagesResponse.usage.cache_creation.ephemeral_1h_input_tokens — returned by native path
AnthropicMessagesResponse.usage.cache_creation.ephemeral_5m_input_tokens — returned by native path
Tasks
Acceptance criteria
- No
grep "doesn't generate thinking" hits in the repo after this lands
- TypeScript types correctly represent the native Anthropic response shape
- No test regressions
File pointers
- Touch:
src/routes/messages/non-stream-translation.ts:305
- Touch:
src/routes/messages/anthropic-types.ts
Part of #38. Small but important — fixes misleading documentation and missing types.
Background
non-stream-translation.ts:305contains:// GitHub Copilot doesn't generate thinking blocks, so we don't include them in responsesThis comment is factually wrong as of Claude 4.5+ on the native Anthropic path. It was accurate for the OpenAI translation path (Copilot's
/chat/completionsdoesn't return thinking), but confusing and misleading for anyone reading the code after #38 lands.Additionally,
anthropic-types.tsis missing fields that the native Anthropic path returns:AnthropicThinkingBlock.signature?: string— the encrypted thinking signature for multi-turnAnthropicMessagesResponse.usage.cache_creation.ephemeral_1h_input_tokens— returned by native pathAnthropicMessagesResponse.usage.cache_creation.ephemeral_5m_input_tokens— returned by native pathTasks
non-stream-translation.ts:305: replace the comment with:anthropic-types.ts:signature?: stringtoAnthropicThinkingBlock(orAnthropicThinkingContentBlock)cache_creation?: { ephemeral_1h_input_tokens: number; ephemeral_5m_input_tokens: number }to theusagefield inAnthropicMessagesResponseinference_geo?: stringto usage (returned by haiku model in live test)Acceptance criteria
grep "doesn't generate thinking"hits in the repo after this landsFile pointers
src/routes/messages/non-stream-translation.ts:305src/routes/messages/anthropic-types.ts