mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-26 08:02:08 +00:00
Skip the Responses API intermediate representation on the /v1/messages force-chat path. Previously every streaming token ran through two state machines (CC→Responses→Anthropic); now it runs through one (CC→Anthropic). New file backend/internal/pkg/apicompat/chatcompletions_anthropic_bridge.go: - AnthropicToChatCompletionsRequest: request-side direct conversion - ChatCompletionsResponseToAnthropic: non-stream response direct conversion - ChatCompletionsChunkToAnthropicEvents + Finalize: single streaming state machine openai_gateway_messages_chat_fallback.go rewired to use the direct bridge. Existing 7 ForceChatCompletions end-to-end tests pass unchanged; 22 new unit tests added including equivalence tests vs the double-conversion path.